Skip to content

Commit da098dd

Browse files
committed
hx30. fix board version for tp and audio
Touchpad and audio boards were not reading the correct ADC channel. As reported by: #13 Signed-off-by: Kieran Levin <ktl@frame.work>
1 parent 1021c4d commit da098dd

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

board/hx20/board.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,11 +640,14 @@ BUILD_ASSERT(ARRAY_SIZE(hx20_board_versions) == BOARD_VERSION_COUNT);
640640

641641
int get_hardware_id(enum adc_channel channel)
642642
{
643-
int version = BOARD_VERSION_UNKNOWN;
643+
int version= BOARD_VERSION_UNKNOWN;
644644
int mv;
645645
int i;
646646

647-
mv = adc_read_channel(ADC_AD_BID);
647+
if (channel >= ADC_CH_COUNT)
648+
return BOARD_VERSION_UNKNOWN;
649+
650+
mv = adc_read_channel(channel);
648651

649652
if (mv == ADC_READ_ERROR)
650653
return BOARD_VERSION_UNKNOWN;

0 commit comments

Comments
 (0)