From b098ae30cc9b375e3db7c8887dcf2675a1370035 Mon Sep 17 00:00:00 2001 From: Caio Date: Mon, 28 Oct 2024 18:30:14 -0400 Subject: [PATCH] initialize rl can message --- middleware/include/can_utility.h | 3 ++- middleware/src/can_utility.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/middleware/include/can_utility.h b/middleware/include/can_utility.h index 45940bc..80ee63b 100644 --- a/middleware/include/can_utility.h +++ b/middleware/include/can_utility.h @@ -7,4 +7,5 @@ typedef struct { uint8_t msg_rate; /* in messages per second */ } rl_can_msg_t; -HAL_StatusTypeDef send_rl_can_msg(can_t *can, rl_can_msg_t *rl_can_msg); \ No newline at end of file +HAL_StatusTypeDef send_rl_can_msg(can_t *can, rl_can_msg_t *rl_can_msg); +HAL_StatusTypeDef rl_can_msg_init(rl_can_msg_t *rl_can_msg); \ No newline at end of file diff --git a/middleware/src/can_utility.c b/middleware/src/can_utility.c index 70f6d8b..78fd3a5 100644 --- a/middleware/src/can_utility.c +++ b/middleware/src/can_utility.c @@ -1,6 +1,13 @@ #include "can_utility.h" +HAL_StatusTypeDef rl_can_msg_init(rl_can_msg_t *rl_can_msg) +{ + rl_can_msg->msg_timer = osTimerNew(NULL, osTimerOnce, NULL, NULL); + + return HAL_OK; +} + /** * Sends a rate limited can message */