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;