Make sure that the NVM bus/controller busy waits in the AVRISP MKII clone project...
[pub/USBasp.git] / Projects / TemperatureDataLogger / TempDataLogger.c
index fbe32ce..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
@@ -252,7 +253,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
  *\r
  *  \param[in] MSInterfaceInfo  Pointer to the Mass Storage class interface configuration structure being referenced\r
  */\r
-bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)\r
+bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)\r
 {\r
        bool CommandSuccess;\r
        \r