mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-03 08:30:45 +00:00
Implementing a calibrated ESP32 ADC reading
This commit is contained in:
committed by
Thomas Göttgens
parent
508cdf6060
commit
d11bcda292
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
#include "PowerStatus.h"
|
||||
#include "concurrency/OSThread.h"
|
||||
|
||||
#include <esp_adc_cal.h>
|
||||
#include <soc/adc_channel.h>
|
||||
/**
|
||||
* Per @spattinson
|
||||
* MIN_BAT_MILLIVOLTS seems high. Typical 18650 are different chemistry to LiPo, even for LiPos that chart seems a bit off, other
|
||||
@@ -14,6 +15,10 @@
|
||||
|
||||
#define BAT_MILLIVOLTS_FULL 4100
|
||||
#define BAT_MILLIVOLTS_EMPTY 3500
|
||||
#ifdef BAT_MEASURE_ADC_UNIT
|
||||
extern RTC_NOINIT_ATTR uint64_t RTC_reg_b;
|
||||
#include "soc/sens_reg.h" // needed for adc pin reset
|
||||
#endif
|
||||
|
||||
class Power : private concurrency::OSThread
|
||||
{
|
||||
@@ -45,4 +50,4 @@ class Power : private concurrency::OSThread
|
||||
#endif
|
||||
};
|
||||
|
||||
extern Power *power;
|
||||
extern Power *power;
|
||||
Reference in New Issue
Block a user