节点文献
基于指针数组的高精度UCOSII软件定时器改进方案
Improvement Scheme of High-precision UCOSII Software Timer Based on Pointer Array
【摘要】 stm32是目前应用最广泛的单片机之一,具有低功耗、高性能等优点。移植了UCOSII之后的单片机,相比于"裸机",具有操作灵活,实时性良好的优点。本文针对传统软件定时器维护方式,提出了一种基于运行态数组的软件定时器改进方案,和空闲定时器控制块链表指针相比,支持随机访问定时器数据;和定时器控制块数组相比,运行期绑定成员变量,更加灵活;和定时器轮相比,更加直观、方便操作和理解。缺点是内存浪费,对于固定的系统来说,当一个操作系统烧进下位机,不会产生复杂而且庞大的数据,这可能不会产生较大的影响。
【Abstract】 STM32 is one of the most widely used single chip microcontrollers at present. It has the advantages of low power consumption and high performance. After transplanting UCOSII MCU, compared with "bare machine", it has flexible operation and good real-time performance. Aiming at the traditional maintenance mode of software timer, this paper proposes an improved scheme of software timer based on running state array, which supports random access to timer data compared with free timer control block list pointer, and binds member variables more flexibly in running time than timer control block array. It is more intuitive and convenient to operate and understand compared with timer wheel. The disadvantage is memory waste. For a fixed system, when an operating system burns into the lower computer, it will not produce complex and huge data, This may not have a major impact.
【Key words】 UCOSII; software timers; stm32; iot; operating state; embedded system;
- 【文献出处】 电脑知识与技术 ,Computer Knowledge and Technology , 编辑部邮箱 ,2021年20期
- 【分类号】TP368.1
- 【下载频次】53