diff options
author | cpldcpu <cpldcpu@gmail.com> | 2014-07-14 21:56:25 +0200 |
---|---|---|
committer | cpldcpu <cpldcpu@gmail.com> | 2014-07-14 21:56:31 +0200 |
commit | a1e06e102573dbb2bdb9db3c0acd774a7f9c6346 (patch) | |
tree | fcec09c60ec395047ef40f0eb671b693c357e9f4 /firmware | |
parent | 902b613ad809ac76e07301f4a4193e8de2e6250c (diff) | |
download | micronucleus-a1e06e102573dbb2bdb9db3c0acd774a7f9c6346.tar.gz micronucleus-a1e06e102573dbb2bdb9db3c0acd774a7f9c6346.tar.bz2 micronucleus-a1e06e102573dbb2bdb9db3c0acd774a7f9c6346.zip |
firmware: Fix corruption of USB pins when bootloader is not activated
see: https://github.com/micronucleus/micronucleus/issues/52
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/main.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/main.c b/firmware/main.c index 0de341a..194156c 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -211,11 +211,6 @@ static inline void leaveBootloader(void) { bootLoaderExit(); - usbDeviceDisconnect(); /* Disconnect micronucleus */ - - USB_INTR_ENABLE = 0; - USB_INTR_CFG = 0; /* also reset config bits */ - #if OSCCAL_RESTORE_DEFAULT OSCCAL=osccal_default; nop(); // NOP to avoid CPU hickup during oscillator stabilization @@ -344,6 +339,11 @@ int main(void) { } while(1); LED_EXIT(); + + usbDeviceDisconnect(); /* Disconnect micronucleus */ + USB_INTR_ENABLE = 0; + USB_INTR_CFG = 0; /* also reset config bits */ + } leaveBootloader(); |