From b893a0283fb03422571956c325af31fd40eaea8d Mon Sep 17 00:00:00 2001 From: Steins7 Date: Sun, 3 Nov 2024 22:53:19 +0100 Subject: [PATCH] Reduce task's context size Since RTC ans STK timestamps are now different, they don't need to be as big and be can safely reduce their size to 24 bits to save space --- srv/task.c | 1 + srv/task.h | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/srv/task.c b/srv/task.c index f834b76..b79a92e 100644 --- a/srv/task.c +++ b/srv/task.c @@ -165,3 +165,4 @@ static void callback_rtc(void) bkp_set_rtc_alam(1); pwr_configure_bkp_write(false); } + diff --git a/srv/task.h b/srv/task.h index 56ec971..9de5b04 100644 --- a/srv/task.h +++ b/srv/task.h @@ -47,10 +47,10 @@ enum TaskTrigger { * struct */ struct TaskState { - uint32_t timestamp; //timestamp at wich to wakeup the task, if any - uint8_t count:5; //task counter: active step of task + uint32_t timestamp:24; //timestamp at wich to wakeup the task, if any + uint32_t count:5; //task counter: active step of task enum TaskTrigger trigger:2; //triggers on wich to execute the task - uint8_t timeout_mode:1; //whether the timestamp is a timeout or a delay + uint32_t timeout_mode:1; //whether the timestamp is a timeout or a delay }; /**