共2条
1/1 1 跳转至页
有朋友做过RTX51 full 吗?
哦,我调好了,不麻烦大家了。
原来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 跳转至页
回复
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |