battery voltage display

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

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

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