Make global LED PWM brightness adjustment work by enabling the TPM clock.

This commit is contained in:
László Monda
2017-01-14 00:30:40 +01:00
parent 1f4672e2f4
commit 64eeb3a000

View File

@@ -6,6 +6,9 @@ void LedPwm_Init() {
CLOCK_EnableClock(LED_PWM_CLOCK);
PORT_SetPinMux(LED_PWM_PORT, LED_PWM_PIN, kPORT_MuxAlt2);
// Select the clock source for the TPM counter as MCGPLLCLK.
CLOCK_SetTpmClock(1U);
tpm_config_t tpmInfo;
TPM_GetDefaultConfig(&tpmInfo);
TPM_Init(LED_PWM_TPM_BASEADDR, &tpmInfo);