当前位置: 首页 > news >正文

【STM32】FreeRTOS开启后,不再进入主函数的while(1)

开启freertos后,想在主函数的while(1)中实现led的翻转,发现无法实现。

int main(void)
{/* USER CODE BEGIN 1 *//* USER CODE END 1 *//* MCU Configuration--------------------------------------------------------*//* Reset of all peripherals, Initializes the Flash interface and the Systick. */HAL_Init();/* USER CODE BEGIN Init *//* USER CODE END Init *//* Configure the system clock */SystemClock_Config();/* USER CODE BEGIN SysInit *//* USER CODE END SysInit *//* Initialize all configured peripherals */MX_GPIO_Init();MX_USART1_UART_Init();/* USER CODE BEGIN 2 *//* USER CODE END 2 *//* Call init function for freertos objects (in freertos.c) */MX_FREERTOS_Init();/* Start scheduler */osKernelStart();/* We should never get here as control is now taken by the scheduler *//* Infinite loop *//* USER CODE BEGIN WHILE */while (1){HAL_GPIO_TogglePin(GPIOF,GPIO_PIN_9);HAL_Delay(1000);/* USER CODE END WHILE *//* USER CODE BEGIN 3 */}/* USER CODE END 3 */
}

分析原因:

osKernelStart();/* We should never get here as control is now taken by the scheduler */

osKernelStart();

语句后面有一个注释:

  /* We should never get here as control is now taken by the scheduler */

我们永远不会到达这里,因为控制权现在被调度器拿走了

http://www.lryc.cn/news/119945.html

相关文章:

  • Python+Selenium+Unittest 之selenium11--WebDriver操作方法1-常用操作
  • 气液固三相线识别—Langmuir部分复现
  • Redis——常见数据结构与单线程模型
  • 大数据-玩转数据-Flink-Transform
  • Java泛型集合简明教程
  • Prometheus-RabbitMQ Exporter
  • flink读取kafka数据存储iceberg
  • 文章二:分支管理策略 - 分支玩转:Git分支管理实战
  • JS dom元素和鼠标位置之间的一系列属性快速参考
  • 【剑指 Offer 39】数组中超过一半的数字
  • list.stream.filter,List<List>转换为List
  • 手机里视频太大怎么压缩?压缩教程分享
  • Spring-Cloud-Loadblancer详细分析_3
  • 使用 VScode 开发 ROS 的Python程序(简例)
  • 2022年03月 C/C++(一级)真题解析#中国电子学会#全国青少年软件编程等级考试
  • HarmonyOS/OpenHarmony应用开发-ArkTSAPI系统能力SystemCapability列表
  • 【01】基础知识:typescript安装及使用,开发工具vscode配置
  • 用C++实现的RTS游戏的路径查找算法(A*、JPS、Wall-tracing)
  • helm 制作应用的离线安装包
  • RN实现混合式开发-内嵌html
  • 2000-2022年全国各地级市绿色金融指数数据
  • MachineLearningWu_13/P60-P64_Tensorflow
  • centos7实现负载均衡
  • Django笔记之数据库函数之日期函数
  • 系统架构师---开发方法---敏捷开发
  • 数据中心液冷技术:规模扩张的新里程碑
  • 页面静态化(模板引擎Freemarker)
  • 详细记录Pycharm配置已安装好的Conda虚拟环境
  • photoshop生成器引入到electron项目(electron与photoshop建立通信)
  • Stable Diffuion webui Mac版本安装过程