ok

Dependencies:   mbed-rtos mbed

Fork of rtos_signals by mbed official

main.cpp

Committer:
emilmont
Date:
2012-07-13
Revision:
1:6a8fcc666593
Parent:
0:19f3d184e2ea
Child:
4:84ab1b5e8265

File content as of revision 1:6a8fcc666593:

#include "mbed.h"
#include "rtos.h"

DigitalOut led(LED1);

void led_thread(void const *argument) {
    while (true) {
        // Signal flags that are reported as event are automatically cleared.
        Thread::signal_wait(0x1);
        led = !led;
    }
}

int main (void) {
    Thread thread(led_thread);
    
    while (true) {
        Thread::wait(1000);
        thread.signal_set(0x1);
    }
}