This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] MSP430FR2433:面向 MSP430的[公告]线程

Guru**** 1457880 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1355269/msp430fr2433-announcement-threads-for-msp430

器件型号:MSP430FR2433

嗨、大家好、只想共享一个库、使  MSP430芯片可以轻松使用线程:

https://github.com/toasterllc/Scheduler

它是单个接头、因此易于集成。

下面是一个两线程示例:第一个 线程 每秒切换一次 LED、第二个线程等待按下一个按钮、然后快速切换第二个 LED。

谢谢、
大卫

void TaskLED ::运行(){
用于(;;){
P1OUT ^= BIT0;
日程安排器::Sleep (日程安排器::Ms<1000>);
}
}

void TaskButton ::运行(){
用于(;;){
日程安排器::WAIT([]{ return _pressed;});
for (int i=0;i<100;i++){
P1OUT ^= BIT1;
日程安排器::Sleep (日程安排器::Ms<20>);
}
按下= false;
}
}