X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/96a12cd12cb9294ba9a7ec5547af81b9c6575748..c58c53dba90fdc19d38f5e5d6957f2ede2a740f3:/Projects/TemperatureDataLogger/TempDataLogger.c diff --git a/Projects/TemperatureDataLogger/TempDataLogger.c b/Projects/TemperatureDataLogger/TempDataLogger.c index 7d26ee25d..955359d45 100644 --- a/Projects/TemperatureDataLogger/TempDataLogger.c +++ b/Projects/TemperatureDataLogger/TempDataLogger.c @@ -110,6 +110,7 @@ ISR(TIMER1_COMPA_vect, ISR_BLOCK) /* Reset log tick counter to prepare for next logging interval */ CurrentLoggingTicks = 0; + /* Only log when not connected to a USB host */ if (USB_DeviceState == DEVICE_STATE_Unattached) { uint8_t Day, Month, Year; @@ -139,15 +140,15 @@ int main(void) /* Fetch logging interval from EEPROM */ LoggingInterval500MS_SRAM = eeprom_read_byte(&LoggingInterval500MS_EEPROM); - LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); - SetupHardware(); + LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + /* Mount and open the log file on the dataflash FAT partition */ OpenLogFile(); /* Discard the first sample from the temperature sensor, as it is generally incorrect */ - uint8_t Dummy = Temperature_GetTemperature(); + volatile uint8_t Dummy = Temperature_GetTemperature(); (void)Dummy; for (;;)