From c0b3df51e4ba6ea8be7a24e8c447eca16b8c3a80 Mon Sep 17 00:00:00 2001 From: Anton Mukhin Date: Fri, 26 Jul 2024 15:24:07 +0300 Subject: [PATCH] Now returns 0 as monitor values if BSV-33 is not connectoed --- Core/Src/board_logic.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Core/Src/board_logic.c b/Core/Src/board_logic.c index a5e3d81..3abcff1 100644 --- a/Core/Src/board_logic.c +++ b/Core/Src/board_logic.c @@ -150,8 +150,13 @@ uint16_t update_status(void) { } void adc_bufferize(void) { - volt_buff[buff_index] = rawADC[0]; - curr_buff[buff_index] = rawADC[1]; + if (GET_HVS_CONN) { + volt_buff[buff_index] = rawADC[0]; + curr_buff[buff_index] = rawADC[1]; + } else { + volt_buff[buff_index] = 0; + curr_buff[buff_index] = 0; + } if (++buff_index >= ADC_BUFF_LENGTH) { buff_index = 0; adc_sum_flag = 1;