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
Misc/SerialOutputLogger.cpp@13:34f7f783ad24, 2016-02-05 (annotated)
- Committer:
- mborchers
- Date:
- Fri Feb 05 16:06:44 2016 +0000
- Revision:
- 13:34f7f783ad24
L?ngsregelung ausgelagert
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mborchers | 13:34f7f783ad24 | 1 | #include "Misc/SerialOutputLogger.h" |
mborchers | 13:34f7f783ad24 | 2 | |
mborchers | 13:34f7f783ad24 | 3 | SerialOutputLogger::SerialOutputLogger(Serial *serialPort, IMU_RegisterDataBuffer_t *imuRegisterDataBuffer, RadioDecoder_RegisterDataBuffer_t *radioDecoderRegisterDataBuffer) { |
mborchers | 13:34f7f783ad24 | 4 | this->serialPort = serialPort; |
mborchers | 13:34f7f783ad24 | 5 | this->imuRegisterDataBuffer = imuRegisterDataBuffer; |
mborchers | 13:34f7f783ad24 | 6 | this->radioDecoderRegisterDataBuffer = radioDecoderRegisterDataBuffer; |
mborchers | 13:34f7f783ad24 | 7 | } |
mborchers | 13:34f7f783ad24 | 8 | |
mborchers | 13:34f7f783ad24 | 9 | void SerialOutputLogger::writeRadioDecoderDataLog(bool csv) { |
mborchers | 13:34f7f783ad24 | 10 | if (csv) { |
mborchers | 13:34f7f783ad24 | 11 | for(uint8_t i=0; i<3; i++) { |
mborchers | 13:34f7f783ad24 | 12 | serialPort->printf("%d, ", radioDecoderRegisterDataBuffer->channelValid[i]); |
mborchers | 13:34f7f783ad24 | 13 | serialPort->printf("%d, ", radioDecoderRegisterDataBuffer->channelActiveTime[i]); |
mborchers | 13:34f7f783ad24 | 14 | if (i == 2) { |
mborchers | 13:34f7f783ad24 | 15 | serialPort->printf("%d\r\n", radioDecoderRegisterDataBuffer->channelPercent[i]); |
mborchers | 13:34f7f783ad24 | 16 | } |
mborchers | 13:34f7f783ad24 | 17 | } |
mborchers | 13:34f7f783ad24 | 18 | } else { |
mborchers | 13:34f7f783ad24 | 19 | for(uint8_t i=0; i<3; i++) { |
mborchers | 13:34f7f783ad24 | 20 | serialPort->printf("RadioDecoder - Ch[%d] Valid: %d\r\n",i,radioDecoderRegisterDataBuffer->channelValid[i]); |
mborchers | 13:34f7f783ad24 | 21 | serialPort->printf("RadioDecoder - Ch[%d] ActiveTime: %d\r\n",i,radioDecoderRegisterDataBuffer->channelActiveTime[i]); |
mborchers | 13:34f7f783ad24 | 22 | serialPort->printf("RadioDecoder - Ch[%d] Percentage: %d\r\n\r\n",i,radioDecoderRegisterDataBuffer->channelPercent[i]); |
mborchers | 13:34f7f783ad24 | 23 | } |
mborchers | 13:34f7f783ad24 | 24 | } |
mborchers | 13:34f7f783ad24 | 25 | } |
mborchers | 13:34f7f783ad24 | 26 | |
mborchers | 13:34f7f783ad24 | 27 | |
mborchers | 13:34f7f783ad24 | 28 | void SerialOutputLogger::writeImuDataLog(bool csv) { |
mborchers | 13:34f7f783ad24 | 29 | if (csv) { |
mborchers | 13:34f7f783ad24 | 30 | |
mborchers | 13:34f7f783ad24 | 31 | } else { |
mborchers | 13:34f7f783ad24 | 32 | |
mborchers | 13:34f7f783ad24 | 33 | } |
mborchers | 13:34f7f783ad24 | 34 | } |