zephyr/samples/basic/threads
Kumar Gala 6b38f57225 Add missing license and copyright headers
The following files didn't have any copyright or license headers on them
when they got contributed.  So add the SPDX Apache license and
appropriate copyright info:

boards/arm/stm32l476g_disco/pinmux.c
samples/basic/threads/src/main.c
tests/net/socket/tcp/src/main.c

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-12-05 08:21:05 -06:00
..
src Add missing license and copyright headers 2017-12-05 08:21:05 -06:00
CMakeLists.txt Introduce cmake-based rewrite of KBuild 2017-11-08 20:00:22 -05:00
prj.conf
README.rst samples: basic: Convert doc to CMake 2017-11-12 21:13:23 -05:00
sample.yaml

.. _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.

The third thread, uart_out(), sends out messages on the UART using printk().

- 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: