PWM the R_EXT of the LED driver using FTM.

This commit is contained in:
László Monda
2017-01-13 14:58:31 +01:00
parent 3348fb0848
commit 0ded50b43a
9 changed files with 93 additions and 14 deletions

View File

@@ -6,6 +6,7 @@
#include "merge_sensor.h"
#include "deserialize.h"
#include "config_buffer.h"
#include "led_pwm.h"
void setError(uint8_t error);
void setGenericError();
@@ -20,6 +21,7 @@ void readEeprom();
void readMergeSensor();
void uploadConfig();
void applyConfig();
void setLedPwm();
// Functions for setting error statuses
@@ -75,6 +77,9 @@ void usbProtocolHandler()
case USB_COMMAND_APPLY_CONFIG:
applyConfig();
break;
case USB_COMMAND_SET_LED_PWM:
setLedPwm();
break;
default:
break;
}
@@ -199,3 +204,11 @@ void applyConfig()
{
deserialize_Layer(ConfigBuffer, 0);
}
void setLedPwm()
{
uint8_t brightnessPercent = GenericHidInBuffer[1];
#if UHK_PCB_MAJOR_VERSION == 7
LedPwm_SetBrightness(brightnessPercent);
#endif
}