Drive the LED_PWM line of the left half via TPM which doesn't work yet for some reason. Add protocol command for setting the LED_PWM brightness of the left half. Expose UpdateUsbReports()

This commit is contained in:
László Monda
2017-01-13 21:43:47 +01:00
parent 0ded50b43a
commit 9ef9e5f734
10 changed files with 89 additions and 8 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ void LedPwm_Init() {
ftmParam[0].chnlNumber = (ftm_chnl_t)LED_PWM_FTM_CHANNEL;
ftmParam[0].level = kFTM_LowTrue;
ftmParam[0].dutyCyclePercent = INITIAL_DUTY_CYCLE_PERCENT - 100;
ftmParam[0].dutyCyclePercent = 100 - INITIAL_DUTY_CYCLE_PERCENT;
ftmParam[0].firstEdgeDelayPercent = 0;
FTM_GetDefaultConfig(&ftmInfo);
@@ -28,6 +28,6 @@ void LedPwm_Init() {
void LedPwm_SetBrightness(uint8_t brightnessPercent)
{
FTM_UpdatePwmDutycycle(LED_PWM_FTM_BASEADDR, LED_PWM_FTM_CHANNEL, kFTM_EdgeAlignedPwm, brightnessPercent-100);
FTM_UpdatePwmDutycycle(LED_PWM_FTM_BASEADDR, LED_PWM_FTM_CHANNEL, kFTM_EdgeAlignedPwm, 100 - brightnessPercent);
FTM_SetSoftwareTrigger(LED_PWM_FTM_BASEADDR, true); // Triggers register update.
}