Rename PDIProtocol.c/.h to XPROGProtocol.c/.h as it will now handle both TPI and...
[pub/USBasp.git] / Demos / Host / LowLevel / StillImageHost / StillImageHost.c
index 6c56d5f..c4aadb1 100644 (file)
@@ -37,7 +37,7 @@
 #include "StillImageHost.h"\r
 \r
 /** Main program entry point. This routine configures the hardware required by the application, then\r
- *  starts the scheduler to run the application tasks.\r
+ *  enters a loop to run the application tasks in sequence.\r
  */\r
 int main(void)\r
 {\r
@@ -102,8 +102,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
 {\r
        USB_ShutDown();\r
 \r
-       puts_P(PSTR(ESC_FG_RED "Host Mode Error\r\n"));\r
-       printf_P(PSTR(" -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);\r
+       printf_P(PSTR(ESC_FG_RED "Host Mode Error\r\n"\r
+                                " -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);\r
 \r
        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
        for(;;);\r
@@ -114,10 +114,10 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
  */\r
 void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
-       puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
-       printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
-       printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);\r
-       printf_P(PSTR(" -- In State %d\r\n" ESC_FG_WHITE), USB_HostState);\r
+       printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"\r
+                                " -- Error Code %d\r\n"\r
+                                " -- Sub Error Code %d\r\n"\r
+                                " -- In State %d\r\n" ESC_FG_WHITE), ErrorCode, SubErrorCode, USB_HostState);\r
        \r
        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
@@ -155,8 +155,8 @@ void StillImage_Task(void)
                        /* Set the device configuration to the first configuration (rarely do devices use multiple configurations) */\r
                        if ((ErrorCode = USB_Host_SetDeviceConfiguration(1)) != HOST_SENDCONTROL_Successful)\r
                        {\r
-                               puts_P(PSTR(ESC_FG_RED "Control Error (Set Configuration).\r\n"));\r
-                               printf_P(PSTR(" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);\r
+                               printf_P(PSTR(ESC_FG_RED "Control Error (Set Configuration).\r\n"\r
+                                                        " -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);\r
 \r
                                /* Indicate error via status LEDs */\r
                                LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
@@ -189,7 +189,7 @@ void StillImage_Task(void)
                        SImage_SendBlockHeader();\r
                        \r
                        /* Receive the response data block */\r
-                       if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError)\r
+                       if ((ErrorCode = SImage_ReceiveBlockHeader()) != PIPE_RWSTREAM_NoError)\r
                        {\r
                                ShowCommandError(ErrorCode, false);\r
                                \r
@@ -242,7 +242,7 @@ void StillImage_Task(void)
                        printf_P(PSTR("   Device Version: %s\r\n"), DeviceVersion);\r
 \r
                        /* Receive the final response block from the device */\r
-                       if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError)\r
+                       if ((ErrorCode = SImage_ReceiveBlockHeader()) != PIPE_RWSTREAM_NoError)\r
                        {\r
                                ShowCommandError(ErrorCode, false);\r
                                \r
@@ -274,7 +274,7 @@ void StillImage_Task(void)
                        SImage_SendBlockHeader();\r
                        \r
                        /* Receive the response block from the device */\r
-                       if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError)\r
+                       if ((ErrorCode = SImage_ReceiveBlockHeader()) != PIPE_RWSTREAM_NoError)\r
                        {\r
                                ShowCommandError(ErrorCode, false);\r
                                \r
@@ -306,7 +306,7 @@ void StillImage_Task(void)
                        SImage_SendBlockHeader();\r
                        \r
                        /* Receive the response block from the device */\r
-                       if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError)\r
+                       if ((ErrorCode = SImage_ReceiveBlockHeader()) != PIPE_RWSTREAM_NoError)\r
                        {\r
                                ShowCommandError(ErrorCode, false);\r
                                \r
@@ -367,8 +367,8 @@ void ShowCommandError(uint8_t ErrorCode, bool ResponseCodeError)
 {\r
        char* FailureType = ((ResponseCodeError) ? PSTR("Response Code != OK") : PSTR("Transaction Fail"));\r
 \r
-       printf_P(PSTR(ESC_FG_RED "Command Error (%S).\r\n"), FailureType);\r
-       printf_P(PSTR(" -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);\r
+       printf_P(PSTR(ESC_FG_RED "Command Error (%S).\r\n"\r
+                                " -- Error Code %d\r\n" ESC_FG_WHITE), FailureType, ErrorCode);\r
                        \r
        /* Indicate error via status LEDs */\r
        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r