CubeMX 生成 ADC1(9 通道)+ 复原重生成定制,FreeRTOS 加固迁 L1、钩子落 USER CODE 4/5,门禁豁免生成文件空白改写
This commit is contained in:
+2
-10
@@ -74,19 +74,11 @@
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configUSE_MUTEXES 1
|
||||
#define configQUEUE_REGISTRY_SIZE 8
|
||||
#define configCHECK_FOR_STACK_OVERFLOW 2
|
||||
#define configUSE_RECURSIVE_MUTEXES 1
|
||||
#define configUSE_MALLOC_FAILED_HOOK 1
|
||||
#define configUSE_COUNTING_SEMAPHORES 1
|
||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
|
||||
/* USER CODE BEGIN FREE_RTOS_CONFIG_HARDENING */
|
||||
/* 栈溢出机械检测(2026-09-20 存储套件死机事故后加):模式 2 在每次上下文切换
|
||||
* 检查栈底水位线,溢出即调 vApplicationStackOverflowHook(报任务名+复位)。
|
||||
* 关闭检测时溢出会静默腐蚀堆相邻块(其它任务栈/TCB),表现为无异常、不可定位
|
||||
* 的全系统冻结——本次事故签名。开销:每次切换一次字比较,可忽略。
|
||||
* ⚠ 本段为手工添加,CubeMX 重生成会删除(2026-09-29 实测),改完须核对本块存在 */
|
||||
#define configCHECK_FOR_STACK_OVERFLOW 2
|
||||
/* pvPortMalloc 失败钩子(只告警不复位:分配失败路径由各调用点 NULL 检查处理) */
|
||||
#define configUSE_MALLOC_FAILED_HOOK 1
|
||||
/* USER CODE END FREE_RTOS_CONFIG_HARDENING */
|
||||
/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */
|
||||
/* Defaults to size_t for backward compatibility, but can be changed
|
||||
if lengths will always be less than the number of bytes in a size_t. */
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file adc.h
|
||||
* @brief This file contains all the function prototypes for
|
||||
* the adc.c file
|
||||
******************************************************************************
|
||||
* @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 __ADC_H__
|
||||
#define __ADC_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
extern ADC_HandleTypeDef hadc1;
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
void MX_ADC1_Init(void);
|
||||
|
||||
/* USER CODE BEGIN Prototypes */
|
||||
|
||||
/* USER CODE END Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ADC_H__ */
|
||||
+18
@@ -59,6 +59,24 @@ void Error_Handler(void);
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
#define CH395_INT_Pin GPIO_PIN_5
|
||||
#define CH395_INT_GPIO_Port GPIOE
|
||||
#define ADC9_RES_Pin GPIO_PIN_0
|
||||
#define ADC9_RES_GPIO_Port GPIOA
|
||||
#define ADC10_IC_Pin GPIO_PIN_1
|
||||
#define ADC10_IC_GPIO_Port GPIOA
|
||||
#define ADC11_IN_Pin GPIO_PIN_2
|
||||
#define ADC11_IN_GPIO_Port GPIOA
|
||||
#define ADC12_UC_Pin GPIO_PIN_3
|
||||
#define ADC12_UC_GPIO_Port GPIOA
|
||||
#define ADC13_RES_Pin GPIO_PIN_4
|
||||
#define ADC13_RES_GPIO_Port GPIOA
|
||||
#define ADC14_TEMP_Pin GPIO_PIN_5
|
||||
#define ADC14_TEMP_GPIO_Port GPIOA
|
||||
#define ADC15_IB_Pin GPIO_PIN_6
|
||||
#define ADC15_IB_GPIO_Port GPIOA
|
||||
#define ADC16_RES_Pin GPIO_PIN_7
|
||||
#define ADC16_RES_GPIO_Port GPIOA
|
||||
#define ADC17_UB_Pin GPIO_PIN_4
|
||||
#define ADC17_UB_GPIO_Port GPIOC
|
||||
#define LED1_Pin GPIO_PIN_5
|
||||
#define LED1_GPIO_Port GPIOC
|
||||
#define LED2_Pin GPIO_PIN_0
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#define HAL_MODULE_ENABLED
|
||||
|
||||
/* #define HAL_CRYP_MODULE_ENABLED */
|
||||
/* #define HAL_ADC_MODULE_ENABLED */
|
||||
#define HAL_ADC_MODULE_ENABLED
|
||||
/* #define HAL_CAN_MODULE_ENABLED */
|
||||
/* #define HAL_CRC_MODULE_ENABLED */
|
||||
/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
|
||||
|
||||
Reference in New Issue
Block a user