Skip to content

Commit

Permalink
default constructor with begin() added
Browse files Browse the repository at this point in the history
  • Loading branch information
shuvangkardas committed Sep 20, 2020
1 parent 4d71ef8 commit 61a1dcb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/RingEEPROM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ RingEEPROM::RingEEPROM(int addrPtr, byte bufSz, byte paramSize)
//_clrStatusBuf();
}

RingEEPROM::RingEEPROM()
{
//default parameters
_initAddr = 0;
_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
}

/*************************************************************
* 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 @@ -6,6 +6,8 @@ class RingEEPROM
{
public:
RingEEPROM(int addrPtr, byte bufSz, byte paramSize);
RingEEPROM();
void begin(int addrPtr, byte bufSz, byte paramSize);
void savePacket(byte *dataBuf);
void readPacket(byte *dataBuf);
void printStatusBuf();
Expand Down

0 comments on commit 61a1dcb

Please sign in to comment.