From 616c272801c7e6fcd227a1f3bedf9c3396ac262e Mon Sep 17 00:00:00 2001 From: Joakim Gebart <joakim.gebart@eistec.se> Date: Sat, 16 May 2015 09:57:04 +0200 Subject: [PATCH] tests/periph_pwm: Handle pwm_init return value as actual frequency --- tests/periph_pwm/main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/periph_pwm/main.c b/tests/periph_pwm/main.c index 7e66c76922..7cbc228e2b 100644 --- a/tests/periph_pwm/main.c +++ b/tests/periph_pwm/main.c @@ -48,16 +48,15 @@ int main(void) int step = STEP; puts("\nRIOT PWM test"); - puts("Connect an LED or scope to PWM pins to see something\n"); + puts("Connect an LED or scope to PWM pins to see something"); res = pwm_init(DEV, MODE, FREQU, STEPS); - if (res == 0) { - puts("PWM successfully initialized.\n"); - } - else { + if (res < 0) { puts("Errors while initializing PWM"); return -1; } + puts("PWM initialized."); + printf("requested: %d Hz, got %d Hz\n", FREQU, res); while (1) { for (int i = 0; i < CHANNELS; i++) { -- GitLab