diff options
author | cpldcpu <cpldcpu@gmail.com> | 2013-10-25 22:32:23 +0200 |
---|---|---|
committer | cpldcpu <cpldcpu@gmail.com> | 2013-10-25 22:32:23 +0200 |
commit | 5b7617bfb1763f14a9e1e8792447d75cd076d2fa (patch) | |
tree | d6bc0edebdbdeb292e72fe4c107e7c0f0f9eba5b /firmware | |
parent | 514438c414c5727c4205cff41365fa1a028cad5b (diff) | |
download | micronucleus-5b7617bfb1763f14a9e1e8792447d75cd076d2fa.tar.gz micronucleus-5b7617bfb1763f14a9e1e8792447d75cd076d2fa.tar.bz2 micronucleus-5b7617bfb1763f14a9e1e8792447d75cd076d2fa.zip |
Bugfixes to make micronucleus reentrant
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/main.c b/firmware/main.c index 60c3e23..527923e 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -395,6 +395,8 @@ static inline void leaveBootloader(void) { //DBG1(0x01, 0, 0); bootLoaderExit(); cli(); + usbDeviceDisconnect(); /* do this while interrupts are disabled */ + USB_INTR_ENABLE = 0; USB_INTR_CFG = 0; /* also reset config bits */ @@ -428,6 +430,7 @@ int main(void) { uint8_t prescaler_default = CLKPR; #endif + MCUSR=0; wdt_disable(); /* main app may have enabled watchdog */ tiny85FlashInit(); bootLoaderInit(); |