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.
Misc/SerialOutputLogger.cpp
- Committer:
- mborchers
- Date:
- 2016-02-05
- Revision:
- 13:34f7f783ad24
File content as of revision 13:34f7f783ad24:
#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 { } }