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 9763cbe commit debdc36Copy full SHA for debdc36
src/mcpwm.rs
@@ -356,7 +356,7 @@ impl<U: Unit> Mcpwm<U> {
356
let operator_input_frequency =
357
MAX_PWM_TIMER_PRESCALE * MAX_PWM_TIMER_PERIOD * u32::from(lowest_frequency);
358
let group_pre_scale = MCPWM_CLOCK_SOURCE_FREQUENCY / operator_input_frequency;
359
- if group_pre_scale > 256 || group_pre_scale < 1 {
+ if !(1..=256).contains(&group_pre_scale) {
360
return Err(EspError::from(ESP_ERR_INVALID_ARG).unwrap());
361
}
362
0 commit comments