diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-06-06 22:23:52 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-06-06 22:23:52 +0000 |
commit | 0dd1f8ec11f28fe34c93ba97af95eb2be2fef44f (patch) | |
tree | e3e77d4e6b25b82c82b3570cd8c4a988c7788e66 /firmware/backlight.c | |
parent | 8c9e22580e220b793130ed3ac67b9c54e85b3d0f (diff) | |
download | rockbox-0dd1f8ec11f28fe34c93ba97af95eb2be2fef44f.tar.gz rockbox-0dd1f8ec11f28fe34c93ba97af95eb2be2fef44f.zip |
Work-in-progress rework of charging status reading & display: * Changed several charging related HAVE_* macros into one multi-value CONFIG_CHARGING. * Always use proper macros for charging states. * Battery symbol charging animation now starts from current level on all targets with charging. Two-colour animation kept for non-b&w targets. Round down fill level while charging as before, but round to nearest pixel value for discharging on all targets. * Charging anim fixed on player. * Some code cleanup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10080 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/backlight.c')
-rw-r--r-- | firmware/backlight.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index aac438c673..76ffc6f0e4 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c | |||
@@ -156,14 +156,14 @@ static struct event_queue backlight_queue; | |||
156 | 156 | ||
157 | static int backlight_timer; | 157 | static int backlight_timer; |
158 | static int backlight_timeout = 5*HZ; | 158 | static int backlight_timeout = 5*HZ; |
159 | #ifdef HAVE_CHARGING | 159 | #ifdef CONFIG_CHARGING |
160 | static int backlight_timeout_plugged = 5*HZ; | 160 | static int backlight_timeout_plugged = 5*HZ; |
161 | #endif | 161 | #endif |
162 | 162 | ||
163 | #ifdef HAVE_REMOTE_LCD | 163 | #ifdef HAVE_REMOTE_LCD |
164 | static int remote_backlight_timer; | 164 | static int remote_backlight_timer; |
165 | static int remote_backlight_timeout = 5*HZ; | 165 | static int remote_backlight_timeout = 5*HZ; |
166 | #ifdef HAVE_CHARGING | 166 | #ifdef CONFIG_CHARGING |
167 | static int remote_backlight_timeout_plugged = 5*HZ; | 167 | static int remote_backlight_timeout_plugged = 5*HZ; |
168 | #endif | 168 | #endif |
169 | #endif | 169 | #endif |
@@ -370,7 +370,7 @@ void backlight_thread(void) | |||
370 | { | 370 | { |
371 | #ifdef HAVE_REMOTE_LCD | 371 | #ifdef HAVE_REMOTE_LCD |
372 | case REMOTE_BACKLIGHT_ON: | 372 | case REMOTE_BACKLIGHT_ON: |
373 | #ifdef HAVE_CHARGING | 373 | #ifdef CONFIG_CHARGING |
374 | if (charger_inserted() | 374 | if (charger_inserted() |
375 | #ifdef HAVE_USB_POWER | 375 | #ifdef HAVE_USB_POWER |
376 | || usb_powered() | 376 | || usb_powered() |
@@ -399,7 +399,7 @@ void backlight_thread(void) | |||
399 | 399 | ||
400 | #endif /* HAVE_REMOTE_LCD */ | 400 | #endif /* HAVE_REMOTE_LCD */ |
401 | case BACKLIGHT_ON: | 401 | case BACKLIGHT_ON: |
402 | #ifdef HAVE_CHARGING | 402 | #ifdef CONFIG_CHARGING |
403 | if (charger_inserted() | 403 | if (charger_inserted() |
404 | #ifdef HAVE_USB_POWER | 404 | #ifdef HAVE_USB_POWER |
405 | || usb_powered() | 405 | || usb_powered() |
@@ -447,7 +447,7 @@ void backlight_thread(void) | |||
447 | 447 | ||
448 | static void backlight_tick(void) | 448 | static void backlight_tick(void) |
449 | { | 449 | { |
450 | #ifdef HAVE_CHARGING | 450 | #ifdef CONFIG_CHARGING |
451 | static bool charger_was_inserted = false; | 451 | static bool charger_was_inserted = false; |
452 | bool charger_is_inserted = charger_inserted() | 452 | bool charger_is_inserted = charger_inserted() |
453 | #ifdef HAVE_USB_POWER | 453 | #ifdef HAVE_USB_POWER |
@@ -463,7 +463,7 @@ static void backlight_tick(void) | |||
463 | #endif | 463 | #endif |
464 | } | 464 | } |
465 | charger_was_inserted = charger_is_inserted; | 465 | charger_was_inserted = charger_is_inserted; |
466 | #endif /* HAVE_CHARGING */ | 466 | #endif /* CONFIG_CHARGING */ |
467 | 467 | ||
468 | if(backlight_timer) | 468 | if(backlight_timer) |
469 | { | 469 | { |
@@ -535,7 +535,7 @@ bool is_backlight_on(void) | |||
535 | /* return value in ticks; 0 means always on, <0 means always off */ | 535 | /* return value in ticks; 0 means always on, <0 means always off */ |
536 | int backlight_get_current_timeout(void) | 536 | int backlight_get_current_timeout(void) |
537 | { | 537 | { |
538 | #ifdef HAVE_CHARGING | 538 | #ifdef CONFIG_CHARGING |
539 | if (charger_inserted() | 539 | if (charger_inserted() |
540 | #ifdef HAVE_USB_POWER | 540 | #ifdef HAVE_USB_POWER |
541 | || usb_powered() | 541 | || usb_powered() |
@@ -558,7 +558,7 @@ void backlight_set_timeout(int index) | |||
558 | backlight_on(); | 558 | backlight_on(); |
559 | } | 559 | } |
560 | 560 | ||
561 | #ifdef HAVE_CHARGING | 561 | #ifdef CONFIG_CHARGING |
562 | void backlight_set_timeout_plugged(int index) | 562 | void backlight_set_timeout_plugged(int index) |
563 | { | 563 | { |
564 | if((unsigned)index >= sizeof(backlight_timeout_value)) | 564 | if((unsigned)index >= sizeof(backlight_timeout_value)) |
@@ -589,7 +589,7 @@ void remote_backlight_set_timeout(int index) | |||
589 | remote_backlight_on(); | 589 | remote_backlight_on(); |
590 | } | 590 | } |
591 | 591 | ||
592 | #ifdef HAVE_CHARGING | 592 | #ifdef CONFIG_CHARGING |
593 | void remote_backlight_set_timeout_plugged(int index) | 593 | void remote_backlight_set_timeout_plugged(int index) |
594 | { | 594 | { |
595 | if((unsigned)index >= sizeof(backlight_timeout_value)) | 595 | if((unsigned)index >= sizeof(backlight_timeout_value)) |
@@ -603,7 +603,7 @@ void remote_backlight_set_timeout_plugged(int index) | |||
603 | /* return value in ticks; 0 means always on, <0 means always off */ | 603 | /* return value in ticks; 0 means always on, <0 means always off */ |
604 | int remote_backlight_get_current_timeout(void) | 604 | int remote_backlight_get_current_timeout(void) |
605 | { | 605 | { |
606 | #ifdef HAVE_CHARGING | 606 | #ifdef CONFIG_CHARGING |
607 | if (charger_inserted() | 607 | if (charger_inserted() |
608 | #ifdef HAVE_USB_POWER | 608 | #ifdef HAVE_USB_POWER |
609 | || usb_powered() | 609 | || usb_powered() |