mirror of
https://github.com/Dasharo/zephyr.git
synced 2026-03-06 14:57:20 -08:00
drivers: pwm: pwm_mcux: fix for coverity 321142
Fix `PWM_SetupPwm` function being called with `numOfChnls` argument equal to 2, when in fact only one channel is being set up. Also add 'U' suffix to `pwmFreq_Hz` unsigned integer argument in the function call. Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
This commit is contained in:
committed by
Carles Cufí
parent
a983abe426
commit
4eedd45c85
@@ -96,8 +96,8 @@ static int mcux_pwm_set_cycles(const struct device *dev, uint32_t channel,
|
||||
data->channel[channel].level = level;
|
||||
|
||||
status = PWM_SetupPwm(config->base, config->index,
|
||||
&data->channel[channel], CHANNEL_COUNT,
|
||||
config->mode, 1, clock_freq);
|
||||
&data->channel[channel], 1U,
|
||||
config->mode, 1U, clock_freq);
|
||||
if (status != kStatus_Success) {
|
||||
LOG_ERR("Could not set up pwm");
|
||||
return -ENOTSUP;
|
||||
|
||||
Reference in New Issue
Block a user