资源简介
RT-Thread 是一款主要由中国开源社区主导开发的开源实时操作系统。实时线程操作系统不仅仅是一个单一的实时操作系统内核,它也是一个完整的应用系统,包含了实时、嵌入式系统相关的各个组件:TCP/IP协议栈,文件系统,libc接口,图形用户界面等。性能优于一般的ucos-ii系统。

代码片段和文件信息
/*
* File : app.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://openlab.rt-thread.com/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-01-05 Bernard the first version
*/
/**
* @addtogroup STM32
*/
/*@{*/
#include
#include
char thread1_stack[0x120];
char thread2_stack[0x120];
struct rt_thread thread1;
struct rt_thread thread2;
void thread1_entry(void* parameter)
{
rt_uint32_t i = 0;
while (1)
{
rt_kprintf(“thread1 --> %d\n“ ++i);
rt_thread_delay(100);
}
}
/* UART received msg structure */
struct rx_msg
{
rt_device_t dev;
rt_size_t size;
};
/* message queue for Rx */
static rt_mq_t rx_mq;
static char uart_rx_buffer[64];
rt_err_t uart_input(rt_device_t dev rt_size_t size)
{
struct rx_msg msg;
msg.dev = dev;
msg.size = size;
/* send message to message queue */
rt_mq_send(rx_mq &msg sizeof(struct rx_msg));
return RT_EOK;
}
void thread2_entry(void* parameter)
{
struct rx_msg msg;
int count = 0;
rt_device_t device write_device;
rt_err_t result = RT_EOK;
device = rt_device_find(“uart3“);
if (device != RT_NULL)
{
rt_device_set_rx_indicate(device uart_input);
rt_device_open(device RT_DEVICE_OFLAG_RDWR);
}
/* set write device */
write_device = device;
device = rt_device_find(“uart2“);
if (device != RT_NULL)
{
rt_device_set_rx_indicate(device uart_input);
rt_device_open(device RT_DEVICE_OFLAG_RDWR);
}
while (1)
{
result = rt_mq_recv(rx_mq &msg sizeof(struct rx_msg) 50);
if (result == -RT_ETIMEOUT)
{
/* rx timeout */
rt_kprintf(“Thread2 count:%d\n“ ++count);
// rt_device_write(device 0 &test_str[0] sizeof(test_str) - 1);
}
if (result == RT_EOK)
{
rt_uint32_t rx_length;
rx_length = (sizeof(uart_rx_buffer) - 1) > msg.size ?
msg.size : sizeof(uart_rx_buffer) - 1;
rx_length = rt_device_read(msg.dev 0 &uart_rx_buffer[0] rx_length);
uart_rx_buffer[rx_length] = ‘\0‘;
rt_kprintf(“%s“ &uart_rx_buffer[0]);
rt_device_write(msg.dev 0 &uart_rx_buffer[0] rx_length);
/* write to device:uart3 too */
if (write_device != RT_NULL)
rt_device_write(write_device 0 &uart_rx_buffer[0] rx_length);
}
}
}
#ifdef RT_USING_DFS
/* dfs init */
#include
/* dfs filesystem:EFS filesystem init */
#include
/* dfs Filesystem APIs */
#include
#endif
/* thread phase init */
void rt_init_thread_entry(void *parameter)
{
/* Filesystem Initialization */
#ifdef RT_USING_DFS
{
/* init the device filesystem */
dfs_init();
/* init the efsl filesystam*/
efsl_init();
/* mount sd card fat partition 1 as root directory */
if (dfs_mount(“sd0“
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2009-05-05 10:29 rt-thread 0.3.0\
文件 721 2009-03-22 18:49 rt-thread 0.3.0\AUTHORS
目录 0 2009-05-05 10:29 rt-thread 0.3.0\bsp\
目录 0 2009-05-05 10:29 rt-thread 0.3.0\bsp\stm32f103vb\
文件 3869 2009-05-05 10:29 rt-thread 0.3.0\bsp\stm32f103vb\application.c
文件 6091 2009-04-29 20:14 rt-thread 0.3.0\bsp\stm32f103vb\board.c
文件 566 2009-04-12 14:19 rt-thread 0.3.0\bsp\stm32f103vb\board.h
文件 9403 2009-05-04 07:01 rt-thread 0.3.0\bsp\stm32f103vb\cortexm3_macro.s
目录 0 2009-05-05 10:29 rt-thread 0.3.0\bsp\stm32f103vb\library\
目录 0 2009-05-05 10:29 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\
文件 2225 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\cortexm3_macro.h
文件 18854 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_adc.h
文件 6911 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_bkp.h
文件 12279 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_can.h
文件 1881 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_crc.h
文件 9598 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_dac.h
文件 2865 2009-05-04 20:17 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_dbgmcu.h
文件 17974 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_dma.h
文件 5776 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_exti.h
文件 13996 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_flash.h
文件 18005 2009-05-04 20:17 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_fsmc.h
文件 14820 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_gpio.h
文件 15693 2009-05-04 20:17 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_i2c.h
文件 3414 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_iwdg.h
文件 3200 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_lib.h
文件 500262 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_map.h
文件 19198 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_nvic.h
文件 3865 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_pwr.h
文件 14783 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_rcc.h
文件 3619 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_rtc.h
文件 18326 2008-09-21 15:16 rt-thread 0.3.0\bsp\stm32f103vb\library\inc\stm32f10x_sdio.h
............此处省略166个文件信息
- 上一篇:franc2dl数值模拟
- 下一篇:播放黑屏的需要先安装视频驱动.txt
相关资源
- Micrium.RTOS.1.0.0.pack
- ISE_14.7_license.lic
- stm32f103c8t6 4 oled.rar
- mpu6050+hmc5883L.rar
- 嵌入式图形界面MiniGUI的示例程序9例
- ARM嵌入式项目实战
- uCOS编译环境建立 BC45 TASM
- stm32 用SPI 方式读写 SDHC
- 自动售货机的内部嵌入式系统
- 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上的
- 嵌入式操作系统的解析
- SAC型液压支架控制器检测平台的设计
- 一种用ARM7+UC/OS-II设计的信号采集系统
- 最简单的平衡小车
- 基于ARM的电子相册源码含动态库可运
- 嵌入式工程师周报 项目管理 甘特图
评论
共有 条评论