We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
setup()
1 parent 268cba2 commit e7540b0Copy full SHA for e7540b0
2 files changed
src/LithiumPowered.hpp
@@ -142,6 +142,8 @@
142
void setup(double defaultCapacity) {
143
_wasInitialised = true;
144
145
+ _pStorage->setup();
146
+
147
// Input Pins
148
pinMode(_pGpio->getPinInterrupt(), INPUT);
149
pinMode(_pGpio->getPinPolarity(), INPUT);
src/LithiumStorage.hpp
@@ -24,6 +24,8 @@
24
*/
25
class LithiumStorageBase {
26
public:
27
+ void setup() {};
28
29
inline virtual double getLastBatteryCapacity(double& defaultValue) = 0; // Abstract
30
inline virtual void setLastBatteryCapacity(double& mAh) = 0; // Abstract
31
@@ -40,7 +42,9 @@
40
42
private:
41
43
Preferences _prefs;
44
- LithiumStorageESP32() : _prefs() {
45
+ LithiumStorageESP32() : _prefs() {}
46
47
+ void setup() {
48
_prefs.begin(BATTERY, false);
49
}
50
0 commit comments