From 6ba4225eedfa2a216fe4774433e9459c90583b74 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Sat, 16 May 2020 18:57:06 +0200 Subject: [PATCH] tests/periph_pwm: limit OSC_STEPS to 256 to work on all platforms The ATmega PWM implementation only supports a maximum resolution of 256. Thus when running `osci` with `OSC_STEPS` = 1000 an assertion will fail and the test crashes, even though the PWM peripheral works perfectly fine. Limit OSC_STEPS to 256 so it works on all platforms. The LED flashing doesn't look any more coarse. --- tests/periph_pwm/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/periph_pwm/main.c b/tests/periph_pwm/main.c index 6cb628b7cf..a615eaba02 100644 --- a/tests/periph_pwm/main.c +++ b/tests/periph_pwm/main.c @@ -39,7 +39,7 @@ #define OSC_STEP (10) #define OSC_MODE PWM_LEFT #define OSC_FREQU (1000U) -#define OSC_STEPS (1000U) +#define OSC_STEPS (256U) #define PWR_SLEEP (1U) static uint32_t initiated;