![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
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. Use the mbed serial logger at 115200 baud rate.
Dependencies: BSP_DISCO_L476VG COMPASS_DISCO_L476VG mbed vcdLogger vcdSignal
Diff: Logger/serialLogger.cpp
- Revision:
- 0:936379a8793e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Logger/serialLogger.cpp Sat Mar 05 21:16:10 2016 +0000 @@ -0,0 +1,62 @@ +/*! + @file serialLogger.cpp + + The implementation of the serial logger class. + + @par Full Description + The implementation of the serial logger class. + + @if REVISION_HISTORY_INCLUDED + @par Edit History + @li [0] wojciech.rynczuk@wp.pl 20-JAN-2015 Initial file revision. + @li [1] wojciech.rynczuk@wp.pl 04-MAR-2016 DISCO L476 port. + @endif + + @ingroup Logger + + The MIT License (MIT) + Copyright (c) 2016 Wojciech Rynczuk + +*/ + +#include "serialLogger.hpp" +#include "mbed.h" + +SerialLogger::SerialLogger(uint32_t n_Lines, uint32_t n_Characters) : Logger(n_Lines,n_Characters) +{ + serialOut = new Serial(USBTX, USBRX); + alarm = new DigitalOut(LED1); + rec_indicator = new DigitalOut(LED2); + + serialOut->baud(115200); + *alarm = 0; + *rec_indicator = 0; +} + +SerialLogger::~SerialLogger() +{ + delete alarm; + delete serialOut; +} + +void SerialLogger::Printf(const char* line) +{ + serialOut->printf("%s\n\r", line); +} + +void SerialLogger::AlarmFull() +{ + *alarm = !*alarm; +} + +uint32_t SerialLogger::StartAction() +{ + *rec_indicator = 1; + return 0; +} + +uint32_t SerialLogger::StopAction() +{ + *rec_indicator = 0; + return 0; +} \ No newline at end of file