We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1021c4d + da098dd commit f2bbcdaCopy full SHA for f2bbcda
1 file changed
board/hx20/board.c
@@ -640,11 +640,14 @@ BUILD_ASSERT(ARRAY_SIZE(hx20_board_versions) == BOARD_VERSION_COUNT);
640
641
int get_hardware_id(enum adc_channel channel)
642
{
643
- int version = BOARD_VERSION_UNKNOWN;
+ int version= BOARD_VERSION_UNKNOWN;
644
int mv;
645
int i;
646
647
- mv = adc_read_channel(ADC_AD_BID);
+ if (channel >= ADC_CH_COUNT)
648
+ return BOARD_VERSION_UNKNOWN;
649
+
650
+ mv = adc_read_channel(channel);
651
652
if (mv == ADC_READ_ERROR)
653
return BOARD_VERSION_UNKNOWN;
0 commit comments