Be doubly-certain that the incomming CDC class driver's endpoint/pipe is flushed...
[pub/USBasp.git] / Projects / TemperatureDataLogger / TempDataLogger.c
index 538a6a5..2f2e8da 100644 (file)
@@ -96,6 +96,7 @@ FATFS DiskFATState;
 FIL TempLogFile;\r
 \r
 \r
 FIL TempLogFile;\r
 \r
 \r
+/** ISR to handle the 500ms ticks for sampling and data logging */\r
 ISR(TIMER1_COMPA_vect, ISR_BLOCK)\r
 {\r
        uint8_t LEDMask = LEDs_GetLEDs();\r
 ISR(TIMER1_COMPA_vect, ISR_BLOCK)\r
 {\r
        uint8_t LEDMask = LEDs_GetLEDs();\r
@@ -157,6 +158,7 @@ int main(void)
        }\r
 }\r
 \r
        }\r
 }\r
 \r
+/** Opens the log file on the Dataflash's FAT formatted partition according to the current date */\r
 void OpenLogFile(void)\r
 {\r
        char LogFileName[12];\r
 void OpenLogFile(void)\r
 {\r
        char LogFileName[12];\r
@@ -172,6 +174,7 @@ void OpenLogFile(void)
        f_lseek(&TempLogFile, TempLogFile.fsize);\r
 }\r
 \r
        f_lseek(&TempLogFile, TempLogFile.fsize);\r
 }\r
 \r
+/** Closes the open data log file on the Dataflash's FAT formatted partition */\r
 void CloseLogFile(void)\r
 {\r
        /* Sync any data waiting to be written, unmount the storage device */\r
 void CloseLogFile(void)\r
 {\r
        /* Sync any data waiting to be written, unmount the storage device */\r
@@ -301,6 +304,7 @@ void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDI
        DS1307_SetDate(ReportParams->Day,  ReportParams->Month,  ReportParams->Year);\r
        DS1307_SetTime(ReportParams->Hour, ReportParams->Minute, ReportParams->Second);\r
        \r
        DS1307_SetDate(ReportParams->Day,  ReportParams->Month,  ReportParams->Year);\r
        DS1307_SetTime(ReportParams->Hour, ReportParams->Minute, ReportParams->Second);\r
        \r
+       /* If the logging interval has changed from its current value, write it to EEPROM */\r
        if (LoggingInterval500MS_SRAM != ReportParams->LogInterval500MS)\r
        {\r
                LoggingInterval500MS_SRAM = ReportParams->LogInterval500MS;\r
        if (LoggingInterval500MS_SRAM != ReportParams->LogInterval500MS)\r
        {\r
                LoggingInterval500MS_SRAM = ReportParams->LogInterval500MS;\r