2022-01-10 00:02:21 +01:00
|
|
|
#ifndef _GLOBALS_H_
|
|
|
|
#define _GLOBALS_H_
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
|
|
|
|
typedef enum eSystem_Status
|
|
|
|
{
|
|
|
|
sysStat_Startup,
|
|
|
|
sysStat_Normal,
|
|
|
|
sysStat_Rain,
|
|
|
|
sysStat_Purge,
|
2022-01-19 22:23:36 +01:00
|
|
|
sysStat_Error,
|
|
|
|
sysStat_Shutdown
|
2022-01-10 00:02:21 +01:00
|
|
|
} tSystem_Status;
|
|
|
|
|
2022-02-04 21:24:15 +01:00
|
|
|
typedef enum eEERequest
|
|
|
|
{
|
|
|
|
EE_IDLE,
|
|
|
|
EE_CFG_SAVE,
|
|
|
|
EE_CFG_LOAD,
|
2022-08-22 14:26:37 +02:00
|
|
|
EE_CFG_FORMAT,
|
2022-02-04 21:24:15 +01:00
|
|
|
EE_PDS_SAVE,
|
2022-08-19 00:10:42 +02:00
|
|
|
EE_PDS_LOAD,
|
2022-08-22 14:26:37 +02:00
|
|
|
EE_PDS_FORMAT,
|
2022-08-22 14:49:14 +02:00
|
|
|
EE_FORMAT_ALL,
|
2022-08-19 00:10:42 +02:00
|
|
|
EE_ALL_SAVE
|
2022-08-22 14:26:37 +02:00
|
|
|
|
2022-02-04 21:24:15 +01:00
|
|
|
} tEERequest;
|
2022-01-14 15:36:17 +01:00
|
|
|
|
2022-02-04 21:24:15 +01:00
|
|
|
typedef struct Globals_s
|
|
|
|
{
|
2022-01-10 00:02:21 +01:00
|
|
|
tSystem_Status systemStatus = sysStat_Startup;
|
2022-01-10 00:55:04 +01:00
|
|
|
tSystem_Status resumeStatus = sysStat_Startup;
|
2022-01-14 15:36:17 +01:00
|
|
|
char systemStatustxt[16] = "";
|
2022-08-21 15:47:22 +02:00
|
|
|
uint16_t purgePulses = 0;
|
2022-02-04 21:24:15 +01:00
|
|
|
eEERequest requestEEAction = EE_IDLE;
|
2022-08-14 17:38:45 +02:00
|
|
|
char DeviceName[33];
|
2022-08-23 00:48:00 +02:00
|
|
|
char FlashVersion[10];
|
2022-08-19 11:25:26 +02:00
|
|
|
uint16_t eePersistanceAdress;
|
2022-08-22 14:13:55 +02:00
|
|
|
uint8_t TankPercentage;
|
|
|
|
bool hasDTC;
|
2022-02-04 21:24:15 +01:00
|
|
|
} Globals_t;
|
2022-01-10 00:02:21 +01:00
|
|
|
|
|
|
|
extern Globals_t globals;
|
|
|
|
|
2023-03-02 23:35:41 +01:00
|
|
|
typedef struct Constants_s
|
|
|
|
{
|
|
|
|
uint8_t FW_Version_major;
|
|
|
|
uint8_t FW_Version_minor;
|
|
|
|
uint8_t Flash_Version_major;
|
|
|
|
uint8_t Flash_Version_minor;
|
|
|
|
char GitHash[11];
|
|
|
|
} Constants_t;
|
|
|
|
|
|
|
|
const Constants_t constants PROGMEM = {
|
|
|
|
1,4, // Firmware_Version
|
|
|
|
1,4, // Flash Version
|
|
|
|
GIT_REV // Git-Hash-String
|
|
|
|
};
|
|
|
|
|
2023-02-23 23:14:58 +01:00
|
|
|
void initGlobals();
|
|
|
|
|
2022-01-10 00:02:21 +01:00
|
|
|
#endif
|