Move the USB protocol handler into its own file.

This commit is contained in:
László Monda
2016-09-26 23:49:50 +02:00
parent d2b810a3cf
commit 9e29018ff7
4 changed files with 51 additions and 33 deletions

View File

@@ -0,0 +1,26 @@
#include "usb_protocol_handler.h"
#include "test_led.h"
void UsbProtocolHandler()
{
uint8_t command = GenericHidInBuffer[0];
uint8_t arg = GenericHidInBuffer[1];
switch (command) {
case USB_COMMAND_JUMP_TO_BOOTLOADER:
break;
case USB_COMMAND_TEST_LED:
switch (arg) {
case 0:
TEST_RED_ON();
break;
case 1:
TEST_RED_OFF();
break;
}
case USB_COMMAND_LED_DRIVER:
break;
default:
break;
}
}