Improved load overcurrent and overvoltage diagnosis and protection

This commit is contained in:
Martin Jaeger
2019-04-28 17:29:57 +02:00
parent ca9997ec83
commit 213ebf8c17
16 changed files with 171 additions and 47 deletions
+1
View File
@@ -83,6 +83,7 @@ void update_measurements(dcdc_t *dcdc, battery_state_t *bat, load_output_t *load
ls->voltage =
(float)(((adc_filtered[ADC_POS_V_BAT] >> (4 + ADC_FILTER_CONST)) * vcc) / 4096) *
ADC_GAIN_V_BAT / 1000.0;
load->voltage = ls->voltage;
hs->voltage =
(float)(((adc_filtered[ADC_POS_V_SOLAR] >> (4 + ADC_FILTER_CONST)) * vcc) / 4096) *