Compare commits
	
		
			No commits in common. "e7cff6287fcdc19f0b2b29735eaaa3c65a381d83" and "cd2b2ba624565f8905ef511f754fefe8296d2ee8" have entirely different histories.
		
	
	
		
			e7cff6287f
			...
			cd2b2ba624
		
	
		
| @ -1,25 +0,0 @@ | ||||
| /**
 | ||||
|  * Author : Anatole SCHRAMM-HENRY | ||||
|  * Created on : 03/04/2022 | ||||
|  * Licence : MIT | ||||
|  *  | ||||
|  * Dead simple object implementing a non blocking delay using the Arduino framework. | ||||
|  */ | ||||
| #include "NonBlockingDelay.h" | ||||
| 
 | ||||
| NonBlockingDelay::NonBlockingDelay(const unsigned long delay, unsigned long tickReference) : _delay(delay), _tickReference(tickReference){} | ||||
| 
 | ||||
| void NonBlockingDelay::reset() | ||||
| { | ||||
|     _tickReference = millis(); | ||||
| } | ||||
| 
 | ||||
| NonBlockingDelay::operator bool() | ||||
| { | ||||
|     bool isTimeElapsed(millis() - _tickReference > _delay); | ||||
| 
 | ||||
|     if(isTimeElapsed) | ||||
|         reset(); | ||||
| 
 | ||||
|     return isTimeElapsed; | ||||
| } | ||||
| @ -1,27 +0,0 @@ | ||||
| /**
 | ||||
|  * Author : Anatole SCHRAMM-HENRY | ||||
|  * Created on : 03/04/2022 | ||||
|  * Licence : MIT | ||||
|  *  | ||||
|  * Dead simple object implementing a non blocking delay using the Arduino framework. | ||||
|  */ | ||||
| #ifndef NONBLOCKINGDELAY_H | ||||
| #define NONBLOCKINGDELAY_H | ||||
| 
 | ||||
| #include <Arduino.h> | ||||
| 
 | ||||
| class NonBlockingDelay | ||||
| { | ||||
|     public: | ||||
|         NonBlockingDelay(const unsigned long delay, unsigned long tickReference = millis()); | ||||
|          | ||||
|         // Manually reset the internal tick reference
 | ||||
|         void reset(); | ||||
|         operator bool(); | ||||
|     protected: | ||||
|     private: | ||||
|         const unsigned long _delay; | ||||
|         unsigned long _tickReference; | ||||
| }; | ||||
| 
 | ||||
| #endif //NONBLOCKINGDELAY_H
 | ||||
| @ -1,10 +1,3 @@ | ||||
| /**
 | ||||
|  * Author : Anatole SCHRAMM-HENRY | ||||
|  * Created on : 24/02/2019 | ||||
|  * Licence : MIT | ||||
|  *  | ||||
|  * Dead simple object implementing a non blocking delay using the Arduino framework. | ||||
|  */ | ||||
| #include "definition.h"  | ||||
| #include "SAB.h" | ||||
| #include "views.h" | ||||
| @ -13,15 +6,13 @@ | ||||
| #include "CFGDictionary.h" | ||||
| #include "CFGParameterValue.h" | ||||
| #include "EventHandler.h" | ||||
| #include "NonBlockingDelay.h" | ||||
| #define DEBUG | ||||
| 
 | ||||
| SAB sab; | ||||
| EventHandler evHan; | ||||
| EventHandler::Event evt; | ||||
| 
 | ||||
| NonBlockingDelay dataRefreshNBD(1000); | ||||
| 
 | ||||
| unsigned long currentMs = 0; | ||||
| volatile boolean ioStateChange(false); | ||||
| View1Packet v1p = {sab.getRtcManager().getDateTime(), sab.getSdCardManager().getSize(GBYTE), sab.getPowerManager().getPowerInfo(),0, sab.getSoftVersion(), &sab}; | ||||
| ViewAPPacket vap = {sab.getConnectivityManager().softAPmacAddress(), sab.getConnectivityManager().softAPSSID(), sab.getConnectivityManager().softAPIP(), sab.getConnectivityManager().softAPgetStationNum(), sab.getConnectivityManager().isAPEnabled()}; | ||||
| @ -105,8 +96,9 @@ void setup() | ||||
| void loop()  | ||||
| { | ||||
|    | ||||
|   if(dataRefreshNBD || ioStateChange) | ||||
|   if(millis() - currentMs >= 1000 || ioStateChange) | ||||
|   { | ||||
|     currentMs = millis(); | ||||
|     v1p.dateTime = sab.getRtcManager().getDateTime(); | ||||
|     v1p.nbViews = sab.getScreenManager().getViewCount(); | ||||
|     vap.ipAddr = sab.getConnectivityManager().softAPIP(); | ||||
|  | ||||
| @ -38,7 +38,6 @@ | ||||
| //#define SOFT_VERSION "1.6.6" //Removed useless INIT state that was like the LINE_BREAK state and added '-' as an allowed PARAM and VALUE character
 | ||||
| //#define SOFT_VERSION "1.6.7" //Changed the way we store and return the 3 letter month abbreviation
 | ||||
| //#define SOFT_VERSION "1.6.8" //Finally fixed the random crash issue concerning the servers :)
 | ||||
| //#define SOFT_VERSION "1.6.9" //Updated the whole app to work with the esp8266 core 3.0.2 version, removed a bunch of warnings, corrected an array index overflow in apiTesterApi function
 | ||||
| #define SOFT_VERSION "1.6.10" //Introduced new class : NonBlockingDelay which is used in the app.ino file.
 | ||||
| #define SOFT_VERSION "1.6.9" //Updated the whole app the work with the esp8266 core 3.0.2 version, removed a bunch of warnings, corrected an array index overflow in apiTesterApi function
 | ||||
| 
 | ||||
| #endif //VERSIONS_H
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user