--- iriver_h300.c.orig 2008-09-04 19:55:01.000000000 +0300 +++ iriver_h300.c 2008-09-04 20:00:56.000000000 +0300 @@ -141,6 +141,7 @@ bool on_button = false; bool rec_button = false; bool hold_status = false; + bool mode_button = false; int data; bool rtc_alarm; int button; @@ -215,6 +216,10 @@ sleep(HZ/50); /* Allow the button driver to check the buttons */ rec_button = ((button_status() & BUTTON_REC) == BUTTON_REC) || ((button_status() & BUTTON_RC_REC) == BUTTON_RC_REC); + + /* Check mode button being depressed for "Bootloader USB" fallback */ + mode_button = ((button_status() & BUTTON_MODE) == BUTTON_MODE) + || ((button_status() & BUTTON_RC_MODE) == BUTTON_RC_MODE); check_battery(); @@ -244,8 +249,9 @@ printf("Starting original firmware..."); start_iriver_fw(); } - - if(charger_inserted()) + + /* Check to see if the mode button is depressed to fall back to bootloader charger, rather than starting up normally */ + if(charger_inserted() && mode_button) { const char charging_msg[] = "Charging..."; const char complete_msg[] = "Charging complete"; @@ -304,7 +310,8 @@ usb_init(); /* A hack to enter USB mode without using the USB thread */ - if(usb_detect() == USB_INSERTED) + /* Only enter Bootlader USB if the mode button is depressed, now we boot normally */ + if(usb_detect() == USB_INSERTED && mode_button) { const char msg[] = "Bootloader USB mode"; int w, h;