mirror of
https://gitea.ecohim.ru:3000/RS485_BSV/RS485_BSV_fw.git
synced 2025-08-04 15:37:06 +03:00
Now returns 0 as monitor values if BSV-33 is not connectoed
This commit is contained in:
@@ -150,8 +150,13 @@ uint16_t update_status(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void adc_bufferize(void) {
|
void adc_bufferize(void) {
|
||||||
|
if (GET_HVS_CONN) {
|
||||||
volt_buff[buff_index] = rawADC[0];
|
volt_buff[buff_index] = rawADC[0];
|
||||||
curr_buff[buff_index] = rawADC[1];
|
curr_buff[buff_index] = rawADC[1];
|
||||||
|
} else {
|
||||||
|
volt_buff[buff_index] = 0;
|
||||||
|
curr_buff[buff_index] = 0;
|
||||||
|
}
|
||||||
if (++buff_index >= ADC_BUFF_LENGTH) {
|
if (++buff_index >= ADC_BUFF_LENGTH) {
|
||||||
buff_index = 0;
|
buff_index = 0;
|
||||||
adc_sum_flag = 1;
|
adc_sum_flag = 1;
|
||||||
|
Reference in New Issue
Block a user