a

Dependencies:   mbed mbed-rtos

Committer:
alexpirciu
Date:
Thu Mar 28 07:44:42 2019 +0000
Revision:
1:ceee5a608e7c
assa

Who changed what in which revision?

UserRevisionLine numberNew contents of line
alexpirciu 1:ceee5a608e7c 1 /**
alexpirciu 1:ceee5a608e7c 2 ******************************************************************************
alexpirciu 1:ceee5a608e7c 3 * @file Blinker.cpp
alexpirciu 1:ceee5a608e7c 4 * @author RBRO/PJ-IU
alexpirciu 1:ceee5a608e7c 5 * @version V1.0.0
alexpirciu 1:ceee5a608e7c 6 * @date day-month-year
alexpirciu 1:ceee5a608e7c 7 * @brief This file contains the class implementation for the blinker
alexpirciu 1:ceee5a608e7c 8 * functionality.
alexpirciu 1:ceee5a608e7c 9 ******************************************************************************
alexpirciu 1:ceee5a608e7c 10 */
alexpirciu 1:ceee5a608e7c 11
alexpirciu 1:ceee5a608e7c 12 #include <Examples/blinker.hpp>
alexpirciu 1:ceee5a608e7c 13
alexpirciu 1:ceee5a608e7c 14
alexpirciu 1:ceee5a608e7c 15 namespace examples{
alexpirciu 1:ceee5a608e7c 16 /** \brief Class constructor
alexpirciu 1:ceee5a608e7c 17 *
alexpirciu 1:ceee5a608e7c 18 * Constructor method
alexpirciu 1:ceee5a608e7c 19 *
alexpirciu 1:ceee5a608e7c 20 * \param f_period LED toggling reading period
alexpirciu 1:ceee5a608e7c 21 * \param f_led Digital output line to which the LED is connected
alexpirciu 1:ceee5a608e7c 22 */
alexpirciu 1:ceee5a608e7c 23 CBlinker::CBlinker(uint32_t f_period, DigitalOut f_led)
alexpirciu 1:ceee5a608e7c 24 : task::CTask(f_period)
alexpirciu 1:ceee5a608e7c 25 , m_led(f_led)
alexpirciu 1:ceee5a608e7c 26 {
alexpirciu 1:ceee5a608e7c 27 m_led = 1;
alexpirciu 1:ceee5a608e7c 28 }
alexpirciu 1:ceee5a608e7c 29
alexpirciu 1:ceee5a608e7c 30 /** \brief Method called each f_period
alexpirciu 1:ceee5a608e7c 31 *
alexpirciu 1:ceee5a608e7c 32 */
alexpirciu 1:ceee5a608e7c 33 void CBlinker::_run()
alexpirciu 1:ceee5a608e7c 34 {
alexpirciu 1:ceee5a608e7c 35 m_led = !m_led;
alexpirciu 1:ceee5a608e7c 36 }
alexpirciu 1:ceee5a608e7c 37
alexpirciu 1:ceee5a608e7c 38 }; // namespace examples