Rewritten event system to remove all macros, to make user code clearer.
[pub/USBasp.git] / Demos / OTG / TestApp / TestEvents.c
index b542bfc..a444cc6 100644 (file)
@@ -55,19 +55,19 @@ static void Abort_Program(void)
 }\r
 \r
 /** Event handler for the USB_VBUSChange event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_VBUSChange)\r
+void EVENT_USB_VBUSChange(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "VBUS Change\r\n"));\r
 }\r
 \r
 /** Event handler for the USB_VBUSConnect event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_VBUSConnect)\r
+void EVENT_USB_VBUSConnect(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "VBUS +\r\n"));\r
 }\r
 \r
 /** Event handler for the USB_VBUSDisconnect event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_VBUSDisconnect)\r
+void EVENT_USB_VBUSDisconnect(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "VBUS -\r\n"));\r
 }\r
@@ -76,7 +76,7 @@ EVENT_HANDLER(USB_VBUSDisconnect)
  *  Event handler for the USB_Connect event. When fired, the event is logged to the USART and the\r
  *  USB task started.\r
  */\r
-EVENT_HANDLER(USB_Connect)\r
+void EVENT_USB_Connect(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "USB  +\r\n"));\r
        LEDs_SetAllLEDs(LEDS_LED2 | LEDS_LED3 | LEDS_LED4);\r
@@ -88,7 +88,7 @@ EVENT_HANDLER(USB_Connect)
  *  Event handler for the USB_Disconnect event. When fired, the event is logged to the USART and the\r
  *  USB task stopped.\r
  */\r
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
 \r
@@ -97,27 +97,27 @@ EVENT_HANDLER(USB_Disconnect)
 }\r
 \r
 /** Event handler for the USB_Suspend event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_Suspend)\r
+void EVENT_USB_Suspend(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX ESC_BG_YELLOW "USB Sleep\r\n"));\r
        LEDs_SetAllLEDs(LEDS_ALL_LEDS);\r
 }\r
 \r
 /** Event handler for the USB_WakeUp event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_WakeUp)\r
+void EVENT_USB_WakeUp(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX ESC_BG_GREEN "USB Wakeup\r\n"));\r
        LEDs_SetAllLEDs(LEDS_LED2 | LEDS_LED4);\r
 }\r
 \r
 /** Event handler for the USB_Reset event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_Reset)\r
+void EVENT_USB_Reset(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "USB Reset\r\n"));\r
 }\r
 \r
 /** Event handler for the USB_UIDChange event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_UIDChange)\r
+void EVENT_USB_UIDChange(void)\r
 {\r
        char* ModeStrPtr;\r
 \r
@@ -139,7 +139,7 @@ EVENT_HANDLER(USB_UIDChange)
  *  Event handler for the USB_PowerOnFail event. When fired, the event is logged to the USART and the program\r
  *  execution aborted.\r
  */\r
-EVENT_HANDLER(USB_InitFailure)\r
+void EVENT_USB_InitFailure(const uint8_t ErrorCode)\r
 {\r
        char* ModeStrPtr;\r
        \r
@@ -162,7 +162,7 @@ EVENT_HANDLER(USB_InitFailure)
  *  Event handler for the USB_HostError event. When fired, the event is logged to the USART and the program\r
  *  execution aborted.\r
  */\r
-EVENT_HANDLER(USB_HostError)\r
+void EVENT_USB_HostError(const uint8_t ErrorCode)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX ESC_BG_RED "Host Mode Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
@@ -171,7 +171,7 @@ EVENT_HANDLER(USB_HostError)
 }\r
 \r
 /** Event handler for the USB_DeviceEnumerationFailed event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
+void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
@@ -183,7 +183,7 @@ EVENT_HANDLER(USB_DeviceEnumerationFailed)
  *  Event handler for the USB_DeviceError event. When fired, the event is logged to the USART and the program\r
  *  execution aborted.\r
  */\r
-EVENT_HANDLER(USB_DeviceError)\r
+void EVENT_USB_DeviceError(const uint8_t ErrorCode)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX ESC_BG_RED "Device Mode Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
@@ -192,7 +192,7 @@ EVENT_HANDLER(USB_DeviceError)
 }\r
 \r
 /** Event handler for the USB_UnhandledControlPacket event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "Ctrl Request\r\n"));\r
        printf_P(PSTR(" -- Req Data %d\r\n"), USB_ControlRequest.bRequest);\r
@@ -201,7 +201,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
 }\r
 \r
 /** Event handler for the USB_ConfigurationChanged event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "Configuration Number Changed\r\n"));\r
 \r
@@ -209,7 +209,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
 }\r
 \r
 /** Event handler for the USB_DeviceAttached event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_DeviceAttached)\r
+void EVENT_USB_DeviceAttached(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX ESC_BG_GREEN "Device +\r\n"));\r
 \r
@@ -217,13 +217,13 @@ EVENT_HANDLER(USB_DeviceAttached)
 }\r
 \r
 /** Event handler for the USB_DeviceUnattached event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_DeviceUnattached)\r
+void EVENT_USB_DeviceUnattached(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX ESC_BG_YELLOW "Device -\r\n"));\r
 }\r
 \r
 /** Event handler for the USB_DeviceEnumerationComplete event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_DeviceEnumerationComplete)\r
+void EVENT_USB_DeviceEnumerationComplete(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "Device Enumeration Complete\r\n"));\r
 }\r