diff --git a/cpu/efm32/periph/pwm.c b/cpu/efm32/periph/pwm.c index f8c2f2432e26..ea940a3b5a5b 100644 --- a/cpu/efm32/periph/pwm.c +++ b/cpu/efm32/periph/pwm.c @@ -33,7 +33,7 @@ uint32_t pwm_init(pwm_t dev, pwm_mode_t mode, uint32_t freq, uint16_t res) { /* check if device is valid */ if (dev >= PWM_NUMOF) { - return -1; + return 0; } /* enable clocks */ @@ -46,7 +46,7 @@ uint32_t pwm_init(pwm_t dev, pwm_mode_t mode, uint32_t freq, uint16_t res) freq_timer); if (prescaler > timerPrescale1024) { - return -2; + return 0; } /* reset and initialize peripheral */ diff --git a/tests/periph_pwm/main.c b/tests/periph_pwm/main.c index a615eaba0268..092e136da0c1 100644 --- a/tests/periph_pwm/main.c +++ b/tests/periph_pwm/main.c @@ -42,7 +42,7 @@ #define OSC_STEPS (256U) #define PWR_SLEEP (1U) -static uint32_t initiated; +static uint32_t initialized; static unsigned _get_dev(const char *dev_str) { @@ -94,11 +94,11 @@ static int _init(int argc, char** argv) (uint16_t)atoi(argv[4])); if (pwm_freq != 0) { printf("The pwm frequency is set to %" PRIu32 "\n", pwm_freq); - initiated |= (1 << dev); + initialized |= (1 << dev); return 0; } - puts("Error: device is not initiated"); + puts("Error: device is not initialized"); return 1; } @@ -117,8 +117,8 @@ static int _set(int argc, char**argv) return 1; } - if ((initiated & (1 << dev)) == 0) { - puts("Error: pwm is not initiated.\n"); + if ((initialized & (1 << dev)) == 0) { + puts("Error: pwm is not initialized.\n"); puts("Execute init function first.\n"); return 1; } @@ -245,7 +245,7 @@ static const shell_command_t shell_commands[] = { int main(void) { puts("PWM peripheral driver test\n"); - initiated = 0; + initialized = 0; char line_buf[SHELL_DEFAULT_BUFSIZE]; shell_run(shell_commands, line_buf, SHELL_DEFAULT_BUFSIZE);