@@ -10,6 +10,8 @@ In order to spawn a new thread, the `create()` function is needed and it takes t
...
@@ -10,6 +10,8 @@ In order to spawn a new thread, the `create()` function is needed and it takes t
*`argv`: a `void*` pointer that is passed as a parameter to the entry point function.
*`argv`: a `void*` pointer that is passed as a parameter to the entry point function.
*`options`: thread options, such ad `Thread::JOINABLE`. By default native threads are not joinable, which means they will never end. The `join()` method allows to wait for a thread to end its execution.
*`options`: thread options, such ad `Thread::JOINABLE`. By default native threads are not joinable, which means they will never end. The `join()` method allows to wait for a thread to end its execution.
As a side note consider that, when writing flight software, we usually don't implement threads directly as shown in this page, but we make use of the [Active object](Active-Object) class.
#### Example: LED Blink
#### Example: LED Blink
In this example two threads make two LEDs blink. The first one changes state two times every second while the second one is set "high" only when the on-board user button is pressed (the discovery's blue button).
In this example two threads make two LEDs blink. The first one changes state two times every second while the second one is set "high" only when the on-board user button is pressed (the discovery's blue button).