资源简介
ThreadX是优秀的硬实时操作系统(RTOS),适用于深嵌入式应用中,具有规模小、实时性强、可靠性高、无产品版权费、易于使用等特点,并且支持大量的处理器和SoC,包括ARM、PowerPC、SH 4、MIPS、ADI DSP、TI DPS、Nios II等,因此广泛应用于消费电子、汽车电子、工业自动化、网络解决方案、军事与航空航天等领域中。
代码片段和文件信息
/* 02_sample_system.c
Create two threads one byte pool and one mutex.
The threads cooperate with each other via the mutex. */
/****************************************************/
/* Declarations Definitions and Prototypes */
/****************************************************/
#include “tx_api.h“
#include
#define DEMO_STACK_SIZE 1024
#define DEMO_BYTE_POOL_SIZE 9120
/* Define the ThreadX object control blocks... */
TX_THREAD speedy_thread;
TX_THREAD slow_thread;
TX_MUTEX my_mutex;
TX_BYTE_POOL my_byte_pool;
/* Define thread prototypes. */
void speedy_thread_entry(ULONG thread_input);
void slow_thread_entry(ULONG thread_input);
/****************************************************/
/* Main Entry Point */
/****************************************************/
/* Define main entry point. */
int main()
{
/* Enter the ThreadX kernel. */
tx_kernel_enter();
}
/****************************************************/
/* Application Definitions */
/****************************************************/
/* Define what the initial system looks like. */
void tx_application_define(void *first_unused_memory)
{
CHAR *pool_pointer;
/* Create a byte memory pool from which to allocate
the thread stacks. */
tx_byte_pool_create(&my_byte_pool “my_byte_pool“
first_unused_memory
DEMO_BYTE_POOL_SIZE);
/* Put system definition stuff in here e.g. thread
creates and other assorted create information. */
/* Allocate the stack for the speedy thread. */
tx_byte_allocate(&my_byte_pool (VOID **) &pool_pointer
DEMO_STACK_SIZE TX_NO_WAIT);
/* Create the speedy_thread. */
tx_thread_create(&speedy_thread “speedy_thread“
speedy_thread_entry 0
pool_pointer DEMO_STACK_SIZE 5 5
TX_NO_TIME_SLICE TX_AUTO_START);
/* Allocate the stack for the slow thread. */
tx_byte_allocate(&my_byte_pool (VOID **) &pool_pointer
DEMO_STACK_SIZE TX_NO_WAIT);
/* Create the slow thread */
tx_thread_create(&slow_thread “slow_thread“
slow_thread_entry 1 pool_pointer
DEMO_STACK_SIZE 15 15
TX_NO_TIME_SLICE TX_AUTO_START);
/* Create the mutex used by both threads */
tx_mutex_create(&my_mutex “my_mutex“ TX_NO_INHERIT);
}
/****************************************************/
/* Function Definitions */
/****************************************************/
/* Entry function definition of the “speedy thread“
it has a higher priority than the “sl
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4984 2004-08-02 07:12 ThreadX_Win32_demo\02_sample_system.c
文件 4714 2004-08-02 07:13 ThreadX_Win32_demo\07_sample_system.c
文件 6655 2004-08-02 07:14 ThreadX_Win32_demo\09_sample_system.c
文件 6950 2004-08-02 07:14 ThreadX_Win32_demo\10a_sample_system.c
文件 6462 2004-08-02 07:15 ThreadX_Win32_demo\10b_sample_system.c
文件 7562 2004-08-02 07:16 ThreadX_Win32_demo\11_sample_system.c
文件 6977 2004-08-02 07:26 ThreadX_Win32_demo\12_sample_system.c
文件 15814 2004-08-02 07:17 ThreadX_Win32_demo\14_sample_system.c
文件 14149 2004-08-02 07:30 ThreadX_Win32_demo\demo\Debug\02_sample_system.obj
文件 13959 2004-08-02 07:30 ThreadX_Win32_demo\demo\Debug\07_sample_system.obj
文件 17132 2004-08-02 07:29 ThreadX_Win32_demo\demo\Debug\09_sample_system.obj
文件 17167 2004-08-02 07:28 ThreadX_Win32_demo\demo\Debug\10a_sample_system.obj
文件 17010 2004-08-02 07:27 ThreadX_Win32_demo\demo\Debug\10b_sample_system.obj
文件 17889 2004-08-02 07:26 ThreadX_Win32_demo\demo\Debug\11_sample_system.obj
文件 17787 2004-08-02 07:24 ThreadX_Win32_demo\demo\Debug\12_sample_system.obj
文件 29376 2004-08-02 07:22 ThreadX_Win32_demo\demo\Debug\14_sample_system.obj
文件 29224 2004-08-02 06:33 ThreadX_Win32_demo\demo\Debug\case_study.obj
文件 176186 2004-08-02 07:30 ThreadX_Win32_demo\demo\Debug\demo.exe
文件 210804 2004-08-02 07:30 ThreadX_Win32_demo\demo\Debug\demo.ilk
文件 23989 2004-08-02 06:32 ThreadX_Win32_demo\demo\Debug\demo.obj
文件 2828448 2004-08-02 07:24 ThreadX_Win32_demo\demo\Debug\demo.pch
文件 771072 2004-08-02 07:30 ThreadX_Win32_demo\demo\Debug\demo.pdb
文件 14065 2004-08-02 06:34 ThreadX_Win32_demo\demo\Debug\project1.obj
文件 58368 2008-12-08 21:18 ThreadX_Win32_demo\demo\Debug\vc60.idb
文件 69632 2004-08-02 07:30 ThreadX_Win32_demo\demo\Debug\vc60.pdb
文件 4461 2004-08-02 07:30 ThreadX_Win32_demo\demo\demo.dsp
文件 863 2004-08-02 07:30 ThreadX_Win32_demo\demo\demo.plg
文件 12121 2004-07-28 06:36 ThreadX_Win32_demo\demo.c
文件 1261 2004-08-03 12:34 ThreadX_Win32_demo\readme.txt
文件 536 2004-07-27 04:08 ThreadX_Win32_demo\ThreadX.dsw
............此处省略12个文件信息
- 上一篇:几种加减速算法
- 下一篇:bouncycastle 源码
相关资源
- sjl06加密机模拟程序
- 嵌入式电子相册设计实现了bmp格式图
- 蓝桥杯CT117E嵌入式竞赛板省赛第十届
- 蓝桥杯CT117E嵌入式竞赛板省赛第五届
- 多线程并发同步爸爸妈妈苹果橘子问
- 嵌入式实时操作系统μCOS-II邵贝贝.p
- 毕设题目:嵌入式数字示波器设计
- 单片机多任务实现
- linux多人聊天室管理系统
- 任哲的《嵌入式实时操作系统ΜcOS-Ⅱ
- lcd_ok.zip
- 海康威视笔试题08、09、12、13年 dsp,
- 国嵌嵌入式linux培训全套实验代码
- 任哲嵌入式实时操作系统uCos-ii原理及
- 分布式嵌入式实时操作系统QNX
- 关于嵌入式系统的30篇论文
- 操作系统实验多线程读者写者优先问
- Win32多线程程序设计.侯捷.超清完美版
- 计算机组组成原理课程设计,设计一
- GBT28172-2011嵌入式软件质量保证要求
- 优秀毕业设计带论文和答辩ppt:智能
- STM32F10x中文教程及参考手册
- 时间触发嵌入式系统设计模式源码
- 任哲《嵌入式实时操作系统uCOS-II原理
- 一个月学会嵌入式开发STM32共23个PPT
- 安卓app之间的socket通信,支持多线程
- 电子科技大学微处理器系统与嵌入式
- 嵌入式stm32开发——基于红外的万能遥
- 一个嵌入式工程师的stm32开发日记
-
嵌入式系统设计em
bedded System Design
评论
共有 条评论