mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-30 01:06:11 +02:00
factory reset formats entire little fs
renamed sunrise / sunset on indext.html to start / stop communication show system information only if called directly from menu
This commit is contained in:
parent
e1b6fe1344
commit
b2fc16e030
8 changed files with 50 additions and 29 deletions
18
src/app.cpp
18
src/app.cpp
|
@ -30,15 +30,6 @@ void app::setup() {
|
|||
mSettings.getPtr(mConfig);
|
||||
DPRINTLN(DBG_INFO, F("Settings valid: ") + String((mSettings.getValid()) ? F("true") : F("false")));
|
||||
|
||||
every(std::bind(&app::tickSend, this), mConfig->nrf.sendInterval);
|
||||
#if !defined(AP_ONLY)
|
||||
once(std::bind(&app::tickNtpUpdate, this), 2);
|
||||
if((mConfig->sun.lat) && (mConfig->sun.lon)) {
|
||||
mCalculatedTimezoneOffset = (int8_t)((mConfig->sun.lon >= 0 ? mConfig->sun.lon + 7.5 : mConfig->sun.lon - 7.5) / 15) * 3600;
|
||||
once(std::bind(&app::tickCalcSunrise, this), 5);
|
||||
}
|
||||
#endif
|
||||
|
||||
mSys = new HmSystemType();
|
||||
mSys->enableDebug();
|
||||
mSys->setup(mConfig->nrf.amplifierPower, mConfig->nrf.pinIrq, mConfig->nrf.pinCe, mConfig->nrf.pinCs);
|
||||
|
@ -51,6 +42,15 @@ void app::setup() {
|
|||
|
||||
mWifi.setup(mConfig, &mTimestamp);
|
||||
|
||||
every(std::bind(&app::tickSend, this), mConfig->nrf.sendInterval);
|
||||
#if !defined(AP_ONLY)
|
||||
once(std::bind(&app::tickNtpUpdate, this), 2);
|
||||
if((mConfig->sun.lat) && (mConfig->sun.lon)) {
|
||||
mCalculatedTimezoneOffset = (int8_t)((mConfig->sun.lon >= 0 ? mConfig->sun.lon + 7.5 : mConfig->sun.lon - 7.5) / 15) * 3600;
|
||||
once(std::bind(&app::tickCalcSunrise, this), 5);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(mSys->Radio.isChipConnected()) {
|
||||
mSys->addInverters(&mConfig->inst);
|
||||
mPayload.setup(mSys);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue