zephyr/samples/drivers/counter/alarm
Anas Nashif 9ab2a56751 cleanup: include/: move misc/printk.h to sys/printk.h
move misc/printk.h to sys/printk.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
..
src cleanup: include/: move misc/printk.h to sys/printk.h 2019-06-27 22:55:49 -04:00
CMakeLists.txt license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
Kconfig samples: drivers: counter: alarm: Fix compilation for nrf boards 2019-06-14 05:44:39 -04:00
README.rst
prj.conf
sample.yaml samples: drivers: counter: alarm: add nordic boards to the whitelist 2019-06-25 15:00:55 +02:00

README.rst

.. _alarm_sample:

Counter Alarm Sample
#####################

Overview
********
This sample provides an example of alarm application using counter API.
It sets an alarm with an initial delay of 2 seconds. At each alarm
expiry, a new alarm is configured with a delay multiplied by 2.

Requirements
************

This sample requires the support of a timer IP compatible with alarm setting.

References
**********

- :ref:`disco_l475_iot1_board`

Building and Running
********************

 .. zephyr-app-commands::
    :zephyr-app: samples/counter/alarm
    :host-os: unix
    :board: disco_l475_iot1
    :goals: run
    :compact:

Sample Output
=============

 .. code-block:: console

    Counter alarm sample

    Set alarm in 2 sec
    !!! Alarm !!!
    Now: 2
    Set alarm in 4 sec
    !!! Alarm !!!
    Now: 6
    Set alarm in 8 sec
    !!! Alarm !!!
    Now: 14
    Set alarm in 16 sec
    !!! Alarm !!!
    Now: 30

    <repeats endlessly>