8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af41d52 commit 139fcd1Copy full SHA for 139fcd1
ports/nrf/modules/machine/soft_pwm.c
@@ -199,6 +199,8 @@ static void machine_soft_pwm_start(machine_pwm_obj_t *self) {
199
duty_width = self->duty * DUTY_FULL_SCALE / 65536;
200
} else if (self->duty_mode == DUTY_NS) {
201
duty_width = (uint64_t)self->duty * self->freq * DUTY_FULL_SCALE / 1000000000ULL;
202
+ } else {
203
+ mp_raise_ValueError(MP_ERROR_TEXT("invalid duty mode"));
204
}
205
pwm_set_duty_cycle(self->pwm_pin, duty_width);
206
0 commit comments