Make sure that the NVM bus/controller busy waits in the AVRISP MKII clone project...
[pub/USBasp.git] / Projects / TemperatureDataLogger / TempDataLogger.c
index 35bf68b..5910528 100644 (file)
@@ -137,16 +137,17 @@ ISR(TIMER1_COMPA_vect, ISR_BLOCK)
  */\r
 int main(void)\r
 {\r
-       /* Fetch logging interval from EEPROM */\r
-       LoggingInterval500MS_SRAM = eeprom_read_byte(&LoggingInterval500MS_EEPROM);\r
-\r
        SetupHardware();\r
 \r
-       LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
+       /* Fetch logging interval from EEPROM */\r
+       LoggingInterval500MS_SRAM = eeprom_read_byte(&LoggingInterval500MS_EEPROM);\r
 \r
        /* Mount and open the log file on the dataflash FAT partition */\r
        OpenLogFile();\r
 \r
+       LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
+       sei();\r
+\r
        /* Discard the first sample from the temperature sensor, as it is generally incorrect */\r
        volatile uint8_t Dummy = Temperature_GetTemperature();\r
        (void)Dummy;\r