This is the vcdMaker demo project. See http://vcdmaker.org for details. vcdMaker is supposed to help engineers to debug their applications and systems. It transforms text log files into the VCD format which can be easily displayed as a waveform.
Dependencies: mbed vcdLogger vcdSignal
Diff: Signals/button.cpp
- Revision:
- 1:446154224f92
- Parent:
- 0:9a59cffaafad
- Child:
- 2:a13cde5c679c
diff -r 9a59cffaafad -r 446154224f92 Signals/button.cpp --- a/Signals/button.cpp Fri Feb 12 21:38:04 2016 +0000 +++ b/Signals/button.cpp Sat Feb 20 20:48:44 2016 +0000 @@ -1,21 +1,42 @@ - #include "button.hpp" +/*! + @file button.cpp + + The implementation of the button signal class. + + @par Full Description + The implementation of the button signal class. + + @if REVISION_HISTORY_INCLUDED + @par Edit History + @li [0] wojciech.rynczuk@wp.pl 20-JAN-2015 Initial file revision. + @endif + + @ingroup Signal + + @par Copyright (c) MMXV Wojciech Rynczuk + + Distributed under MIT License + +*/ + +#include "button.hpp" - Button::Button(const string& name, const PinName pin, Logger& logger) : DigitalIn(pin), Signal(name,1,logger) - { - } +Button::Button(const string& name, const PinName pin, Logger& logger) : DigitalIn(pin), Signal(name,1,logger) +{ +} - void Button::PrintState() +void Button::PrintState() +{ + string suffix(""); + int32_t time_ref = 0; + if (read()) { - string suffix(""); - int32_t time_ref = 0; - if (read()) - { - string msg("Key released"); - PrintVector(0, suffix, msg, time_ref); - } - else - { - string msg("Key pressed"); - PrintVector(1, suffix, msg, time_ref); - } - } \ No newline at end of file + string msg("Key released"); + PrintVector(0, suffix, msg, time_ref); + } + else + { + string msg("Key pressed"); + PrintVector(1, suffix, msg, time_ref); + } +} \ No newline at end of file