Files
ZhaTianRC/Core/Inc/main.h
admin f3df7276b2 feat: 长按返回键2s开关机功能
- 开机: 长按返回键2s开机,显示左侧Logo+右侧'Starting...'开机画面2秒
- 关机: 主页未连接接收机时长按返回键2s关机
  - 关闭OLED/LED/PWM/NRF24L01/USB/外设时钟 → STOP休眠
  - 唤醒后自动复位重启
- 已连接接收机时屏蔽关机,防止飞行中误操作
- 添加 Input_IsKeyHeldFor() 指定时长按键检测
- 添加 OLED_Off() 关闭显示
- 更新 README.md 文档
2026-06-25 23:19:31 +08:00

70 lines
2.0 KiB
C

/* 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) 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 __MAIN_H
#define __MAIN_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* 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 */
void System_Shutdown(void); /* 系统关机: 关闭外设进入休眠 */
/* USER CODE END EFP */
/* Private defines -----------------------------------------------------------*/
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
#ifdef __cplusplus
}
#endif
#endif /* __MAIN_H */