diff options
-rw-r--r-- | bootloader/main.c | 6 | ||||
-rw-r--r-- | firmware/drivers/pcf50606.c | 3 | ||||
-rw-r--r-- | firmware/usb.c | 1 |
3 files changed, 6 insertions, 4 deletions
diff --git a/bootloader/main.c b/bootloader/main.c index 482abddc8a..40f7a0510d 100644 --- a/bootloader/main.c +++ b/bootloader/main.c | |||
@@ -175,7 +175,7 @@ void main(void) | |||
175 | power_init(); | 175 | power_init(); |
176 | 176 | ||
177 | /* Turn off if neither ON button is pressed */ | 177 | /* Turn off if neither ON button is pressed */ |
178 | if(!(on_button || rc_on_button)) | 178 | if(!(on_button || rc_on_button || usb_detect())) |
179 | power_off(); | 179 | power_off(); |
180 | 180 | ||
181 | /* Backlight ON */ | 181 | /* Backlight ON */ |
@@ -243,8 +243,8 @@ void main(void) | |||
243 | 243 | ||
244 | /* Don't start if the Hold button is active on the device you | 244 | /* Don't start if the Hold button is active on the device you |
245 | are starting with */ | 245 | are starting with */ |
246 | if((on_button && button_hold()) || | 246 | if(!usb_detect() && ((on_button && button_hold()) || |
247 | (rc_on_button && remote_button_hold())) { | 247 | (rc_on_button && remote_button_hold()))) { |
248 | lcd_puts(0, 8, "HOLD switch on, power off..."); | 248 | lcd_puts(0, 8, "HOLD switch on, power off..."); |
249 | lcd_update(); | 249 | lcd_update(); |
250 | sleep(HZ*2); | 250 | sleep(HZ*2); |
diff --git a/firmware/drivers/pcf50606.c b/firmware/drivers/pcf50606.c index cb05d25345..2504498440 100644 --- a/firmware/drivers/pcf50606.c +++ b/firmware/drivers/pcf50606.c | |||
@@ -281,6 +281,9 @@ void pcf50606_init(void) | |||
281 | 281 | ||
282 | set_voltages(); | 282 | set_voltages(); |
283 | 283 | ||
284 | pcf50606_write(0x08, 0x60); /* Wake on USB and charger insertion */ | ||
285 | pcf50606_write(0x09, 0x60); /* USB and ON key debounce: 14ms */ | ||
286 | |||
284 | /* Backlight PWM = 512Hz 50/50 */ | 287 | /* Backlight PWM = 512Hz 50/50 */ |
285 | /*pcf50606_write(0x35, 0x13);*/ | 288 | /*pcf50606_write(0x35, 0x13);*/ |
286 | pcf50606_set_bl_pwm(9); | 289 | pcf50606_set_bl_pwm(9); |
diff --git a/firmware/usb.c b/firmware/usb.c index 23e2e33737..98f224f781 100644 --- a/firmware/usb.c +++ b/firmware/usb.c | |||
@@ -394,7 +394,6 @@ bool usb_detect(void) | |||
394 | current_status = (P5 & 0x10)?true:false; | 394 | current_status = (P5 & 0x10)?true:false; |
395 | #endif | 395 | #endif |
396 | #ifdef IRIVER_H300 | 396 | #ifdef IRIVER_H300 |
397 | /* TODO: add proper code code for H300 USB style */ | ||
398 | current_status = (GPIO1_READ & 0x80)?true:false; | 397 | current_status = (GPIO1_READ & 0x80)?true:false; |
399 | #endif | 398 | #endif |
400 | #ifdef USB_IPODSTYLE | 399 | #ifdef USB_IPODSTYLE |