Set the clock source in KL27 PWMOUT driver

By default the TPM clock source is disabled

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
pull/2065/head
Mahadevan Mahesh 2016-06-28 09:24:27 -05:00
parent 676cfbb695
commit f15a178be0
1 changed files with 3 additions and 0 deletions

View File

@ -34,6 +34,9 @@ void pwmout_init(pwmout_t* obj, PinName pin) {
obj->pwm_name = pwm;
uint32_t pwm_base_clock;
/* Set the TPM clock source to be IRC 48M */
CLOCK_SetTpmClock(1U);
pwm_base_clock = CLOCK_GetFreq(kCLOCK_McgIrc48MClk);
float clkval = (float)pwm_base_clock / 1000000.0f;
uint32_t clkdiv = 0;