mirror of https://github.com/ARMmbed/mbed-os.git
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
parent
676cfbb695
commit
f15a178be0
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue