Now returns 0 as monitor values if BSV-33 is not connectoed

This commit is contained in:
Anton Mukhin
2024-07-26 15:24:07 +03:00
parent 07be2f747f
commit c0b3df51e4

View File

@@ -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;