Extract UsbCommand_SetTestLed() into its own file.
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
#include "usb_commands/usb_command_set_test_led.h"
|
||||||
|
#include "usb_protocol_handler.h"
|
||||||
|
#include "peripherals/test_led.h"
|
||||||
|
#include "slave_drivers/uhk_module_driver.h"
|
||||||
|
|
||||||
|
void UsbCommand_SetTestLed(void)
|
||||||
|
{
|
||||||
|
uint8_t ledState = GenericHidInBuffer[1];
|
||||||
|
TEST_LED_SET(ledState);
|
||||||
|
UhkModuleStates[UhkModuleDriverId_LeftKeyboardHalf].sourceVars.isTestLedOn = ledState;
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef __USB_COMMAND_SET_TEST_LED_H__
|
||||||
|
#define __USB_COMMAND_SET_TEST_LED_H__
|
||||||
|
|
||||||
|
// Functions:
|
||||||
|
|
||||||
|
void UsbCommand_SetTestLed(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
#include "usb_commands/usb_command_get_keyboard_state.h"
|
#include "usb_commands/usb_command_get_keyboard_state.h"
|
||||||
#include "usb_commands/usb_command_get_debug_info.h"
|
#include "usb_commands/usb_command_get_debug_info.h"
|
||||||
#include "usb_commands/usb_command_reenumerate.h"
|
#include "usb_commands/usb_command_reenumerate.h"
|
||||||
|
#include "usb_commands/usb_command_set_test_led.h"
|
||||||
|
|
||||||
uint8_t UsbDebugInfo[USB_GENERIC_HID_OUT_BUFFER_LENGTH];
|
uint8_t UsbDebugInfo[USB_GENERIC_HID_OUT_BUFFER_LENGTH];
|
||||||
|
|
||||||
@@ -47,13 +48,6 @@ void SetUsbResponseWord(uint16_t response)
|
|||||||
|
|
||||||
// Per command protocol command handlers
|
// Per command protocol command handlers
|
||||||
|
|
||||||
void setTestLed(void)
|
|
||||||
{
|
|
||||||
uint8_t ledState = GenericHidInBuffer[1];
|
|
||||||
TEST_LED_SET(ledState);
|
|
||||||
UhkModuleStates[UhkModuleDriverId_LeftKeyboardHalf].sourceVars.isTestLedOn = ledState;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setLedPwm(void)
|
void setLedPwm(void)
|
||||||
{
|
{
|
||||||
uint8_t brightnessPercent = GenericHidInBuffer[1];
|
uint8_t brightnessPercent = GenericHidInBuffer[1];
|
||||||
@@ -80,7 +74,7 @@ void UsbProtocolHandler(void)
|
|||||||
UsbCommand_Reenumerate();
|
UsbCommand_Reenumerate();
|
||||||
break;
|
break;
|
||||||
case UsbCommandId_SetTestLed:
|
case UsbCommandId_SetTestLed:
|
||||||
setTestLed();
|
UsbCommand_SetTestLed();
|
||||||
break;
|
break;
|
||||||
case UsbCommandId_WriteLedDriver:
|
case UsbCommandId_WriteLedDriver:
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user