Make Endpoint control transfers more reliable; early-abort when an incomplete packet...
[pub/USBasp.git] / Demos / OTG / TestApp / TestEvents.c
index aee2b16..a81c5b8 100644 (file)
@@ -88,8 +88,8 @@ void EVENT_USB_InitFailure(const uint8_t ErrorCode)
        else\r
          ModeStrPtr = PSTR("N/A");\r
        \r
-       printf_P(PSTR(" -- Mode %S\r\n"), ModeStrPtr);\r
-       printf_P(PSTR(" -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);\r
+       printf_P(PSTR(" -- Mode %S\r\n"\r
+                     " -- Error Code %d\r\n" ESC_FG_WHITE), ModeStrPtr, ErrorCode);\r
 \r
        Abort_Program();\r
 }\r
@@ -127,10 +127,12 @@ void EVENT_USB_Device_Reset(void)
 /** Event handler for the USB_Device_UnhandledControlRequest event. When fired, the event is logged to the USART. */\r
 void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
-       puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "Ctrl Request\r\n"));\r
-       printf_P(PSTR(" -- Req Data %d\r\n"), USB_ControlRequest.bRequest);\r
-       printf_P(PSTR(" -- Req Type %d\r\n"), USB_ControlRequest.bmRequestType);\r
-       printf_P(PSTR(" -- Req Length %d\r\n" ESC_FG_WHITE), USB_ControlRequest.wLength);\r
+       printf_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "Ctrl Request\r\n"\r
+                                                " -- Req Data %d\r\n"\r
+                                                " -- Req Type %d\r\n"\r
+                                                " -- Req Length %d\r\n" ESC_FG_WHITE), USB_ControlRequest.bRequest,\r
+                                                                                       USB_ControlRequest.bmRequestType,\r
+                                                                                       USB_ControlRequest.wLength);\r
 }\r
 \r
 /** Event handler for the USB_Device_ConfigurationChanged event. When fired, the event is logged to the USART. */\r
@@ -145,8 +147,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
  */\r
 void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
 {\r
-       puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "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 EVENT_PREFIX "Host Mode Error\r\n"\r
+                                             " -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);\r
 \r
        Abort_Program();\r
 }\r
@@ -154,10 +156,10 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
 /** Event handler for the USB_Host_DeviceEnumerationFailed event. When fired, the event is logged to the USART. */\r
 void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
-       puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "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 EVENT_PREFIX "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
 \r
 /** Event handler for the USB_Host_DeviceEnumerationComplete event. When fired, the event is logged to the USART. */\r