summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorKevin Ferrare <kevin@rockbox.org>2005-11-20 01:02:14 +0000
committerKevin Ferrare <kevin@rockbox.org>2005-11-20 01:02:14 +0000
commit1a1abf25f43e33dfa7d421d6c43f283763226dbd (patch)
tree71e57b7c1f5d3c2521fbf2215e938b55fe77bb99 /firmware/drivers
parente3367212bd8a25cfe6468aa20adaacf4c5b0b2d4 (diff)
removed old statusbar and buttonbar code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8004 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/led.c54
1 files changed, 30 insertions, 24 deletions
diff --git a/firmware/drivers/led.c b/firmware/drivers/led.c
index ca4aadac71..1e38fa63d3 100644
--- a/firmware/drivers/led.c
+++ b/firmware/drivers/led.c
@@ -23,44 +23,50 @@
#include "system.h"
#include "kernel.h"
+static bool disk_led_status;
+static long last_on; /* timestamp of switching off */
+
+
+
+void disk_led_on(void)
+{
+ disk_led_status=true;
#if CONFIG_LED == LED_REAL
+#ifdef GMINI_ARCH
+ P2 |= 1;
+#else
+ or_b(0x40, &PBDRL);
+#endif
+#endif
+}
-void led(bool on)
+void disk_led_off(void)
{
- if ( on )
+ if(disk_led_status)
+ {
+ last_on = current_tick;/* remember for off delay */
+ disk_led_status=false;
+#if CONFIG_LED == LED_REAL
#ifdef GMINI_ARCH
- P2 |= 1;
- else
P2 &= ~1;
#else
- {
- or_b(0x40, &PBDRL);
- }
- else
- {
and_b(~0x40, &PBDRL);
- }
#endif
+#endif
+ }
}
-#elif CONFIG_LED == LED_VIRTUAL
-
-static bool current;
-static long last_on; /* timestamp of switching off */
-
void led(bool on)
{
- if (current && !on) /* switching off */
- {
- last_on = current_tick; /* remember for off delay */
- }
- current = on;
+ if ( on )
+ disk_led_on();
+ else
+ disk_led_off();
}
-bool led_read(int delayticks) /* read by status bar update */
+bool led_read(int delayticks)
{
/* reading "off" is delayed by user-supplied monoflop value */
- return (current || TIME_BEFORE(current_tick, last_on+delayticks));
+ return (disk_led_status ||
+ TIME_BEFORE(current_tick, last_on+delayticks));
}
-
-#endif /* CONFIG_LED */