From 7bb401762abb195f584058c229f06050ccf878f4 Mon Sep 17 00:00:00 2001 From: Erick Ahmed Date: Wed, 10 Jun 2026 11:24:43 +0200 Subject: [PATCH] Add headers for better code regeneration compatibility with STM32CubeMX --- Core/Inc/canlog.h | 21 +++++++++++++++++++++ Core/Src/canlog.c | 25 ++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/Core/Inc/canlog.h b/Core/Inc/canlog.h index 1a822f7..2b7e068 100644 --- a/Core/Inc/canlog.h +++ b/Core/Inc/canlog.h @@ -1,3 +1,24 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : canlog.h + * @brief : Header for canlog.c file. + * This file contains the defines related to SAE J1939 CAN. + ****************************************************************************** + * @attention + * + * Copyright (c) 2026 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ #ifndef CANLOG_H #define CANLOG_H diff --git a/Core/Src/canlog.c b/Core/Src/canlog.c index 882d868..7feb79f 100644 --- a/Core/Src/canlog.c +++ b/Core/Src/canlog.c @@ -1,7 +1,28 @@ - +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : canlog.c + * @brief : SAE J1939 CAN Real Time listening and decoding + ****************************************************************************** + * @attention + * + * Copyright (c) 2026 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ +/* Includes ------------------------------------------------------------------*/ #include "canlog.h" +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ #include "cmsis_os.h" #include +/* USER CODE END Includes */ extern CAN_HandleTypeDef hcan1; extern CAN_HandleTypeDef hcan2; @@ -42,6 +63,7 @@ const osThreadAttr_t vLED_CAN2_Heartbeat_attributes = { /* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN FunctionPrototypes */ /* BEGIN CAN_Logger_Init */ /** * @brief Initialize CAN @@ -117,3 +139,4 @@ void vLED_HeartbeatOnCanRx(void *argument) /* CODE END */ } /* END vLED_HeartbeatOnCanRx */ +/* USER CODE END FunctionPrototypes */