Skip to content

Commit

Permalink
Only abort on startup if USB reaches UNCONNECTED state
Browse files Browse the repository at this point in the history
  • Loading branch information
David Morris committed May 20, 2013
1 parent d9e3563 commit 9d71c53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ int main(void)
USB_Init();
uint32_t nojack=0x000FFFFF; //Countdown timer - a few hundered ms of 0v on jack detect forces a shutdown
while (bDeviceState != CONFIGURED) { //Wait for USB config - timeout causes shutdown
if(Millis>10000 || !nojack) //No USB cable - shutdown (Charger pin will be set to open drain, cant be disabled without usb)
if((Millis>10000 && UNCONNECTED)|| !nojack) //No USB cable - shutdown (Charger pin will be set to open drain, cant be disabled without usb)
shutdown();
if(GET_VBUS_STATE) //Jack detect resets the countdown
nojack=0x0FFFFF;
Expand Down

0 comments on commit 9d71c53

Please sign in to comment.