vcdMaker demo signal library. See http://vcdmaker.org for details. vcdMaker demos: For Freescale FRDM-KL46Z: https://developer.mbed.org/users/ketjow/code/vcdMaker_Demo/ For ST Disco L476: https://developer.mbed.org/users/ketjow/code/vcdMaker_Demo_DISCO_L476/
Dependents: vcdMaker_Demo_DISCO_L476 vcdMaker_Demo
Revision 1:5be5e7e966cd, committed 2016-11-18
- Comitter:
- ketjow
- Date:
- Fri Nov 18 12:44:08 2016 +0000
- Parent:
- 0:abd95c8ed6c1
- Commit message:
- Added events.
Changed in this revision
signal.cpp | Show annotated file Show diff for this revision Revisions of this file |
signal.hpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r abd95c8ed6c1 -r 5be5e7e966cd signal.cpp --- a/signal.cpp Fri May 27 10:30:00 2016 +0000 +++ b/signal.cpp Fri Nov 18 12:44:08 2016 +0000 @@ -56,6 +56,21 @@ m_pLogger->Log(&buffer[0]); } +void Signal::PrintEvent(string& comment, int32_t time_ref) +{ + char buffer[100]; + int32_t log_time = time_ref; + + if (0 == log_time) + { + log_time = m_pLogger->GetTime(); + time_ref = log_time; + } + + snprintf(&buffer[0], 100, "#%u %s e %s",(uint32_t)log_time, m_Name.c_str(), comment.c_str()); + m_pLogger->Log(&buffer[0]); +} + void Signal::TickFilter() { if (FILTER_VALUE == m_Filter)
diff -r abd95c8ed6c1 -r 5be5e7e966cd signal.hpp --- a/signal.hpp Fri May 27 10:30:00 2016 +0000 +++ b/signal.hpp Fri Nov 18 12:44:08 2016 +0000 @@ -34,6 +34,7 @@ Signal(const string& name, uint32_t size, Logger& logger); void PrintVector(uint32_t value, string& suffix, string& comment, int32_t& time_ref); void PrintReal(float value, string& suffix, string& comment, int32_t& time_ref); + void PrintEvent(string& comment, int32_t time_ref); void TickFilter(); void ResetFilter(); uint32_t CheckFilter();