mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 13:27:01 +08:00
freedom-k64f: Init PWM only if enabled
Aligned to k28f. Change-Id: I1b384ee69dd1b87268545ef6343acc63f29b2ae6 Forwarded: https://github.com/apache/incubator-nuttx/pull/1969 Signed-off-by: Philippe Coval <rzr@users.sf.net>
This commit is contained in:
committed by
Xiang Xiao
parent
dd7b5cb228
commit
cabaa10428
@@ -77,6 +77,7 @@ int k64_pwm_setup(void)
|
|||||||
|
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_KINETIS_FTM0_PWM
|
||||||
/* Call k64_pwminitialize() to get an instance of the PWM interface */
|
/* Call k64_pwminitialize() to get an instance of the PWM interface */
|
||||||
|
|
||||||
pwm = kinetis_pwminitialize(0);
|
pwm = kinetis_pwminitialize(0);
|
||||||
@@ -86,6 +87,7 @@ int k64_pwm_setup(void)
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
/* Register the PWM driver at "/dev/pwm0" */
|
/* Register the PWM driver at "/dev/pwm0" */
|
||||||
|
|
||||||
ret = pwm_register("/dev/pwm0", pwm);
|
ret = pwm_register("/dev/pwm0", pwm);
|
||||||
|
|||||||
Reference in New Issue
Block a user