Added error codes to most StillImageHost demo commands.
[pub/USBasp.git] / Demos / OTG / TestApp / TestApp.c
index ef903f0..562348b 100644 (file)
@@ -51,7 +51,7 @@ int main(void)
                CheckButton();\r
                CheckTemperature();\r
 \r
-               /* Clear output-compare flag (logic 1 clears the flag) */\r
+               /* Clear millisecond timer's Output Compare flag (logic 1 clears the flag) */\r
                TIFR0 |= (1 << OCF0A);\r
                \r
                USB_USBTask();\r
@@ -114,11 +114,12 @@ void CheckTemperature(void)
 {\r
        static uint16_t MSElapsed = 0;\r
 \r
+       /* Timer 0's compare flag is set every millisecond */\r
        if (TIFR0 & (1 << OCF0A))\r
          MSElapsed++;\r
 \r
        /* Task runs every 10000 ticks, 10 seconds for this demo */\r
-       if (MSElapsed == 1000)\r
+       if (MSElapsed == 10000)\r
        {\r
                printf_P(PSTR("Current temperature: %d Degrees Celcius\r\n\r\n"),\r
                         (int8_t)Temperature_GetTemperature());\r
@@ -135,6 +136,7 @@ void CheckButton(void)
        static uint16_t DebounceMSElapsed = 0;\r
        static bool     IsPressed;\r
        \r
+       /* Timer 0's compare flag is set every millisecond */\r
        if (TIFR0 & (1 << OCF0A))\r
          DebounceMSElapsed++;\r
 \r