drivers: pwm: remove duplicated pulse > period checks
The API call checks for this condition before calling the pin_set driver OP call, so drivers don't have to do this check now. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
60045c52d5
commit
0c908706fb
15 changed files with 7 additions and 44 deletions
|
@ -189,12 +189,6 @@ static int pwm_nrfx_pin_set(const struct device *dev, uint32_t pwm,
|
|||
}
|
||||
}
|
||||
|
||||
/* Limit pulse cycles to period cycles (meaning 100% duty), bigger
|
||||
* values might not fit after prescaling into the 15-bit field that
|
||||
* is filled below.
|
||||
*/
|
||||
pulse_cycles = MIN(pulse_cycles, period_cycles);
|
||||
|
||||
/* Store new pulse value bit[14:0], and polarity bit[15] for channel. */
|
||||
data->current[channel] = (
|
||||
(data->current[channel] & PWM_NRFX_CH_POLARITY_MASK)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue