| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -4,13 +4,14 @@ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//-----------------------------------------------------------------------------
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					#include "app.h" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					#include <ArduinoJson.h> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					#include "utils/sun.h" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//-----------------------------------------------------------------------------
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					app::app() : ah::Scheduler() {} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//-----------------------------------------------------------------------------
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					void app::setup() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    Serial.begin(115200); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -78,13 +79,12 @@ void app::setup() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // Plugins
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    if (mConfig->plugin.display.type != 0) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        mMonoDisplay.setup(&mConfig->plugin.display, &mSys, &mTimestamp, 0xff, mVersion); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        mDisplay.setup(&mConfig->plugin.display, &mSys, &mTimestamp, 0xff, mVersion); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    mPubSerial.setup(mConfig, &mSys, &mTimestamp); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    regularTickers(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // DBGPRINTLN("--- end setup");
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // DBGPRINTLN(String(ESP.getFreeHeap()));
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // DBGPRINTLN(String(ESP.getHeapFragmentation()));
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -155,8 +155,7 @@ void app::onWifi(bool gotIp) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            mMqttEnabled = false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            everySec(std::bind(&ahoywifi::tickWifiLoop, &mWifi), "wifiL"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        mInnerLoopCb = std::bind(&app::loopWifi, this); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        everySec(std::bind(&ahoywifi::tickWifiLoop, &mWifi), "wifiL"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -168,7 +167,7 @@ void app::regularTickers(void) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    everySec(std::bind(&WebType::tickSecond, &mWeb), "webSc"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // Plugins
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    if (mConfig->plugin.display.type != 0) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        everySec(std::bind(&MonoDisplayType::tickerSecond, &mMonoDisplay), "disp"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        everySec(std::bind(&DisplayType::tickerSecond, &mDisplay), "disp"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    every(std::bind(&PubSerialType::tick, &mPubSerial), mConfig->serial.interval, "uart"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |