资源简介
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 源码
相关资源
- Micrium.RTOS.1.0.0.pack
- ISE_14.7_license.lic
- stm32f103c8t6 4 oled.rar
- mpu6050+hmc5883L.rar
- 嵌入式图形界面MiniGUI的示例程序9例
- 编写简单的RMI程序 多线程web 服务器
- ARM嵌入式项目实战
- 多线程生产者消费者模式
- uCOS编译环境建立 BC45 TASM
- stm32 用SPI 方式读写 SDHC
- 多线程实例:桌面智能弹球小游戏
- 自动售货机的内部嵌入式系统
- WPF多线程演示
- 51单片机中使用ucos ii的优缺点转
- 51单片机中使用ucos ii的优缺点
- 嵌入式实时操作系统ucos-II 第二版 源
- 基于串口设备的嵌入式Web服务器系统
- 基于LW IP的嵌入式串口服务器的设计与
- 一种嵌入式串口共享服务器的设计
- 21天学会嵌入式开发STM32.zip
- 易语言:多线程传多变量的最稳定方
- 嵌入式智能平台为城市一卡通打造智
- 研祥“EVOC”嵌入式智能平台在
- ARM7TDMI-S在嵌入式系统中的Bootloader代码
- LPC2000系列微控制器应对嵌入式需求
- 嵌入式实时操作系统μC/OS-II与eCos的
- 基于STM32的嵌入式双目图像采集系统设
- 嵌入式实时操作系统在DATU中的应用
- 嵌入式实时操作系统μC/OS-II下通用驱
- 嵌入式实时操作系统μC/OS-II在ARM上的
评论
共有 条评论