2022-04-14 22:48:11 +02:00
|
|
|
#ifndef _GLOBALS_H_
|
|
|
|
#define _GLOBALS_H_
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
2024-05-30 23:38:05 +02:00
|
|
|
#include "eeprom.h"
|
|
|
|
#include "common.h"
|
2022-04-14 22:48:11 +02:00
|
|
|
typedef struct Globals_s
|
|
|
|
{
|
2024-05-30 23:38:05 +02:00
|
|
|
tSystem_Status systemStatus = sysStat_Startup; /**< Current system status */
|
|
|
|
tSystem_Status resumeStatus = sysStat_Startup; /**< Status to resume after rain mode */
|
|
|
|
char systemStatustxt[16] = ""; /**< Text representation of system status */
|
|
|
|
EERequest_t requestEEAction = EE_IDLE; /**< EEPROM-related request */
|
2024-06-02 23:35:20 +02:00
|
|
|
char DeviceName[25]; /**< Device name */
|
2024-05-31 12:49:06 +02:00
|
|
|
char DeviceNameId[sizeof(DeviceName) + 8]; /**< Device name plus 8 chars chipID */
|
2024-05-30 23:38:05 +02:00
|
|
|
char FlashVersion[10]; /**< Flash version */
|
|
|
|
uint16_t eePersistanceAdress; /**< EEPROM persistence address */
|
2023-02-20 13:51:54 +01:00
|
|
|
bool hasDTC;
|
|
|
|
int loadvoltage_mV = 0;
|
2022-04-14 22:48:11 +02:00
|
|
|
int battery_level = 0;
|
2023-05-25 19:59:34 +02:00
|
|
|
bool timer_disabled = false;
|
2022-04-14 22:48:11 +02:00
|
|
|
} Globals_t;
|
|
|
|
|
2024-05-30 23:38:05 +02:00
|
|
|
extern Globals_t globals; /**< Global variable struct */
|
|
|
|
|
2023-04-13 00:35:24 +02:00
|
|
|
typedef struct Constants_s
|
|
|
|
{
|
2024-05-30 23:38:05 +02:00
|
|
|
uint8_t FW_Version_major; /**< Firmware version major number */
|
|
|
|
uint8_t FW_Version_minor; /**< Firmware version minor number */
|
|
|
|
uint8_t Required_Flash_Version_major; /**< Required flash version major number */
|
|
|
|
uint8_t Required_Flash_Version_minor; /**< Required flash version minor number */
|
|
|
|
char GitHash[11]; /**< Git hash string */
|
2023-04-13 00:35:24 +02:00
|
|
|
} Constants_t;
|
|
|
|
|
|
|
|
const Constants_t constants PROGMEM = {
|
2024-05-31 12:47:45 +02:00
|
|
|
FW_MAJOR, FW_MINOR, // Firmware_Version
|
|
|
|
FL_MAJOR, FL_MINOR, // Required Flash Version
|
2024-05-30 23:38:05 +02:00
|
|
|
GIT_REV // Git-Hash-String
|
2023-04-13 00:35:24 +02:00
|
|
|
};
|
|
|
|
|
2024-05-30 23:38:05 +02:00
|
|
|
/**
|
|
|
|
* @brief Initializes global variables.
|
|
|
|
*/
|
2023-04-13 00:35:24 +02:00
|
|
|
void initGlobals();
|
2022-04-14 22:48:11 +02:00
|
|
|
|
2024-05-30 23:38:05 +02:00
|
|
|
#endif // _GLOBALS_H_
|