battery voltage display

This commit is contained in:
Klaus K Wilting committed 2018-07-21 23:40:42 +02:00
1 parent 07dbe08833
commit 12be543010
2 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -48,7 +48,7 @@ uint16_t read_voltage(void) {
#ifdef BATT_FACTOR #ifdef BATT_FACTOR
voltage *= BATT_FACTOR; voltage *= BATT_FACTOR;
#endif #endif
ESP_LOGI(TAG, "Raw: %d / Voltage: %dmV", adc_reading, voltage); ESP_LOGD(TAG, "Raw: %d / Voltage: %dmV", adc_reading, voltage);
return voltage; return voltage;
} }
#endif // HAS_BATTERY_PROBE #endif // HAS_BATTERY_PROBE
+4 -4
View File
@@ -185,10 +185,6 @@ void sendPayload() {
SendCycleTimerIRQ = 0; SendCycleTimerIRQ = 0;
portEXIT_CRITICAL(&timerMux); portEXIT_CRITICAL(&timerMux);
#ifdef HAS_BATTERY_PROBE
batt_volt = read_voltage();
#endif
// append counter data to payload // append counter data to payload
payload.reset(); payload.reset();
payload.addCount(macs_wifi, cfg.blescan ? macs_ble : 0); payload.addCount(macs_wifi, cfg.blescan ? macs_ble : 0);
@@ -436,6 +432,10 @@ void loop() {
readButton(); readButton();
#endif #endif
#ifdef HAS_BATTERY_PROBE
batt_volt = read_voltage();
#endif
#ifdef HAS_DISPLAY #ifdef HAS_DISPLAY
updateDisplay(); updateDisplay();
#endif #endif