这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » MCU » 有朋友做过RTX51 full 吗?

共2条 1/1 1 跳转至

有朋友做过RTX51 full 吗?

菜鸟
2002-11-26 21:53:08     打赏
有朋友做过RTX51 full 吗?我编译通过了,但在目标机不能运行。 目标机是P89C668菲利普的。 大家给点参考。



关键词: 朋友     做过     RTX51    

菜鸟
2002-11-27 21:09:00     打赏
2楼
哦,我调好了,不麻烦大家了。 原来P89C668 default(复位)内部8KRAM是无效的, 而RTX51 full 要1K左右的RAM,所以就启动不了啦。 要先enable内部RAM。 我把例子放在这,给大家参考: #pragma large #include /* RTX-51 Definitions */ #include #define PRODUCER_NBR 0 /* Tasknumber for the producer task */ #define CONSUMER_NBR 1 /* Tasknumber for the consumer task */ sbit led=P1^1; sbit led2=P1^0; sbit ledb=P1^2; void producer_task (void) _task_ PRODUCER_NBR { unsigned int send_mes; led=1; os_create_task (CONSUMER_NBR); /* Create the Consumer-Task */ send_mes = 1; for (;;) { /* endless loop */ /* send the actual value of 'send_mes' to the mailbox 0 */ /* if the mailbox is full, wait until there is place for the message */ os_send_message (0, send_mes, 0xff); send_mes++; os_wait (K_TMO, 300, 0); ledb=!ledb; } } void consumer_task (void) _task_ CONSUMER_NBR _priority_ 1 { unsigned int rec_mes; for (;;) { /* read from the mailbox 0 to the variable 'rec_mes' */ /* wait for a message, if the mailbox is empty */ os_wait (K_MBX+0, 0xff, &rec_mes); led2=!led2; /* ... perform some calculations with 'rec_mes' */ } } void main (void) { /* Init the system and start the Producer-Task */ AUXR=AUXR&0xfd; led2=1; os_start_system (PRODUCER_NBR); }

共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]