summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r--firmware/target/arm/as3525/sansa-c200v2/backlight-target.h7
-rw-r--r--firmware/target/arm/as3525/sansa-clip/backlight-target.h2
-rw-r--r--firmware/target/arm/as3525/sansa-clipplus/backlight-target.h1
-rw-r--r--firmware/target/arm/as3525/sansa-clipv2/backlight-target.h1
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/backlight-target.h1
-rw-r--r--firmware/target/arm/as3525/sansa-fuze/backlight-target.h1
-rw-r--r--firmware/target/arm/as3525/sansa-fuzev2/backlight-target.h1
-rw-r--r--firmware/target/arm/as3525/sansa-m200v4/backlight-target.h2
-rw-r--r--firmware/target/arm/as3525/system-as3525.c2
9 files changed, 18 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/sansa-c200v2/backlight-target.h b/firmware/target/arm/as3525/sansa-c200v2/backlight-target.h
index c09e759138..4a098f7f28 100644
--- a/firmware/target/arm/as3525/sansa-c200v2/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-c200v2/backlight-target.h
@@ -27,6 +27,13 @@ bool _backlight_init(void);
27void _backlight_pwm(int on); 27void _backlight_pwm(int on);
28void _backlight_on(void); 28void _backlight_on(void);
29void _backlight_off(void); 29void _backlight_off(void);
30
31static inline void _backlight_panic_on(void)
32{
33 _backlight_on();
34 _backlight_pwm(1);
35}
36
30void _backlight_set_brightness(int brightness); 37void _backlight_set_brightness(int brightness);
31int __backlight_is_on(void); 38int __backlight_is_on(void);
32 39
diff --git a/firmware/target/arm/as3525/sansa-clip/backlight-target.h b/firmware/target/arm/as3525/sansa-clip/backlight-target.h
index f836fb9ab2..00c6e5cc44 100644
--- a/firmware/target/arm/as3525/sansa-clip/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-clip/backlight-target.h
@@ -35,6 +35,8 @@ static inline void _backlight_off(void)
35 lcd_enable(false); 35 lcd_enable(false);
36} 36}
37 37
38#define _backlight_panic_on() _backlight_on()
39
38static inline bool _backlight_init(void) 40static inline bool _backlight_init(void)
39{ 41{
40 GPIOD_DIR |= (1<<7); /* for button light */ 42 GPIOD_DIR |= (1<<7); /* for button light */
diff --git a/firmware/target/arm/as3525/sansa-clipplus/backlight-target.h b/firmware/target/arm/as3525/sansa-clipplus/backlight-target.h
index 2990083440..3dd9240bd8 100644
--- a/firmware/target/arm/as3525/sansa-clipplus/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-clipplus/backlight-target.h
@@ -25,5 +25,6 @@
25 25
26void _backlight_on(void); 26void _backlight_on(void);
27void _backlight_off(void); 27void _backlight_off(void);
28#define _backlight_panic_on() _backlight_on()
28 29
29#endif 30#endif
diff --git a/firmware/target/arm/as3525/sansa-clipv2/backlight-target.h b/firmware/target/arm/as3525/sansa-clipv2/backlight-target.h
index d8c013a64a..3000b575c7 100644
--- a/firmware/target/arm/as3525/sansa-clipv2/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-clipv2/backlight-target.h
@@ -26,6 +26,7 @@
26 26
27void _backlight_on(void); 27void _backlight_on(void);
28void _backlight_off(void); 28void _backlight_off(void);
29#define _backlight_panic_on() _backlight_on()
29 30
30static inline bool _backlight_init(void) 31static inline bool _backlight_init(void)
31{ 32{
diff --git a/firmware/target/arm/as3525/sansa-e200v2/backlight-target.h b/firmware/target/arm/as3525/sansa-e200v2/backlight-target.h
index db2cecc07a..227a154197 100644
--- a/firmware/target/arm/as3525/sansa-e200v2/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-e200v2/backlight-target.h
@@ -24,6 +24,7 @@
24#define _backlight_init() true 24#define _backlight_init() true
25void _backlight_on(void); 25void _backlight_on(void);
26void _backlight_off(void); 26void _backlight_off(void);
27#define _backlight_panic_on() _backlight_on()
27void _backlight_set_brightness(int brightness); 28void _backlight_set_brightness(int brightness);
28int __backlight_is_on(void); 29int __backlight_is_on(void);
29 30
diff --git a/firmware/target/arm/as3525/sansa-fuze/backlight-target.h b/firmware/target/arm/as3525/sansa-fuze/backlight-target.h
index 2d60ac35c2..df6df573b0 100644
--- a/firmware/target/arm/as3525/sansa-fuze/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-fuze/backlight-target.h
@@ -24,6 +24,7 @@
24#define _backlight_init() true 24#define _backlight_init() true
25void _backlight_on(void); 25void _backlight_on(void);
26void _backlight_off(void); 26void _backlight_off(void);
27#define _backlight_panic_on() _backlight_on()
27void _backlight_set_brightness(int brightness); 28void _backlight_set_brightness(int brightness);
28#ifdef HAVE_BUTTON_LIGHT 29#ifdef HAVE_BUTTON_LIGHT
29void _buttonlight_on(void); 30void _buttonlight_on(void);
diff --git a/firmware/target/arm/as3525/sansa-fuzev2/backlight-target.h b/firmware/target/arm/as3525/sansa-fuzev2/backlight-target.h
index e4ed7870ec..f9d7005f79 100644
--- a/firmware/target/arm/as3525/sansa-fuzev2/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-fuzev2/backlight-target.h
@@ -28,6 +28,7 @@
28bool _backlight_init(void); 28bool _backlight_init(void);
29void _backlight_on(void); 29void _backlight_on(void);
30void _backlight_off(void); 30void _backlight_off(void);
31#define _backlight_panic_on() _backlight_on()
31void _backlight_set_brightness(int brightness); 32void _backlight_set_brightness(int brightness);
32#ifdef HAVE_BUTTON_LIGHT 33#ifdef HAVE_BUTTON_LIGHT
33void _buttonlight_on(void); 34void _buttonlight_on(void);
diff --git a/firmware/target/arm/as3525/sansa-m200v4/backlight-target.h b/firmware/target/arm/as3525/sansa-m200v4/backlight-target.h
index 50404f7090..b5560bd037 100644
--- a/firmware/target/arm/as3525/sansa-m200v4/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-m200v4/backlight-target.h
@@ -37,4 +37,6 @@ static inline void _backlight_off(void)
37 GPIOD_PIN(1) = 0x00; 37 GPIOD_PIN(1) = 0x00;
38} 38}
39 39
40#define _backlight_panic_on() _backlight_on()
41
40#endif 42#endif
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c
index 5eae1a35b3..3ba56cf30a 100644
--- a/firmware/target/arm/as3525/system-as3525.c
+++ b/firmware/target/arm/as3525/system-as3525.c
@@ -392,6 +392,8 @@ void system_reboot(void)
392 392
393void system_exception_wait(void) 393void system_exception_wait(void)
394{ 394{
395 /* make sure lcd+backlight are on */
396 _backlight_panic_on();
395 /* wait until button release (if a button is pressed) */ 397 /* wait until button release (if a button is pressed) */
396 while(button_read_device()); 398 while(button_read_device());
397 /* then wait until next button press */ 399 /* then wait until next button press */