X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/be2a7d45989f5f57b326589350a6ce5bbc835b5c..b3c6599bb7ab8518c3a457579c538c6520e85b01:/Projects/TempDataLogger/TempDataLogger.c diff --git a/Projects/TempDataLogger/TempDataLogger.c b/Projects/TempDataLogger/TempDataLogger.c index 7d88ba7bf..ee9ca188c 100644 --- a/Projects/TempDataLogger/TempDataLogger.c +++ b/Projects/TempDataLogger/TempDataLogger.c @@ -89,7 +89,7 @@ uint8_t LoggingInterval500MS_SRAM; /** Total number of 500ms logging ticks elapsed since the last log value was recorded */ uint16_t CurrentLoggingTicks; -/** FAT Fs structure to hold the internal state of the FAT driver for the dataflash contents. */ +/** FAT Fs structure to hold the internal state of the FAT driver for the Dataflash contents. */ FATFS DiskFATState; /** FAT Fs structure to hold a FAT file handle for the log data write destination. */ @@ -146,7 +146,7 @@ int main(void) if (LoggingInterval500MS_SRAM == 0xFF) LoggingInterval500MS_SRAM = DEFAULT_LOG_INTERVAL; - /* Mount and open the log file on the dataflash FAT partition */ + /* Mount and open the log file on the Dataflash FAT partition */ OpenLogFile(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); @@ -230,20 +230,19 @@ void EVENT_USB_Device_Disconnect(void) { LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); - /* Mount and open the log file on the dataflash FAT partition */ + /* Mount and open the log file on the Dataflash FAT partition */ OpenLogFile(); } /** Event handler for the library USB Configuration Changed event. */ void EVENT_USB_Device_ConfigurationChanged(void) { - LEDs_SetAllLEDs(LEDMASK_USB_READY); + bool ConfigSuccess = true; + + ConfigSuccess &= MS_Device_ConfigureEndpoints(&Disk_MS_Interface); + ConfigSuccess &= HID_Device_ConfigureEndpoints(&Generic_HID_Interface); - if (!(MS_Device_ConfigureEndpoints(&Disk_MS_Interface))) - LEDs_SetAllLEDs(LEDMASK_USB_ERROR); - - if (!(HID_Device_ConfigureEndpoints(&Generic_HID_Interface))) - LEDs_SetAllLEDs(LEDMASK_USB_ERROR); + LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); } /** Event handler for the library USB Unhandled Control Request event. */