Refactored adc_dma.cpp for readability (#76)

- replaced the lengthy adc value formulas with respective functions
  to ease reading
- removed unecessary casts for alert callbacks
- added static to the internal global variables in order to hide them from the
  other compilation units
This commit is contained in:
hogthrob
2019-11-09 23:13:00 +01:00
committed by Martin Jäger
parent 5cc4921cd2
commit ba7d379225
7 changed files with 124 additions and 106 deletions
+1
View File
@@ -89,6 +89,7 @@ static const pin_state_t led_pin_setup[NUM_LEDS][NUM_LED_PINS] = {
// typical value for Semitec 103AT-5 thermistor: 3435
#define NTC_BETA_VALUE 3435
#define NTC_SERIES_RESISTOR 10000.0
#define ADC_GAIN_V_BAT (110.0 / 10 ) // battery voltage divider 100k + 10k
#define ADC_GAIN_V_SOLAR (105.6 / 5.6) // solar voltage divider: 100k + 5.6k
+1
View File
@@ -85,6 +85,7 @@ static const pin_state_t led_pin_setup[NUM_LEDS][NUM_LED_PINS] = {
// typical value for Semitec 103AT-5 thermistor: 3435
#define NTC_BETA_VALUE 3435
#define NTC_SERIES_RESISTOR 10000.0
#define ADC_GAIN_V_BAT (105.6 / 5.6) // both voltage dividers: 100k + 5.6k
#define ADC_GAIN_V_SOLAR (105.6 / 5.6)