![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Fork to see if I can get working
Dependencies: BufferedSerial OneWire WinbondSPIFlash libxDot-dev-mbed5-deprecated
Fork of xDotBridge_update_test20180823 by
xDotBridge/src/EepromLog.cpp
- Committer:
- Matt Briggs
- Date:
- 2017-04-10
- Revision:
- 73:dc5adf462660
File content as of revision 73:dc5adf462660:
/* * EepromLog.cpp * * Created on: Mar 23, 2017 * Author: mbriggs */ #include "EepromLog.h" #include "dot_util.h" #include <cstring> EepromLog::EepromLog(uint16_t baseAddr, uint8_t size) { mBaseAddr = baseAddr; mLogSize = size; mData = new uint8_t[size]; } EepromLog::~EepromLog() { mLogSize=0; delete mData; } void EepromLog::clear() { if (mLogSize == 0 || mData == NULL) return; std::memset(mData, 0x00, mLogSize); } bool EepromLog::read() { if (mLogSize == 0 || mData == NULL) return false; return dot->nvmRead(mBaseAddr, mData, mLogSize); } bool EepromLog::save() { if (mLogSize == 0 || mData == NULL) return false; return dot->nvmWrite(mBaseAddr, mData, mLogSize); }