Skip to content

Commit

Permalink
new constructor and begin method added
Browse files Browse the repository at this point in the history
  • Loading branch information
shuvangkardas committed Oct 9, 2020
1 parent 61a1dcb commit 16a4040
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/RingEEPROM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,26 @@ 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
_bufSz = bufSz; //Total number of buffer
_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
*************************************************************/
Expand Down
2 changes: 2 additions & 0 deletions src/RingEEPROM.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 16a4040

Please sign in to comment.