木子剑
生命不熄,学习不止!
摘要: 比较简单,直接看源码片段: // Mutexes struct TN_Mutex mutex_1; // Sem struct TN_Sem sem_1; //-- 创建MUTEX tn_mutex_create( &mutex_1, TN_MUTEX_PROT_INHERIT, // Mutex使 阅读全文
posted @ 2022-04-04 21:29 木子剑 阅读(194) 评论(0) 推荐(0) 编辑
摘要: //-- 消费者信息队列中的项目数量 #define CONS_QUE_BUF_SIZE 50 //-- 内存池及长度定义 struct TN_FMem cons_fmem; TN_FMEM_BUF_DEF(cons_fmem_buf, uint32_t, CONS_QUE_BUF_SIZE); / 阅读全文
posted @ 2022-04-04 21:26 木子剑 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 一如即往的简单,看下面代码: //-- timer static struct TN_Timer my_timer = {}; // 最好是清0 tn_timer_create(&my_timer, my_timer_callback, TN_NULL); // 创建定时器 tn_timer_sta 阅读全文
posted @ 2022-04-04 21:11 木子剑 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 一不做,二不休,下面是事件的测试代码: // //-- main.c // #include <stdio.h> #include <stdlib.h> #include "stm32f10x.h" #include "tn.h" //-- 空闲任务栈的大小,以字为单位 17+32个字,即49个字 阅读全文
posted @ 2022-04-04 21:06 木子剑 阅读(39) 评论(0) 推荐(0) 编辑