Introducing enum for handling the NFC state to improve code readability

This commit is contained in:
Jan Philipp Ecker
2025-03-29 11:45:38 +01:00
parent 6cc4efca0a
commit c701149c64
4 changed files with 58 additions and 48 deletions

View File

@@ -3,6 +3,16 @@
#include <Arduino.h>
typedef enum{
IDLE,
READING,
READ_SUCCESS,
READ_ERROR,
WRITING,
WRITE_SUCCESS,
WRITE_ERROR
} nfcReaderStateType;
void startNfc();
void scanRfidTask(void * parameter);
void startWriteJsonToTag(const char* payload);
@@ -10,7 +20,9 @@ void startWriteJsonToTag(const char* payload);
extern TaskHandle_t RfidReaderTask;
extern String nfcJsonData;
extern String spoolId;
extern volatile uint8_t hasReadRfidTag;
extern volatile nfcReaderStateType nfcReaderState;
extern volatile bool pauseBambuMqttTask;
#endif