From a177d10bbf0cbd147dfbbe694718917ab97670a2 Mon Sep 17 00:00:00 2001 From: Lizongdi <1210855344@qq.com> Date: Fri, 18 Sep 2026 15:40:53 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=94=AF=E7=BA=BF=E5=BE=85=E5=90=88?= =?UTF-8?q?=E3=80=91=E5=BC=82=E6=AD=A5=E8=BE=93=E5=87=BA=E8=B0=83=E9=80=9A?= =?UTF-8?q?=EF=BC=9BfreeRTOS=E8=A6=81=E6=8A=8A=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=94=BE=E5=88=B0=E5=86=85=E6=A0=B8=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Core/Src/freertos.c | 15 +++++++++++++-- Core/Src/main.c | 16 +++------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Core/Src/freertos.c b/Core/Src/freertos.c index 717e310..b405193 100644 --- a/Core/Src/freertos.c +++ b/Core/Src/freertos.c @@ -26,7 +26,10 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ - +#include "common_cfg.h" +#ifdef MEM_POOL_TOTAL_SIZE +#include "common.h" +#endif /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -58,7 +61,7 @@ const osThreadAttr_t defaultTask_attributes = { /* Private function prototypes -----------------------------------------------*/ /* USER CODE BEGIN FunctionPrototypes */ - +void Myprint_Init(void); /* USER CODE END FunctionPrototypes */ void StartDefaultTask(void *argument); @@ -133,6 +136,14 @@ void MX_FREERTOS_Init(void) { /* USER CODE BEGIN RTOS_THREADS */ /* add threads, ... */ +#ifdef MEM_POOL_TOTAL_SIZE + void W25QXX_Init(void); + W25QXX_Init(); + RD_INIT(); +#ifdef USE_PRINT + Myprint_Init(); +#endif +#endif MyTask_Init(); Drv_InterfaceInit(); /* USER CODE END RTOS_THREADS */ diff --git a/Core/Src/main.c b/Core/Src/main.c index 66fa85c..4fccd15 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -32,10 +32,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ -#include "common_cfg.h" -#ifdef MEM_POOL_TOTAL_SIZE -#include "common.h" -#endif + /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -64,7 +61,7 @@ void SystemClock_Config(void); static void MPU_Config(void); void MX_FREERTOS_Init(void); /* USER CODE BEGIN PFP */ -void Myprint_Init(void); + /* USER CODE END PFP */ /* Private user code ---------------------------------------------------------*/ @@ -129,14 +126,7 @@ int main(void) MX_LPUART1_UART_Init(); MX_ADC2_Init(); /* USER CODE BEGIN 2 */ -#ifdef MEM_POOL_TOTAL_SIZE - void W25QXX_Init(void); - W25QXX_Init(); - RD_INIT(); -#ifdef USE_PRINT - Myprint_Init(); -#endif -#endif + /* USER CODE END 2 */ /* Init scheduler */