Skip to content

Commit a7405dc

Browse files
kartbenfabiobaltieri
authored andcommitted
drivers: adc: ti_am335x: fix timeout condition
Corrected the timeout condition in the ti_adc_sequencer_start function to ensure proper timeout handling during ADC sequencer operations. Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
1 parent 3e029aa commit a7405dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/adc/adc_ti_am335x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static int ti_adc_sequencer_start(const struct device *dev)
160160
while (FIELD_GET(TI_ADC_SEQ_STATUS_FSM, seq_status) != TI_ADC_SEQ_STATUS_FSM_IDLE &&
161161
FIELD_GET(TI_ADC_SEQ_STATUS_STEP, seq_status) != TI_ADC_SEQ_STATUS_STEP_IDLE) {
162162
/* Timeout */
163-
if (k_uptime_get() - timeout < (TI_ADC_IDLE_TIMEOUT_MS * data->chan_count)) {
163+
if (k_uptime_get() - timeout > (TI_ADC_IDLE_TIMEOUT_MS * data->chan_count)) {
164164
return -ETIMEDOUT;
165165
}
166166

0 commit comments

Comments
 (0)