Skip to content

Commit

Permalink
Remove SUNPOS_UPDATE_INTERVAL define and introduce INVERTER_UPDATE_SE…
Browse files Browse the repository at this point in the history
…TTINGS_INTERVAL.
  • Loading branch information
StefanOberhumer committed Oct 6, 2023
1 parent 943dfc2 commit 7f99095
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion include/InverterSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <cstdint>

#define INVERTER_UPDATE_SETTINGS_INTERVAL 60000l

class InverterSettingsClass {
public:
void init();
Expand All @@ -12,4 +14,4 @@ class InverterSettingsClass {
uint32_t _lastUpdate = 0;
};

extern InverterSettingsClass InverterSettings;
extern InverterSettingsClass InverterSettings;
2 changes: 0 additions & 2 deletions include/SunPosition.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#include <mutex>
#include <sunset.h>

#define SUNPOS_UPDATE_INTERVAL 60000l

class SunPositionClass {
public:
SunPositionClass();
Expand Down
4 changes: 2 additions & 2 deletions src/InverterSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void InverterSettingsClass::init()

void InverterSettingsClass::loop()
{
if (millis() - _lastUpdate > SUNPOS_UPDATE_INTERVAL) {
if (millis() - _lastUpdate > INVERTER_UPDATE_SETTINGS_INTERVAL) {
const CONFIG_T& config = Configuration.get();

for (uint8_t i = 0; i < INV_MAX_COUNT; i++) {
Expand All @@ -109,4 +109,4 @@ void InverterSettingsClass::loop()
}

Hoymiles.loop();
}
}

0 comments on commit 7f99095

Please sign in to comment.