diff options
Diffstat (limited to 'firmware')
| -rw-r--r-- | firmware/backlight.c | 8 | ||||
| -rw-r--r-- | firmware/drivers/button.c | 14 | ||||
| -rw-r--r-- | firmware/export/backlight.h | 4 | ||||
| -rw-r--r-- | firmware/export/button.h | 3 | ||||
| -rw-r--r-- | firmware/export/config.h | 4 | ||||
| -rw-r--r-- | firmware/powermgmt.c | 2 |
6 files changed, 19 insertions, 16 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index 99da3df..a273b94 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c @@ -90,7 +90,7 @@ static inline void __backlight_off(void) #endif #endif /* SIMULATOR */ -#if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER) +#if CONFIG_BACKLIGHT && !defined(BOOTLOADER) const signed char backlight_timeout_value[19] = { @@ -804,10 +804,10 @@ void backlight_set_brightness(int val) } #endif /* HAVE_BACKLIGHT_BRIGHTNESS */ -#else /* !defined(CONFIG_BACKLIGHT) || defined(BOOTLOADER) +#else /* (CONFIG_BACKLIGHT == 0) || defined(BOOTLOADER) -- no backlight, empty dummy functions */ -#if defined(BOOTLOADER) && defined(CONFIG_BACKLIGHT) +#if defined(BOOTLOADER) && CONFIG_BACKLIGHT void backlight_init(void) { #ifdef __BACKLIGHT_INIT @@ -830,4 +830,4 @@ bool is_remote_backlight_on(void) {return true;} #ifdef HAVE_BACKLIGHT_BRIGHTNESS void backlight_set_brightness(int val) { (void)val; } #endif -#endif /* defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER) */ +#endif /* CONFIG_BACKLIGHT && !defined(BOOTLOADER) */ diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 5a40bdf..a1fd58c 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -43,7 +43,7 @@ static long last_read; /* Last button status, for debouncing/filtering */ #ifdef HAVE_LCD_BITMAP static bool flipped; /* buttons can be flipped to match the LCD flip */ #endif -#ifdef CONFIG_BACKLIGHT +#if CONFIG_BACKLIGHT static bool filter_first_keypress; #ifdef HAVE_REMOTE_LCD static bool remote_filter_first_keypress; @@ -71,7 +71,7 @@ static void button_tick(void) static int repeat_count = 0; static bool repeat = false; static bool post = false; -#ifdef CONFIG_BACKLIGHT +#if CONFIG_BACKLIGHT static bool skip_release = false; #ifdef HAVE_REMOTE_LCD static bool skip_remote_release = false; @@ -112,7 +112,7 @@ static void button_tick(void) diff = btn ^ lastbtn; if(diff && (btn & diff) == 0) { -#ifdef CONFIG_BACKLIGHT +#if CONFIG_BACKLIGHT #ifdef HAVE_REMOTE_LCD if(diff & BUTTON_REMOTE) if(!skip_remote_release) @@ -202,7 +202,7 @@ static void button_tick(void) if (queue_empty(&button_queue)) { queue_post(&button_queue, BUTTON_REPEAT | btn, 0); -#ifdef CONFIG_BACKLIGHT +#if CONFIG_BACKLIGHT #ifdef HAVE_REMOTE_LCD skip_remote_release = false; #endif @@ -213,7 +213,7 @@ static void button_tick(void) } else { -#ifdef CONFIG_BACKLIGHT +#if CONFIG_BACKLIGHT #ifdef HAVE_REMOTE_LCD if (btn & BUTTON_REMOTE) { if (!remote_filter_first_keypress || is_remote_backlight_on() @@ -288,7 +288,7 @@ void button_init(void) #ifdef HAVE_LCD_BITMAP flipped = false; #endif -#ifdef CONFIG_BACKLIGHT +#if CONFIG_BACKLIGHT filter_first_keypress = false; #ifdef HAVE_REMOTE_LCD remote_filter_first_keypress = false; @@ -360,7 +360,7 @@ void button_set_flip(bool flip) } #endif /* HAVE_LCD_BITMAP */ -#ifdef CONFIG_BACKLIGHT +#if CONFIG_BACKLIGHT void set_backlight_filter_keypress(bool value) { filter_first_keypress = value; diff --git a/firmware/export/backlight.h b/firmware/export/backlight.h index 1cd6c47..2873666 100644 --- a/firmware/export/backlight.h +++ b/firmware/export/backlight.h @@ -26,7 +26,7 @@ void backlight_on(void); void backlight_off(void); void backlight_set_timeout(int index); -#ifdef CONFIG_BACKLIGHT +#if CONFIG_BACKLIGHT void backlight_init(void); #if defined(IAUDIO_X5) && !defined(SIMULATOR) @@ -54,7 +54,7 @@ void lcd_set_sleep_after_backlight_off(int index); extern const signed char lcd_sleep_timeout_value[]; #endif -#else /* ndef CONFIG_BACKLIGHT */ +#else /* CONFIG_BACKLIGHT == 0 */ #define backlight_init() #endif /* CONFIG_BACKLIGHT */ diff --git a/firmware/export/button.h b/firmware/export/button.h index 102d542..ea3effc 100644 --- a/firmware/export/button.h +++ b/firmware/export/button.h @@ -1,4 +1,3 @@ - /*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ @@ -34,7 +33,7 @@ void button_clear_queue(void); #ifdef HAVE_LCD_BITMAP void button_set_flip(bool flip); /* turn 180 degrees */ #endif -#ifdef CONFIG_BACKLIGHT +#if CONFIG_BACKLIGHT void set_backlight_filter_keypress(bool value); #ifdef HAVE_REMOTE_LCD void set_remote_backlight_filter_keypress(bool value); diff --git a/firmware/export/config.h b/firmware/export/config.h index 8283b37..1a3e0be 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -230,6 +230,10 @@ #define CONFIG_LED 0 #endif +#ifndef CONFIG_BACKLIGHT +#define CONFIG_BACKLIGHT 0 +#endif + #ifndef CONFIG_CHARGING #define CONFIG_CHARGING 0 #endif diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index a31acbc..1a1d576 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c @@ -702,7 +702,7 @@ static int runcurrent(void) current = CURRENT_USB; } -#if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER) +#if CONFIG_BACKLIGHT && !defined(BOOTLOADER) if (backlight_get_current_timeout() == 0) /* LED always on */ current += CURRENT_BACKLIGHT; #endif |