Skip to content
Snippets Groups Projects
Commit 616c2728 authored by Joakim Nohlgård's avatar Joakim Nohlgård
Browse files

tests/periph_pwm: Handle pwm_init return value as actual frequency

parent 2bc7c4ba
No related branches found
No related tags found
No related merge requests found
...@@ -48,16 +48,15 @@ int main(void) ...@@ -48,16 +48,15 @@ int main(void)
int step = STEP; int step = STEP;
puts("\nRIOT PWM test"); 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); res = pwm_init(DEV, MODE, FREQU, STEPS);
if (res == 0) { if (res < 0) {
puts("PWM successfully initialized.\n");
}
else {
puts("Errors while initializing PWM"); puts("Errors while initializing PWM");
return -1; return -1;
} }
puts("PWM initialized.");
printf("requested: %d Hz, got %d Hz\n", FREQU, res);
while (1) { while (1) {
for (int i = 0; i < CHANNELS; i++) { for (int i = 0; i < CHANNELS; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment