
FreeRTOS
一只鲲
这个作者很懒,什么都没留下…
展开
-
44 freertosCPU利用频率统计
Cpu利用率统计试验原创 2022-01-07 10:47:15 · 1063 阅读 · 0 评论 -
43 freertos任务通知-互斥量串口防止打印乱码
解决消息队列接收和发送任务优先级相同时串口乱码。通过互斥信号量实现对串口打印的互斥访问,防止多个任务同时访问造成串口打印乱码。原创 2022-01-07 10:47:00 · 1398 阅读 · 0 评论 -
42 freertos内存管理试验 2
获取当前内存大小 xPortGetFreeHeapSize(); pvPortMalloc(); 获取当前内剩余存大小 xPortGetFreeHeapSize(); vPortFree(); //释放内存原创 2022-01-07 10:46:35 · 241 阅读 · 0 评论 -
41 freertos内存管理试验 1
获取当前内存大小 xPortGetFreeHeapSize(); pvPortMalloc();获取当前内剩余存大小 xPortGetFreeHeapSize();vPortFree(); //释放内存原创 2022-01-07 10:46:21 · 379 阅读 · 0 评论 -
40 freertos内存管理
FreeRTOS 的 V9.0.0 版本提供了 5 种内存管理算法,分别是 heap_1.c、 heap_2.c、 heap_3.c、 heap_4.c、原创 2022-01-06 19:21:42 · 669 阅读 · 0 评论 -
39 freertos多事件等待
三十九、LPC824_freertos多事件等待/****************************************************************************************************/#include <stdio.h>#include <limits.h>//标准C库文件,定义了各种类型的范围#include "board.h"#include "led.h"#include "key.h"#inc原创 2022-01-06 19:19:09 · 981 阅读 · 0 评论 -
38 freertos任务通知-任务间通信综合实验
三十八、freertos任务通知-任务间通信综合实验/****************************************************************************************************/#include <stdio.h>#include <limits.h>//标准C库文件,定义了各种类型的范围#include "board.h"#include "led.h"#include "key.h"#i原创 2022-01-06 19:18:21 · 481 阅读 · 0 评论 -
37 freertos任务通知-代替事件组
三十七、 freertos任务通知-代替事件组/****************************************************************************************************/#include <stdio.h>#include <limits.h>//标准C库文件,定义了各种类型的范围#include "board.h"#include "led.h"#include "key.h"#incl原创 2022-01-06 19:17:22 · 1289 阅读 · 0 评论 -
36 freertos任务通知-代替计数信号量
三十六、freertos任务通知-代替计数信号量/****************************************************************************************************/#include <stdio.h>#include <limits.h>//标准C库文件,定义了各种类型的范围#include "board.h"#include "led.h"#include "key.h"#in原创 2022-01-06 19:16:29 · 970 阅读 · 0 评论 -
35 freertos任务通知-代替二值信号量
三十五、 freertos任务通知-代替二值信号量/****************************************************************************************************/#include <stdio.h>#include <limits.h>//标准C库文件,定义了各种类型的范围#include "board.h"#include "led.h"#include "key.h"#in原创 2022-01-06 19:15:32 · 1956 阅读 · 0 评论 -
34 freertos任务通知--代替消息队列(任务邮箱)覆盖和非覆盖
三十四、 freertos任务通知–代替消息队列(任务邮箱)覆盖和非覆盖/****************************************************************************************************/#include <stdio.h>#include <limits.h>//标准C库文件,定义了各种类型的范围#include "board.h"#include "led.h"#include原创 2022-01-06 19:14:42 · 1882 阅读 · 0 评论 -
33 freertos任务通知--代替消息队列(任务邮箱)-中断
三十三、LPC824_freertos任务通知–代替消息队列(任务邮箱)-中断main.c:/****************************************************************************************************/#include <stdio.h>#include <limits.h>//标准C库文件,定义了各种类型的范围#include "board.h"#include "led.h原创 2022-01-06 19:13:27 · 2634 阅读 · 0 评论 -
32 freertos任务通知-代替消息队列(任务邮箱)
三十二、freertos任务通知-代替消息队列(任务邮箱)/****************************************************************************************************/#include <stdio.h>#include <limits.h>//标准C库文件,定义了各种类型的范围#include "board.h"#include "led.h"#include "key.h"原创 2022-01-06 19:11:35 · 1310 阅读 · 0 评论 -
31 freertos任务通知-API函数
三十一、freertos任务通知-API函数任务通知(任务消息邮箱 API 函数) 要使用任务通知,必须将 FreeRTOSConfig.h 中的宏定义 configUSE_TASK_NOTIFICATIONS 设置为 1,默认是为 1 的, 所以任务通知是默认使能的。使用如下 9 个函数可以实现 FreeRTOS 的任务消息邮箱:xTaskNotifyGive() 发送通知,无通知值vTaskNotifyGiveFromISR() 发送通知,无通知值ulTaskNotifyTake(原创 2022-01-06 19:09:43 · 857 阅读 · 0 评论 -
30 freertos软件定时器-通过ID处理
三十、freertos软件定时器-通过ID处理/****************************************************************************************************/#include <stdio.h>#include "board.h"#include "led.h"#include "key.h"#include "uart.h"//#include "tim_mrt.h"/*** Sy原创 2022-01-05 23:51:45 · 975 阅读 · 0 评论 -
29 freertos软件定时器-通过单独回调函数处理
二十九、 freertos软件定时器-通过单独回调函数处理/****************************************************************************************************/#include <stdio.h>#include "board.h"#include "led.h"#include "key.h"#include "uart.h"//#include "tim_mrt.h"/原创 2022-01-05 23:50:48 · 1686 阅读 · 0 评论 -
28 freertos软件定时器API
二十八、freertos软件定时器API软件定时器主要API:需要把 FreeRTOS/source/times.c 这个 C 文件添加到工程中。需要设置 FreeRTOSConfig.h中的宏定义 configUSE_TIMERS 设置为 1 。在头文件FreeRTOSConfig.h 中把宏 configSUPPORT_DYNAMIC_ALLOCATION 均定义为 1(默认定义为 1)。使用如下 20 个函数可以实现 FreeRTOS 的定时器组: xTimerCreate原创 2022-01-05 23:36:22 · 403 阅读 · 0 评论 -
27 freertos信号量-递归互斥信号量
二十七、freertos信号量-递归互斥信号量源码:/****************************************************************************************************/#include <stdio.h>#include "board.h"#include "led.h"#include "key.h"#include "uart.h"//#include "tim_mrt.h"/**原创 2022-01-05 22:16:30 · 247 阅读 · 0 评论 -
26 freertos信号量-互斥信号量优先级继承
二十六、 freertos信号量-互斥信号量优先级继承/** * **************************************************************************************************/#include <stdio.h>#include "board.h"#include "led.h"#include "key.h"#include "uart.h"//#include原创 2022-01-05 22:15:59 · 1206 阅读 · 0 评论 -
25 freertos信号量-计数信号量
二十五、LPC824_freertos信号量-计数信号量/****************************************************************************************************/#include <stdio.h>#include "board.h"#include "led.h"#include "key.h"#include "uart.h"//#include "tim_mrt.h"/*原创 2022-01-05 22:15:00 · 273 阅读 · 0 评论 -
24 freertos信号量-二值信号量-中断方式
二十四、freertos信号量-二值信号量-中断方式源码:main.c/**1. 学习FreeRTOS的二值信号量(中断方式)2. 使用二值信号量实现任务同步功能**/#include <stdio.h>#include "board.h"#include "led.h"#include "key.h"#include "uart.h"#include "tim_mrt.h"/*** System oscillator rate and clock rate o原创 2022-01-05 22:14:26 · 863 阅读 · 0 评论 -
23 freertos信号量-二值信号量
二十三、freertos信号量-二值信号量源码:/****************************************************************************************************/#include <stdio.h>#include "board.h"#include "led.h"#include "key.h"#include "uart.h"//#include "tim_mrt.h"/***原创 2022-01-05 22:13:54 · 142 阅读 · 0 评论 -
22 freertos信号量
二十二、LPC824_freertos信号量一、信号量1. 二值信号量:只有两种状态,有或无。2. 计数信号量:释放一个信号量时,信号量计数值加1。处理一个信号量时,信号量计数值减1。3. 互斥信号量:是特殊的二值信号量,只能被一个任务访问,其他任务因无法获取信号量而进入阻塞。4. 递归信号量:对于已经获取信号量的任务,可以重复获取信号量。使用如下 18 个函数可以实现 FreeRTOS 的信号量(含计数信号量,二值信号量和互斥信号):xSemaphoreCreateBinary()xS原创 2022-01-04 22:23:33 · 495 阅读 · 0 评论 -
21 freertos单消息队列-中断方式
二十一、 freertos单消息队列-中断方式源码:#include <stdio.h>#include "board.h"#include "led.h"#include "key.h"#include "uart.h"#include "tim_mrt.h"/*** System oscillator rate and clock rate on the CLKIN pin ****//**/const uint32_t OscRateIn = MAIN_OSC_XT原创 2022-01-04 22:20:02 · 391 阅读 · 0 评论 -
20 freertos单消息队列-覆盖
二十、LPC824_freertos单消息队列-覆盖源码:/**实验目的:* 1. 学习FreeRTOS的 <<单队列消息覆盖>>* 单消息队列是指消息队列的长度是1,覆盖方式是指消息队列中已经由数据了,还可以向消息队列中发数* 据,覆盖消息队列中已有的数据。* 2. 本实验使用的函数是xQueueOverwrite,此函数仅适用于消息队列长度为1的情况。* 否则将导致触发configASSERT(),从而进入假死状态原创 2022-01-04 22:18:45 · 1173 阅读 · 0 评论 -
19 freertos消息队列-中断方式
十九: freertos消息队列-中断方式源码:#include <stdio.h>#include "board.h"#include "led.h"#include "key.h"#include "uart.h"#include "tim_mrt.h"/*** System oscillator rate and clock rate on the CLKIN pin ****//**/const uint32_t OscRateIn = MAIN_OSC_XTAL原创 2022-01-04 22:17:10 · 2303 阅读 · 0 评论 -
18 freertos消息队列-任务通信
十八:18 freertos消息队列-任务通信试验源码:#include <stdio.h>#include "board.h"#include "led.h"#include "key.h"#include "uart.h"//#include "tim_mrt.h"/*** System oscillator rate and clock rate on the CLKIN pin ****//**/const uint32_t OscRateIn = MAIN_OS原创 2022-01-04 22:15:34 · 1712 阅读 · 0 评论 -
17 freertos消息队列-任务通信
十七: freertos消息队列-任务通信#include <stdio.h>#include "board.h"#include "led.h"#include "key.h"#include "uart.h"#include "tim_mrt.h"/*** System oscillator rate and clock rate on the CLKIN pin ****//**/const uint32_t OscRateIn = MAIN_OSC_XTAL_FRE原创 2022-01-04 22:12:38 · 232 阅读 · 0 评论 -
16 freertos消息队列API
十六、freertos消息队列消息队列函数API创建消息队列:FreeRTOSConfig.h 中把 configSUPPORT_DYNAMIC_ALLOCATION 定义为 1函 数 原 型: QueueHandle_t xQueueCreate( UBaseType_t uxQueueLength, UBaseType_t uxItemSize );功 能 : 用于创建一个新的队列。参 数 : --uxQueueLength 队列能够存储的最大消息单元数目,即原创 2022-01-04 21:49:15 · 436 阅读 · 0 评论 -
15 freertos标志事件-中断方式
十五 freertos标志事件-中断方式源码main.c#include <stdio.h>#include "board.h"#include "led.h"#include "key.h"#include "uart.h"#include "tim_mrt.h"/*** System oscillator rate and clock rate on the CLKIN pin ****//**/const uint32_t OscRateIn = MAIN_OS原创 2022-01-04 21:45:23 · 773 阅读 · 0 评论 -
14 freertos标志事件
十四 事件标志组 API 函数需要 #include "event_groups.h"需要把 FreeRTOS/source/event_groups.c 这个 C 文件添加到工程中一、使用如下 11 个函数可以实现 FreeRTOS 的事件标志组: xEventGroupCreate() xEventGroupCreateStatic() vEventGroupDelete() xEventGroupWaitBits() xEventGroupSetBits(原创 2022-01-04 21:44:12 · 279 阅读 · 0 评论 -
13 freertos系统节拍和时间管理
十三 FreeRTOS 的时间相关函数FreeRTOS 时间相关的函数主要有以下 4 个:vTaskDelay ()vTaskDelayUntil ()xTaskGetTickCount()xTaskGetTickCountFromISR()1 函数 vTaskDelay函数原型: void vTaskDelay( const TickType_t xTicksToDelay ); /* 延迟时间长度 >*/函数描述:函数 vTaskDelay 用于任务原创 2022-01-04 21:35:23 · 2375 阅读 · 0 评论 -
12 freertos任务-任务栈调度锁
十二 freertos任务-任务栈调度锁FreeRTOS 打开调度锁使用如下函数可以实现 FreeRTOS 的调度锁开启:vTaskSuspendAll ()函数原型: void vTaskSuspendAll( void );函数描述: 函数 vTaskSuspendAll 用于实现 FreeRTOS 调度锁开启。使用这个函数要注意以下问题: 1. 调度锁函数只是禁止了任务调度,并没有关闭任何中断。 2. 调度锁开启函数 vTaskSuspendAll 和调度锁关闭函数 xT原创 2022-01-02 17:50:43 · 468 阅读 · 0 评论 -
11 freertos任务栈大小测试打印任务状态
十一 freertos任务栈大小测试打印任务状态#include <stdio.h>#include "board.h"#include "led.h"#include "key.h"#include "uart.h"/*** System oscillator rate and clock rate on the CLKIN pin ****//**/const uint32_t OscRateIn = MAIN_OSC_XTAL_FREQ_HZ; /**//原创 2022-01-02 17:50:03 · 683 阅读 · 0 评论 -
10 freertos任务-任务栈大小测试
十 Freertos任务栈大小测试#include <stdio.h>#include "board.h"#include "led.h"#include "key.h"#include "uart.h"/*** System oscillator rate and clock rate on the CLKIN pin ****//**/const uint32_t OscRateIn = MAIN_OSC_XTAL_FREQ_HZ; /**//**/const原创 2022-01-02 17:49:18 · 564 阅读 · 0 评论 -
9 freertos任务-任务挂起和恢复
九 任务挂起和恢复#include <stdio.h>#include "board.h"#include "led.h"#include "key.h"#include "uart.h"/*** System oscillator rate and clock rate on the CLKIN pin ****//**/const uint32_t OscRateIn = MAIN_OSC_XTAL_FREQ_HZ; /**//**/const uint32_原创 2022-01-02 17:48:37 · 337 阅读 · 0 评论 -
8 freertos任务-任务创建串口打印
八 创建任务#include <stdio.h>#include "board.h"#include "led.h"#include "uart.h"/*** System oscillator rate and clock rate on the CLKIN pin ****//**/const uint32_t OscRateIn = MAIN_OSC_XTAL_FREQ_HZ; /**//**/const uint32_t ExtRateIn = EXT_CLO原创 2022-01-02 17:47:29 · 810 阅读 · 0 评论 -
7 freertos任务-多任务管理
七 FreeRtos多任务管理源码#include <stdio.h>#include "board.h"#include "led.h"#include "uart.h"/*** System oscillator rate and clock rate on the CLKIN pin ****//**/const uint32_t OscRateIn = MAIN_OSC_XTAL_FREQ_HZ; /**//**/const uint32_t ExtRate原创 2022-01-02 17:45:59 · 230 阅读 · 0 评论 -
6 freertos任务-创建多任务
六 FreeRtos创建多任务源码#include <stdio.h>#include "board.h"#include "led.h"#include "uart.h"/*** System oscillator rate and clock rate on the CLKIN pin ****//**/const uint32_t OscRateIn = MAIN_OSC_XTAL_FREQ_HZ; /**//**/const uint32_t ExtRate原创 2022-01-02 17:45:27 · 684 阅读 · 0 评论 -
5 freertos任务-创建单任务
五 FreeRtos创建单任务源码#include <stdio.h>#include "board.h"#include "led.h"#include "uart.h"/*** System oscillator rate and clock rate on the CLKIN pin ****//**/const uint32_t OscRateIn = MAIN_OSC_XTAL_FREQ_HZ; /**//**/const uint32_t ExtRateI原创 2022-01-02 17:43:44 · 222 阅读 · 0 评论