Browse Source

【支线待合】异步输出调通;freeRTOS要把初始化放到内核初始化后

master
Lizongdi 2 weeks ago
parent
commit
a177d10bbf
  1. 15
      Core/Src/freertos.c
  2. 16
      Core/Src/main.c

15
Core/Src/freertos.c

@ -26,7 +26,10 @@
/* Private includes ----------------------------------------------------------*/ /* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */ /* USER CODE BEGIN Includes */
#include "common_cfg.h"
#ifdef MEM_POOL_TOTAL_SIZE
#include "common.h"
#endif
/* USER CODE END Includes */ /* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/ /* Private typedef -----------------------------------------------------------*/
@ -58,7 +61,7 @@ const osThreadAttr_t defaultTask_attributes = {
/* Private function prototypes -----------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/
/* USER CODE BEGIN FunctionPrototypes */ /* USER CODE BEGIN FunctionPrototypes */
void Myprint_Init(void);
/* USER CODE END FunctionPrototypes */ /* USER CODE END FunctionPrototypes */
void StartDefaultTask(void *argument); void StartDefaultTask(void *argument);
@ -133,6 +136,14 @@ void MX_FREERTOS_Init(void) {
/* USER CODE BEGIN RTOS_THREADS */ /* USER CODE BEGIN RTOS_THREADS */
/* add 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(); MyTask_Init();
Drv_InterfaceInit(); Drv_InterfaceInit();
/* USER CODE END RTOS_THREADS */ /* USER CODE END RTOS_THREADS */

16
Core/Src/main.c

@ -32,10 +32,7 @@
/* Private includes ----------------------------------------------------------*/ /* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */ /* USER CODE BEGIN Includes */
#include "common_cfg.h"
#ifdef MEM_POOL_TOTAL_SIZE
#include "common.h"
#endif
/* USER CODE END Includes */ /* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/ /* Private typedef -----------------------------------------------------------*/
@ -64,7 +61,7 @@ void SystemClock_Config(void);
static void MPU_Config(void); static void MPU_Config(void);
void MX_FREERTOS_Init(void); void MX_FREERTOS_Init(void);
/* USER CODE BEGIN PFP */ /* USER CODE BEGIN PFP */
void Myprint_Init(void);
/* USER CODE END PFP */ /* USER CODE END PFP */
/* Private user code ---------------------------------------------------------*/ /* Private user code ---------------------------------------------------------*/
@ -129,14 +126,7 @@ int main(void)
MX_LPUART1_UART_Init(); MX_LPUART1_UART_Init();
MX_ADC2_Init(); MX_ADC2_Init();
/* USER CODE BEGIN 2 */ /* 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 */ /* USER CODE END 2 */
/* Init scheduler */ /* Init scheduler */

Loading…
Cancel
Save