diff options
Diffstat (limited to 'bootloader/imx233.c')
-rw-r--r-- | bootloader/imx233.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bootloader/imx233.c b/bootloader/imx233.c index 2380dfae5b..6d356b9cce 100644 --- a/bootloader/imx233.c +++ b/bootloader/imx233.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "system-target.h" | 39 | #include "system-target.h" |
40 | #include "fmradio_i2c.h" | 40 | #include "fmradio_i2c.h" |
41 | #include "version.h" | 41 | #include "version.h" |
42 | #include "powermgmt.h" | ||
42 | 43 | ||
43 | #include "usb.h" | 44 | #include "usb.h" |
44 | 45 | ||
@@ -81,6 +82,8 @@ static void usb_mode(int connect_timeout) | |||
81 | { | 82 | { |
82 | /* Got the message - wait for disconnect */ | 83 | /* Got the message - wait for disconnect */ |
83 | printf("Bootloader USB mode"); | 84 | printf("Bootloader USB mode"); |
85 | /* Enable power management to charge */ | ||
86 | powermgmt_init(); | ||
84 | 87 | ||
85 | usb_acknowledge(SYS_USB_CONNECTED_ACK); | 88 | usb_acknowledge(SYS_USB_CONNECTED_ACK); |
86 | 89 | ||
@@ -89,6 +92,16 @@ static void usb_mode(int connect_timeout) | |||
89 | button = button_get_w_tmo(HZ/2); | 92 | button = button_get_w_tmo(HZ/2); |
90 | if(button == SYS_USB_DISCONNECTED) | 93 | if(button == SYS_USB_DISCONNECTED) |
91 | break; | 94 | break; |
95 | struct imx233_powermgmt_info_t info = imx233_powermgmt_get_info(); | ||
96 | lcd_putsf(0, 7, "Charging status: %s", | ||
97 | info.state == CHARGE_STATE_DISABLED ? "disabled" : | ||
98 | info.state == CHARGE_STATE_ERROR ? "error" : | ||
99 | info.state == DISCHARGING ? "discharging" : | ||
100 | info.state == TRICKLE ? "trickle" : | ||
101 | info.state == TOPOFF ? "topoff" : | ||
102 | info.state == CHARGING ? "charging" : "<unknown>"); | ||
103 | lcd_putsf(0, 8, "Battery: %d%%", battery_level()); | ||
104 | lcd_update(); | ||
92 | } | 105 | } |
93 | } | 106 | } |
94 | 107 | ||