- \r
- /* Scheduling - routine never returns, so put this last in the main function */\r
- Scheduler_Start();\r
-}\r
-\r
-/** Event handler for the USB_Connect event. This starts the USB task. */\r
-EVENT_HANDLER(USB_Connect)\r
-{\r
- /* Start USB management task */\r
- Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
-}\r
-\r
-/** Event handler for the USB_Disconnect event. This stops the USB and keyboard report tasks. */\r
-EVENT_HANDLER(USB_Disconnect)\r
-{\r
- /* Stop running keyboard reporting, card reading and USB management tasks */\r
- Scheduler_SetTaskMode(USB_Keyboard_Report, TASK_STOP);\r
- Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
- Scheduler_SetTaskMode(Magstripe_Read, TASK_STOP);\r
-}\r
-\r
-/** Event handler for the USB_ConfigurationChanged event. This configures the device's endpoints ready\r
- * to relay reports to the host, and starts the keyboard report task.\r
- */\r
-EVENT_HANDLER(USB_ConfigurationChanged)\r
-{\r
- /* Setup Keyboard Keycode Report Endpoint */\r
- Endpoint_ConfigureEndpoint(KEYBOARD_EPNUM, EP_TYPE_INTERRUPT,\r
- ENDPOINT_DIR_IN, KEYBOARD_EPSIZE,\r
- ENDPOINT_BANK_SINGLE);\r
- \r
- /* Default to report protocol on connect */\r
- UsingReportProtocol = true;\r
-\r
- /* Start Keyboard reporting and card reading tasks */\r
- Scheduler_SetTaskMode(USB_Keyboard_Report, TASK_RUN);\r
- Scheduler_SetTaskMode(Magstripe_Read, TASK_RUN);\r