From 16a4040a257370d8b3c60a75500498bfe051eb67 Mon Sep 17 00:00:00 2001 From: shuvangkar Date: Sat, 10 Oct 2020 00:46:50 +0600 Subject: [PATCH] new constructor and begin method added --- src/RingEEPROM.cpp | 13 +++++++++++++ src/RingEEPROM.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/src/RingEEPROM.cpp b/src/RingEEPROM.cpp index 338c5f1..a697763 100644 --- a/src/RingEEPROM.cpp +++ b/src/RingEEPROM.cpp @@ -50,6 +50,13 @@ RingEEPROM::RingEEPROM() _paramPacketSz = 2; } +RingEEPROM::RingEEPROM(int addrPtr) +{ + _initAddr = addrPtr; + _bufSz = 4; + _paramPacketSz = 2; +} + void RingEEPROM::begin(int addrPtr, byte bufSz, byte paramSize) { _initAddr = addrPtr; //First address of the buffer @@ -57,6 +64,12 @@ void RingEEPROM::begin(int addrPtr, byte bufSz, byte paramSize) _paramPacketSz = paramSize;// Total byte in a parameter packet } +void RingEEPROM::begin(byte bufSz, byte paramSize) +{ + _bufSz = bufSz; //Total number of buffer + _paramPacketSz = paramSize;// Total byte in a parameter packet +} + /************************************************************* * When status buffer becomes full, this method clears the status buffer *************************************************************/ diff --git a/src/RingEEPROM.h b/src/RingEEPROM.h index 5915099..f12cd89 100644 --- a/src/RingEEPROM.h +++ b/src/RingEEPROM.h @@ -7,7 +7,9 @@ class RingEEPROM public: RingEEPROM(int addrPtr, byte bufSz, byte paramSize); RingEEPROM(); + RingEEPROM(int addrPtr); void begin(int addrPtr, byte bufSz, byte paramSize); + void begin(byte bufSz, byte paramSize); void savePacket(byte *dataBuf); void readPacket(byte *dataBuf); void printStatusBuf();