docs
This commit is contained in:
parent
ef7e49ca18
commit
398b6fc512
1 changed files with 18 additions and 8 deletions
24
src/main.cpp
24
src/main.cpp
|
@ -624,14 +624,25 @@ void setup() {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The main loop function that runs repeatedly in the program.
|
||||||
|
*
|
||||||
|
* This function is responsible for processing the card reader data and performing necessary actions based on the received data.
|
||||||
|
* It checks for new data availability, validates the data, and performs actions accordingly.
|
||||||
|
* If valid card data is received, it extracts the facility ID and card ID, and prints them to the Serial or WebSerial (if enabled).
|
||||||
|
* It then calls the appropriate functions based on the defined macros to handle the card data.
|
||||||
|
* If no valid card data is received within the specified time, it resets the card data and bit count.
|
||||||
|
*
|
||||||
|
* @note This function assumes the availability of certain macros like TINANCE2_BACKEND, LOCAL_ACL, SERIAL_ACL, SERIAL_DEBUG, and WEB_SERIAL_DEBUG.
|
||||||
|
*
|
||||||
|
* @note This function assumes the availability of certain variables like newDataAvailable, lastDataTime, displayDelay, cardData, bitCount, and maxReaderWaitTime.
|
||||||
|
*
|
||||||
|
* @note This function assumes the availability of certain functions like updateDoorStatus, checkSerialCommand, tinance2authrequest, and localAcl.
|
||||||
|
*/
|
||||||
void loop() {
|
void loop() {
|
||||||
|
#ifdef TINANCE2_BACKEND
|
||||||
|
|
||||||
#ifdef TINANCE2_BACKEND
|
|
||||||
updateDoorStatus();
|
updateDoorStatus();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef LOCAL_ACL
|
#ifdef LOCAL_ACL
|
||||||
#ifdef SERIAL_ACL
|
#ifdef SERIAL_ACL
|
||||||
|
@ -639,7 +650,6 @@ void loop() {
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if (newDataAvailable) {
|
if (newDataAvailable) {
|
||||||
newDataAvailable = false;
|
newDataAvailable = false;
|
||||||
lastDataTime = millis(); // Reset the time of last received data
|
lastDataTime = millis(); // Reset the time of last received data
|
||||||
|
|
Loading…
Reference in a new issue