drivers: pwm: mcux_ftm: only emit warning on period change from zero
Only emit a warning about changing PWM period for all channels of a given FTM instance when changing the period from zero to non-zero. This silences the useless warning issued at first FTM PWM channel configuration. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
parent
010797394b
commit
7694ebb694
1 changed files with 7 additions and 4 deletions
|
@ -61,10 +61,13 @@ static int mcux_ftm_pin_set(struct device *dev, u32_t pwm,
|
|||
u32_t pwm_freq;
|
||||
status_t status;
|
||||
|
||||
if (data->period_cycles != 0) {
|
||||
/* Only warn when not changing from zero */
|
||||
LOG_WRN("Changing period cycles from %d to %d"
|
||||
" affects all %d channels in %s",
|
||||
data->period_cycles, period_cycles,
|
||||
config->channel_count, dev->config->name);
|
||||
}
|
||||
|
||||
data->period_cycles = period_cycles;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue