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 <nix.ward@gmail.com>
This commit is contained in:
Nick Ward 2023-09-13 17:56:57 +10:00 committed by Carles Cufí
commit 50462228f2

View file

@ -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)) {