30 #define TRACE_LEVEL WDT_TASK_TRACE_LEVEL
31 #define LOCAL_TASK_ID WDT_TASK_ID
42 WdtTask::WdtTask(
const char *taskName, uint16_t stackSize, uint8_t priority,
WdtParam_t wdtParam) : Thread(taskName, stackSize, priority), param(wdtParam)
49 bool firsCheck =
true;
51 char strTask[12] = {0};
52 uint8_t last_day_boot_rst;
59 TRACE_INFO_F(F(
"WDT: Starting WDT and Info Stack TASK..."));
69 last_day_boot_rst =
rtc.getDay();
72 if(last_day_boot_rst !=
rtc.getDay()) {
73 last_day_boot_rst =
rtc.getDay();
122 #if (ENABLE_STACK_USAGE)
124 stackUsage = (uint16_t)uxTaskGetStackHighWaterMark( NULL );
130 TRACE_INFO_F(F(
"WDT: Stack Free monitor, Heap free: %lu\r\n"), (uint32_t)xPortGetFreeHeapSize());
135 strcpy (strTask,
"Accelerom. ");
break;
137 strcpy (strTask,
"Can Bus ");
break;
139 strcpy (strTask,
"Elabor.Data ");
break;
141 strcpy (strTask,
"Mod.Sensor ");
break;
143 strcpy (strTask,
"Supervisor ");
break;
145 strcpy (strTask,
"WDT Info ");
break;
187 TRACE_INFO_F(F(
"WDT: Flashing firmware with roll_back executed."));
189 TRACE_INFO_F(F(
"WDT: Flashing firmware with new version ready, clear flags."));
bool Write(uint16_t address, uint8_t *buffer, uint16_t length)
Write a number of data byte into EEPROM.
WdtTask(const char *taskName, uint16_t stackSize, uint8_t priority, WdtParam_t wdtParam)
#define CAN_TASK_ID
CAN task ID.
#define TOTAL_INFO_TASK
Total Max Task for WDT Task Control.
#define SUPERVISOR_TASK_ID
Supervisor task ID.
#define RTC_WAIT_DELAY_MS
Delay for RTC in milliseconds.
#define SENSOR_TASK_ID
Sensor acquire task ID.
#define BOOT_LOADER_STRUCT_ADDR
Bootloader start address
#define ELABORATE_TASK_ID
Elaborate data task ID.
#define WDT_TASK_ID
Watch Dog task ID.
#define ACCELEROMETER_TASK_ID
Accelerometer task ID.
#define TRACE_INFO_F(...)
@ set
Set WDT (From Application TASK... All OK)
@ timer
Set Timered WDT (From Application long function WDT...)
@ clear
Wdt Reset (From WDT Task Controller)
@ suspended
Task is excluded from WDT Controller or Suspended complete.
@ normal
Normal operation Task controller.
struct for local param access
cpp_freertos::BinarySemaphore * rtcLock
semaphore access to RTC
cpp_freertos::BinarySemaphore * systemStatusLock
semaphore access to system status
EEprom * eeprom
Pointer to EEprom C++ object.
system_status_t * system_status
system configuration pointer struct
bootloader_t * boot_request
bootloader struct access pointer
Backup && Upload Firmware TypeDef (BootLoader)
bool rollback_executed
An rollback of firmware was executed.
bool upload_executed
An upload of firmware was executed.
uint8_t tot_reset
Number of module reset.
uint8_t wdt_reset
Number of WatchDog.
uint8_t upload_error
Error in upload firmware (ID of Error)
bool backup_executed
Firmware backup is executed.
bool app_forcing_start
Force starting APP from Flash RUN APP Memory Position.
bool app_executed_ok
Flag running APP (setted after new firmware, prevert a rollback operation)
bool request_upload
Request an upload of firmware.
task_t tasks[TOTAL_INFO_TASK]
Info Task && WDT.
int32_t watch_dog_ms
WatchDog of Task Timer.
uint8_t running_pos
!=0 (CREATE) Task Started (Generic state of Task)
task_flag state
Long sleep Task.
wdt_flag watch_dog
WatchDog of Task.
uint16_t stack
Stack Max Usage Monitor.
wdt_task header file (Wdt && Logging Task for Module Slave)
#define WDT_TASK_WAIT_DELAY_MS