Fork to see if I can get working

Dependencies:   BufferedSerial OneWire WinbondSPIFlash libxDot-dev-mbed5-deprecated

Fork of xDotBridge_update_test20180823 by Matt Briggs

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SimpleRxSeqLog.h Source File

SimpleRxSeqLog.h

00001 /*
00002  * simpleRxSeqLog.h
00003  *
00004  *  Created on: Mar 23, 2017
00005  *      Author: mbriggs
00006  */
00007 
00008 #ifndef SIMPLERXSEQLOG_H_
00009 #define SIMPLERXSEQLOG_H_
00010 
00011 #include "EepromLog.h"
00012 
00013 const uint8_t SIMPLE_RX_SEQ_LOG_SIZE = 3*sizeof(uint32_t);
00014 
00015 class SimpleRxSeqLog : public EepromLog {
00016 public:
00017     SimpleRxSeqLog (uint16_t baseAddr) : EepromLog(baseAddr, SIMPLE_RX_SEQ_LOG_SIZE) {}
00018 
00019     uint32_t loopCount()
00020     {
00021         return *((uint32_t *)(mData+0*sizeof(uint32_t)));
00022     }
00023     void setLoopCount(uint32_t val)
00024     {
00025         *((uint32_t*) (mData+0*sizeof(uint32_t))) = val;
00026     }
00027     uint32_t rxMsgCount()
00028     {
00029         return *((uint32_t *)(mData+1*sizeof(uint32_t)));
00030     }
00031     void setRxMsgCount(uint32_t val)
00032     {
00033         *((uint32_t*) (mData+1*sizeof(uint32_t))) = val;
00034     }
00035     uint32_t maxSeenMsgSeqNum()
00036     {
00037         return *((uint32_t*)(mData+2*sizeof(uint32_t)));
00038     }
00039     void setMaxSeenMsgSeqNum(uint32_t val)
00040     {
00041         *((uint32_t*) (mData+2*sizeof(uint32_t))) = val;
00042     }
00043 };
00044 
00045 #endif /* XDOTBRIDGE_INC_SIMPLERXSEQLOG_H_ */