多线程
#include "rtos.h"//加的库
Thread thread1;//外部声明
void servo1_thread()
{
while (true)
{
Thread::signal_wait(0x001);
...
}
}
thread1.start(servo1_thread);
thread1.signal_set(0x001);
thread1.terminate( );
//read_thread
void read_thread()
{
d = pc.getc();
}
void servo8_thread()
{
thread9.terminate( );
if(Ein == 1)
{
pc.printf("s");
wait(0.5);
}
thread9.start(read_thread);
}
透过泪水看到希望