drivers: lpadc: fix ADC command chaining
When reading multiple ADC channel in parallel, an ADC command chain will be build. This is similar to a linked list, as every command references the next command. Before this patch every ADC command after the first, would always reference this initial command. So that during execution only two commands (the last and first) would be executed which resulted in readout of only two analog values. As Zephyr expected more to come in, the `read_adc` function would block endlessly. The patch fixes the behaviour and allows a correct chain to build up. Signed-off-by: Elisabeth Friedrich <auxsys@flowerpot.me>
This commit is contained in:
parent
5ea3f9a24e
commit
f4356f3b2e
1 changed files with 1 additions and 1 deletions
|
@ -238,8 +238,8 @@ static int mcux_lpadc_start_read(const struct device *dev,
|
|||
} else {
|
||||
/* End of chain */
|
||||
data->cmd_config[channel].chainedNextCommandNumber = 0;
|
||||
last_enabled = channel;
|
||||
}
|
||||
last_enabled = channel;
|
||||
LPADC_SetConvCommandConfig(config->base,
|
||||
channel + 1, &data->cmd_config[channel]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue