Skip to content

Commit 1fd9dc8

Browse files
mathieuchopstmnashif
authored andcommitted
tests: drivers: adc_api: use proper printf format
This commit changes the adc_api test to use the proper printf format specifier when printing the ADC samplings. This ensures that all values are printed on 16-bit. Without this specifier, negative values are sign-extended and printed on full integer size (e.g., 0x8000 -> "0xFFFF8000"). Signed-off-by: Mathieu Choplain <[email protected]>
1 parent 6cb8956 commit 1fd9dc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/drivers/adc/adc_api/src/test_adc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static void check_samples(int expected_count)
104104
for (i = 0; i < BUFFER_SIZE; i++) {
105105
int16_t sample_value = m_sample_buffer[i];
106106

107-
TC_PRINT("0x%04x ", sample_value);
107+
TC_PRINT("0x%04hx ", sample_value);
108108
if (i < expected_count) {
109109
zassert_not_equal(INVALID_ADC_VALUE, sample_value,
110110
"[%u] should be filled", i);

0 commit comments

Comments
 (0)