Expose EEPROM_LaunchTransfer() via USB.

This commit is contained in:
László Monda
2017-07-23 00:41:08 +02:00
parent 8ed4a6ba09
commit 0acb1c54ca
2 changed files with 11 additions and 0 deletions

View File

@@ -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);
}