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: [Announcement] Threads for MSP430

Part Number: MSP430FR2433

Hey all, just wanted to share a library that makes it easy to use threads with MSP430 chips:

https://github.com/toasterllc/Scheduler

It's a single header so it's easy to integrate.

Below is a two-thread example: the first thread toggles an LED every second, the second thread waits for a button to be pressed and then rapidly toggles a second LED.

Cheers,
David

void TaskLED::Run() {
    for (;;) {
        P1OUT ^= BIT0;
        Scheduler::Sleep(Scheduler::Ms<1000>);
    }
}

void TaskButton::Run() {
    for (;;) {
        Scheduler::Wait([] { return _Pressed; });
        for (int i=0; i<100; i++) {
            P1OUT ^= BIT1;
            Scheduler::Sleep(Scheduler::Ms<20>);
        }
        _Pressed = false;
    }
}

**Attention** This is a public forum