zephyr/samples/basic/threads
Kumar Gala 1f68831197 samples: Use DT_ prefix define for DT filters
Update the filters that are extracting info from DT to use a define that
has a DT_ prefix so its clear that its coming from DT_.  Also this lets
us remove any non-DT prefixed defines in the conf db.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-14 10:45:25 -06:00
..
src samples: Remove board.h include 2018-11-01 13:15:18 +01:00
CMakeLists.txt cmake: increase minimal required version to 3.13.1 2019-01-03 11:51:29 -05:00
prj.conf samples: threads: Rewrite misleading sample 2018-01-08 14:25:11 -05:00
README.rst samples: threads: Rewrite misleading sample 2018-01-08 14:25:11 -05:00
sample.yaml samples: Use DT_ prefix define for DT filters 2019-02-14 10:45:25 -06:00

.. _96b_carbon_multi_thread_blinky:

Basic Thread Example
####################

Overview
********

This example demonstrates spawning of multiple threads using K_THREAD_DEFINE.

The example works by spawning three threads. The first two threads control a
separate LED. Both of these LEDs (USR1 and USR2) have their individual loop
control and timing logic defined by separate functions.

After either thread toggles its LED, it also pushes information into a
FIFO identifying which thread toggled its LED and how many times it
was done.

The third thread, ``uart_out()``, uses printk (over the UART) to
display the information that comes through the FIFO.

- blink1() controls the USR1 LED that has a 100ms sleep cycle
- blink2() controls the USR2 LED that has a 1000ms sleep cycle

Each thread is then defined at compile time using K_THREAD_DEFINE.

Building
********

.. zephyr-app-commands::
   :zephyr-app: samples/basic/threads
   :board: 96b_carbon
   :goals: build flash
   :compact: