tests: pwm_api: Use smaller pwm period cycles on k64-based boards

The mcux pwm drivers use period cycles as a divisor to calculate the pwm
frequency in hertz. This operation can underflow easily with large
values of period cycles relative to the pwm clock source, causing the
driver to return an error code and the pwm_api test to fail.

Updates the test to use the smaller set of period and pulse cycles on
k64-based boards, fixing the test for frdm_k64f and hexiwear_k64 boards.

The test is not changed for i.mx rt boards because the pwm clock source
on these boards is much faster than on k64 boards, and thus the same pwm
frequency operation does not underflow.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit is contained in:
Maureen Helm 2019-08-12 14:52:31 -05:00 committed by Kumar Gala
commit 9346ded0af

View file

@ -44,7 +44,7 @@
#error "Define a PWM device"
#endif
#ifdef CONFIG_BOARD_COLIBRI_IMX7D_M4
#if defined(CONFIG_BOARD_COLIBRI_IMX7D_M4) || defined(CONFIG_SOC_MK64F12)
#define DEFAULT_PERIOD_CYCLE 1024
#define DEFAULT_PULSE_CYCLE 512
#define DEFAULT_PERIOD_USEC 2000