forked from len0rd/rockbox
Added USB insertion handling
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1259 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
43eda43c20
commit
392f3853b1
2 changed files with 37 additions and 7 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#include "i2c.h"
|
||||
#include "debug.h"
|
||||
#include "rtc.h"
|
||||
#include "usb.h"
|
||||
|
||||
#define BACKLIGHT_ON 1
|
||||
#define BACKLIGHT_OFF 2
|
||||
|
|
@ -55,6 +56,7 @@ void backlight_thread(void)
|
|||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
case BACKLIGHT_OFF:
|
||||
#ifdef HAVE_RTC
|
||||
rtc_write(0x13, 0x00);
|
||||
|
|
@ -62,6 +64,16 @@ void backlight_thread(void)
|
|||
PADR &= ~0x40;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case SYS_USB_CONNECTED:
|
||||
/* Tell the USB thread that we are safe */
|
||||
DEBUGF("backlight_thread got SYS_USB_CONNECTED\n");
|
||||
usb_acknowledge(SYS_USB_CONNECTED_ACK);
|
||||
|
||||
/* Wait until the system reboots */
|
||||
while(1)
|
||||
yield();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue