/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.h * @brief : Header for main.c file. * This file contains the common defines of the application. ****************************************************************************** * @attention * * Copyright (c) 2024 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 __MAIN_H #define __MAIN_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f1xx_hal.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include #define BootLoader_Size 0x7800U #define Application_Size 0xC800U #define BIT_Task01_EVENT (EventBits_t)(0x0001 << 0) #define BIT_Task02_EVENT (EventBits_t)(0x0001 << 1) #define BIT_Task03_EVENT (EventBits_t)(0x0001 << 2) #define BIT_Task04_EVENT (EventBits_t)(0x0001 << 3) #define BIT_TaskAll_EVENT BIT_Task01_EVENT | BIT_Task02_EVENT | BIT_Task03_EVENT | BIT_Task04_EVENT #define Application_1_Addr 0x08000000U #define Application_2_Addr (Application_1_Addr + Application_Size) // 0x80118000U 0x801E000 /* 启动的步�? */ #define Startup_Normal 0xFFFFFFFF // 正常启动 #define Startup_Update 0xAAAAAAAA // 升级再启�? #define Startup_Reset 0x5555AAAA // ***恢复出厂 目前没使�?*** #define ENABLE_DEBUG 1 #if ENABLE_DEBUG > 0 #define DEBUG_PRINTF(...) printf("DEBUG: " __VA_ARGS__) #else #define DEBUG_PRINTF(...) do {} while (0) #endif /* USER CODE END Includes */ /* Exported types ------------------------------------------------------------*/ /* USER CODE BEGIN ET */ /* USER CODE END ET */ /* Exported constants --------------------------------------------------------*/ /* USER CODE BEGIN EC */ /* USER CODE END EC */ /* Exported macro ------------------------------------------------------------*/ /* USER CODE BEGIN EM */ /* USER CODE END EM */ /* Exported functions prototypes ---------------------------------------------*/ void Error_Handler(void); /* USER CODE BEGIN EFP */ /* USER CODE END EFP */ /* Private defines -----------------------------------------------------------*/ /* USER CODE BEGIN Private defines */ /* USER CODE END Private defines */ #ifdef __cplusplus } #endif #endif /* __MAIN_H */