summaryrefslogtreecommitdiffstats
path: root/firmware/debug.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-07-04 16:09:53 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-07-04 16:09:53 +0000
commit5b4221b279fe375e285767ab9139f1bb6fb08ab4 (patch)
treef6b4a59f9e0e7e45f6d0aa12072aab1e969a2053 /firmware/debug.c
parent7cafe7aa2f2aa671a39bd82dfd227e2aa22ef30f (diff)
downloadrockbox-5b4221b279fe375e285767ab9139f1bb6fb08ab4.tar.gz
rockbox-5b4221b279fe375e285767ab9139f1bb6fb08ab4.tar.bz2
rockbox-5b4221b279fe375e285767ab9139f1bb6fb08ab4.zip
Now uses power.c/h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1334 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/debug.c')
-rw-r--r--firmware/debug.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/firmware/debug.c b/firmware/debug.c
index e4ef9c9df4..a7923ac237 100644
--- a/firmware/debug.c
+++ b/firmware/debug.c
@@ -34,6 +34,7 @@ static char debugbuf[200];
#include "lcd.h"
#include "adc.h"
#include "mas.h"
+#include "power.h"
void debug_init(void)
{
@@ -230,6 +231,8 @@ void dbg_ports(void)
int button;
int battery_voltage;
int batt_int, batt_frac;
+ bool charge_status = false;
+ bool ide_status = true;
lcd_clear_display();
@@ -257,7 +260,8 @@ void dbg_ports(void)
batt_int = battery_voltage / 100;
batt_frac = battery_voltage % 100;
- snprintf(buf, 32, "Battery: %d.%02dV", batt_int, batt_frac);
+ snprintf(buf, 32, "Batt: %d.%02dV %d%% ", batt_int, batt_frac,
+ battery_level());
lcd_puts(0, 6, buf);
snprintf(buf, 32, "ATA: %s, 0x%x",
@@ -271,16 +275,19 @@ void dbg_ports(void)
switch(button)
{
+ case BUTTON_ON:
+ charge_status = charge_status?false:true;
+ charger_enable(charge_status);
+ break;
+
case BUTTON_UP:
- /* Toggle the IDE power */
- PADR ^= 0x20;
+ ide_status = ide_status?false:true;
+ ide_power_enable(ide_status);
break;
case BUTTON_OFF:
- /* Disable the charger */
- PBDR |= 0x20;
- /* Enable the IDE power */
- PADR |= 0x20;
+ charger_enable(false);
+ ide_power_enable(true);
return;
}
}