实时控制软件第二次作业

1、安装Qemu 。

疑问:”把路径添加到$PATH变量中“ 是什么意思?

2、编译,生成了hello_rtos.elf文件。

3、在Demo1目录下运行脚本文件。

4、GDB调试。

5、编写任务。

Sender_Task

`
void Sender_Task(void *pvParameters)
{

long sendnum = 0;  

while (1) 

{
   sendnum++;
xQueueSend( xQueue, &sendnum, 0 );

sendflag = sendflag + sendnum;

if ( sendnum == 10000 )
{
	sendnum = 1;
}
    vTaskDelay(2);

}
}

Receiver_Task

`void Receiver_Task(void *pvParameters)

{

long receivernum = 0;  

while (1) 

{

for (;xQueuereceive ( xQueue,&receivernum,0/portTICK_RATE_MS ) == pdTRUE; )

{

receiverflag = receiverflag + receivernum;

}        

vTaskDelay( 1000 );

}

}`

Monitor_Task

`
void Monitor_Task(void *pvParameters)

{

while (1) 

{

    if ( receiverflag == sendflag )

{

     Green_LED_On();

     vTaskDelay ( 1000 );

     Green_LED_Off();	

}

else

{

    Red_LED_On();

    vTaskDelay(1000);

    Red_LED_Off();

}

    vTaskDelay(10000);

}

}
`

原文地址:https://www.cnblogs.com/zlll/p/7587313.html