From 50462228f212ce8bfa03f2357a63533e69a32366 Mon Sep 17 00:00:00 2001 From: Nick Ward Date: Wed, 13 Sep 2023 17:56:57 +1000 Subject: [PATCH] drivers: adc: shell: fix - read result is signed Previously negative read results were being printed by the shell as large uint16_t. Signed-off-by: Nick Ward --- drivers/adc/adc_shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/adc/adc_shell.c b/drivers/adc/adc_shell.c index 4aa9209ae5f..a0174cb062b 100644 --- a/drivers/adc/adc_shell.c +++ b/drivers/adc/adc_shell.c @@ -305,7 +305,7 @@ static int cmd_adc_read(const struct shell *sh, size_t argc, char **argv) uint8_t adc_channel_id = strtol(argv[1], NULL, 10); /* -1 index of adc label name */ struct adc_hdl *adc = get_adc(argv[-1]); - uint16_t m_sample_buffer[BUFFER_SIZE]; + int16_t m_sample_buffer[BUFFER_SIZE]; int retval; if (!device_is_ready(adc->dev)) {