diff options
author | cpldcpu <cpldcpu@gmail.com> | 2013-12-28 14:09:54 +0100 |
---|---|---|
committer | cpldcpu <cpldcpu@gmail.com> | 2013-12-28 14:09:54 +0100 |
commit | 26b1c45b1145f9b96c4ec90e93a61a3da63e2473 (patch) | |
tree | e4cfb4513c2c462fb6e19f221a44846c899564e4 /firmware/main.c | |
parent | 2e10478426a6f0d04099bdb24fc17102a6abde1b (diff) | |
download | micronucleus-26b1c45b1145f9b96c4ec90e93a61a3da63e2473.tar.gz micronucleus-26b1c45b1145f9b96c4ec90e93a61a3da63e2473.tar.bz2 micronucleus-26b1c45b1145f9b96c4ec90e93a61a3da63e2473.zip |
firmware: removed low power code - was dysfunctional
Diffstat (limited to 'firmware/main.c')
-rw-r--r-- | firmware/main.c | 40 |
1 files changed, 9 insertions, 31 deletions
diff --git a/firmware/main.c b/firmware/main.c index bafb121..48ac399 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -237,22 +237,15 @@ void PushMagicWord (void) { static void initHardware (void) { - MCUSR=0; /* need this to properly disable watchdog */ - wdt_disable(); - - #if LOW_POWER_MODE - // turn off clock prescalling - chip must run at full speed for usb - // if you might run chip at lower voltages, detect that in bootLoaderStartCondition - CLKPR = 1 << CLKPCE; - CLKPR = 0; - #endif + MCUSR=0; /* need this to properly disable watchdog */ + wdt_disable(); - - usbDeviceDisconnect(); /* do this while interrupts are disabled */ - _delay_ms(500); - usbDeviceConnect(); - usbInit(); // Initialize INT settings after reconnect - sei(); + usbDeviceDisconnect(); /* do this while interrupts are disabled */ + _delay_ms(500); + usbDeviceConnect(); + usbInit(); // Initialize INT settings after reconnect + + sei(); } /* ------------------------------------------------------------------------ */ @@ -290,11 +283,7 @@ int main(void) { #if OSCCAL_RESTORE osccal_default = OSCCAL; #endif - - #if (!SET_CLOCK_PRESCALER) && LOW_POWER_MODE - uint8_t prescaler_default = CLKPR; - #endif - + bootLoaderInit(); #if AUTO_EXIT_NO_USB_MS @@ -331,17 +320,6 @@ int main(void) { } while((!isEvent(EVENT_EXECUTE))||(pgm_read_byte(BOOTLOADER_ADDRESS - TINYVECTOR_RESET_OFFSET + 1)==0xff)); } - // set clock prescaler to desired clock speed (changing from clkdiv8, or no division, depending on fuses) - #if LOW_POWER_MODE - #ifdef SET_CLOCK_PRESCALER - CLKPR = 1 << CLKPCE; - CLKPR = SET_CLOCK_PRESCALER; - #else - CLKPR = 1 << CLKPCE; - CLKPR = prescaler_default; - #endif - #endif - LED_EXIT(); #if OSCCAL_RESTORE |