From 0acb1c54ca824e229edfbc81a2af6532c9309e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Sun, 23 Jul 2017 00:41:08 +0200 Subject: [PATCH] Expose EEPROM_LaunchTransfer() via USB. --- right/src/usb_protocol_handler.c | 10 ++++++++++ right/src/usb_protocol_handler.h | 1 + 2 files changed, 11 insertions(+) diff --git a/right/src/usb_protocol_handler.c b/right/src/usb_protocol_handler.c index 0e0a1b7..010d9a9 100644 --- a/right/src/usb_protocol_handler.c +++ b/right/src/usb_protocol_handler.c @@ -11,6 +11,7 @@ #include "slave_drivers/slave_driver_uhk_module.h" #include "wormhole.h" #include "peripherals/adc.h" +#include "eeprom.h" void setError(uint8_t error); void setGenericError(); @@ -26,6 +27,7 @@ void uploadConfig(); void applyConfig(); void setLedPwm(); void getAdcValue(void); +void launchEepromTransfer(void); // Functions for setting error statuses @@ -83,6 +85,8 @@ void usbProtocolHandler() case USB_COMMAND_GET_ADC_VALUE: getAdcValue(); break; + case USB_COMMAND_LAUNCH_EEPROM_TRANSFER: + launchEepromTransfer(); default: break; } @@ -194,3 +198,9 @@ void getAdcValue(void) GenericHidOutBuffer[2] = adcValue >> 16; GenericHidOutBuffer[3] = adcValue >> 24; } + +void launchEepromTransfer(void) +{ + eeprom_transfer_t transferType = GenericHidInBuffer[1]; + EEPROM_LaunchTransfer(transferType); +} diff --git a/right/src/usb_protocol_handler.h b/right/src/usb_protocol_handler.h index 2eee385..da3d0d8 100644 --- a/right/src/usb_protocol_handler.h +++ b/right/src/usb_protocol_handler.h @@ -29,6 +29,7 @@ #define USB_COMMAND_APPLY_CONFIG 9 #define USB_COMMAND_SET_LED_PWM 10 #define USB_COMMAND_GET_ADC_VALUE 11 + #define USB_COMMAND_LAUNCH_EEPROM_TRANSFER 12 // Functions: