Documentation improvements - put driver example code into its own section, fix incorr...
[pub/USBasp.git] / Projects / TempDataLogger / TempDataLogger.c
index c572a38..e374427 100644 (file)
@@ -208,7 +208,7 @@ void SetupHardware(void)
        TWI_Init();
 
        /* 500ms logging interval timer configuration */
        TWI_Init();
 
        /* 500ms logging interval timer configuration */
-       OCR1A   = ((F_CPU / 1024) / 2);
+       OCR1A   = (((F_CPU / 1024) / 2) - 1);
        TCCR1B  = (1 << WGM12) | (1 << CS12) | (1 << CS10);
        TIMSK1  = (1 << OCIE1A);
 
        TCCR1B  = (1 << WGM12) | (1 << CS12) | (1 << CS10);
        TIMSK1  = (1 << OCIE1A);
 
@@ -239,8 +239,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
 {
        bool ConfigSuccess = true;
 
 {
        bool ConfigSuccess = true;
 
-       ConfigSuccess &= MS_Device_ConfigureEndpoints(&Disk_MS_Interface);
        ConfigSuccess &= HID_Device_ConfigureEndpoints(&Generic_HID_Interface);
        ConfigSuccess &= HID_Device_ConfigureEndpoints(&Generic_HID_Interface);
+       ConfigSuccess &= MS_Device_ConfigureEndpoints(&Disk_MS_Interface);
 
        LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
 }
 
        LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
 }