Extract UsbCommand_SetLedPwmBrightness() into its own file.

This commit is contained in:
László Monda
2017-11-05 18:08:35 +01:00
parent 84ffe50dac
commit 45420a348b
4 changed files with 22 additions and 12 deletions

View File

@@ -27,6 +27,7 @@
#include "usb_commands/usb_command_reenumerate.h"
#include "usb_commands/usb_command_set_test_led.h"
#include "usb_commands/usb_command_get_adc_value.h"
#include "usb_commands/usb_command_set_led_pwm_brightness.h"
uint8_t UsbDebugInfo[USB_GENERIC_HID_OUT_BUFFER_LENGTH];
@@ -47,15 +48,6 @@ void SetUsbResponseWord(uint16_t response)
*((uint16_t*)(GenericHidOutBuffer+1)) = response;
}
// Per command protocol command handlers
void setLedPwm(void)
{
uint8_t brightnessPercent = GenericHidInBuffer[1];
LedPwm_SetBrightness(brightnessPercent);
UhkModuleStates[UhkModuleDriverId_LeftKeyboardHalf].sourceVars.ledPwmBrightness = brightnessPercent;
}
// The main protocol handler function
void UsbProtocolHandler(void)
@@ -80,8 +72,8 @@ void UsbProtocolHandler(void)
case UsbCommandId_ApplyConfig:
UsbCommand_ApplyConfig();
break;
case UsbCommandId_SetLedPwm:
setLedPwm();
case UsbCommandId_SetLedPwmBrightness:
UsbCommand_SetLedPwmBrightness();
break;
case UsbCommandId_GetAdcValue:
UsbCommand_GetAdcValue();