Add USB command to retrieve ADC value.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "slave_scheduler.h"
|
||||
#include "slave_drivers/slave_driver_uhk_module.h"
|
||||
#include "wormhole.h"
|
||||
#include "peripherals/adc.h"
|
||||
|
||||
void setError(uint8_t error);
|
||||
void setGenericError();
|
||||
@@ -25,6 +26,7 @@ void readMergeSensor();
|
||||
void uploadConfig();
|
||||
void applyConfig();
|
||||
void setLedPwm();
|
||||
void getAdcValue(void);
|
||||
|
||||
// Functions for setting error statuses
|
||||
|
||||
@@ -80,6 +82,9 @@ void usbProtocolHandler()
|
||||
case USB_COMMAND_SET_LED_PWM:
|
||||
setLedPwm();
|
||||
break;
|
||||
case USB_COMMAND_GET_ADC_VALUE:
|
||||
setLedPwm();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -198,3 +203,8 @@ void setLedPwm()
|
||||
UhkModuleStates[0].ledPwmBrightness = brightnessPercent;
|
||||
#endif
|
||||
}
|
||||
|
||||
void getAdcValue(void)
|
||||
{
|
||||
*((uint32_t*)GenericHidOutBuffer) = ADC_Measure();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user