Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed_amf_controlsystem by
Diff: Misc/SerialOutputLogger.cpp
- Revision:
- 13:34f7f783ad24
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Misc/SerialOutputLogger.cpp Fri Feb 05 16:06:44 2016 +0000 @@ -0,0 +1,34 @@ +#include "Misc/SerialOutputLogger.h" + +SerialOutputLogger::SerialOutputLogger(Serial *serialPort, IMU_RegisterDataBuffer_t *imuRegisterDataBuffer, RadioDecoder_RegisterDataBuffer_t *radioDecoderRegisterDataBuffer) { + this->serialPort = serialPort; + this->imuRegisterDataBuffer = imuRegisterDataBuffer; + this->radioDecoderRegisterDataBuffer = radioDecoderRegisterDataBuffer; +} + +void SerialOutputLogger::writeRadioDecoderDataLog(bool csv) { + if (csv) { + for(uint8_t i=0; i<3; i++) { + serialPort->printf("%d, ", radioDecoderRegisterDataBuffer->channelValid[i]); + serialPort->printf("%d, ", radioDecoderRegisterDataBuffer->channelActiveTime[i]); + if (i == 2) { + serialPort->printf("%d\r\n", radioDecoderRegisterDataBuffer->channelPercent[i]); + } + } + } else { + for(uint8_t i=0; i<3; i++) { + serialPort->printf("RadioDecoder - Ch[%d] Valid: %d\r\n",i,radioDecoderRegisterDataBuffer->channelValid[i]); + serialPort->printf("RadioDecoder - Ch[%d] ActiveTime: %d\r\n",i,radioDecoderRegisterDataBuffer->channelActiveTime[i]); + serialPort->printf("RadioDecoder - Ch[%d] Percentage: %d\r\n\r\n",i,radioDecoderRegisterDataBuffer->channelPercent[i]); + } + } +} + + +void SerialOutputLogger::writeImuDataLog(bool csv) { + if (csv) { + + } else { + + } +} \ No newline at end of file