Skip to content

Commit

Permalink
Merge pull request #2 from mcci-catena/issue1
Browse files Browse the repository at this point in the history
increase number of FED3 events to be stored during sleep
  • Loading branch information
dhineshkumarmcci authored Apr 18, 2022
2 parents 78ef0ae + f4d3d5e commit a719354
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Catena4610_FED3.ino
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static_assert(
"This sketch requires Catena-Arduino-Platform v0.21.0-5 or later"
);

static const char sVersion[] = "1.0.0-1";
static const char sVersion[] = "1.0.0";

/****************************************************************************\
|
Expand Down
8 changes: 5 additions & 3 deletions Catena4610_cMeasurementLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,12 @@ void cMeasurementLoop::updatePelletFeederData()
if (fed3Event != m_prevEvent || fed3Event == 2)
{
m_prevEvent = fed3Event;
if (m_eventCount > 7)
if (m_eventCount > 9)
{
for (uint8_t nIndex = 0; nIndex <= this->num_bytes; ++nIndex)
{
m_data.fed3.DataBytes[m_eventCount - 10][nIndex] = m_data.fed3.DataBytes[m_eventCount - 9][nIndex];
m_data.fed3.DataBytes[m_eventCount - 9][nIndex] = m_data.fed3.DataBytes[m_eventCount - 8][nIndex];
m_data.fed3.DataBytes[m_eventCount - 8][nIndex] = m_data.fed3.DataBytes[m_eventCount - 7][nIndex];
m_data.fed3.DataBytes[m_eventCount - 7][nIndex] = m_data.fed3.DataBytes[m_eventCount - 6][nIndex];
m_data.fed3.DataBytes[m_eventCount - 6][nIndex] = m_data.fed3.DataBytes[m_eventCount - 5][nIndex];
Expand All @@ -347,13 +349,13 @@ void cMeasurementLoop::updatePelletFeederData()
m_data.fed3.DataBytes[m_eventCount - 3][nIndex] = m_data.fed3.DataBytes[m_eventCount - 2][nIndex];
m_data.fed3.DataBytes[m_eventCount - 2][nIndex] = m_data.fed3.DataBytes[m_eventCount - 1][nIndex];
}
m_eventCount = 7;
m_eventCount = 9;
}
for (uint8_t nIndex = 1; nIndex <= this->num_bytes; ++nIndex)
{
m_data.fed3.DataBytes[m_eventCount][nIndex - 1] = this->au8Buffer[nIndex + BYTE_CNT];
}
if (m_eventCount <= 7)
if (m_eventCount <= 9)
{
m_eventCount += 1;
}
Expand Down
2 changes: 1 addition & 1 deletion Catena4610_cMeasurementLoop.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class cMeasurementFormat : public cMeasurementBase
// fed3 data
struct FED3
{
uint8_t DataBytes[8][32];
uint8_t DataBytes[10][32];
};

//---------------------------
Expand Down

0 comments on commit a719354

Please sign in to comment.