Skip to content

Commit

Permalink
Merge pull request #33 from opentrv/TRV1.5-rc5-lowbattery
Browse files Browse the repository at this point in the history
Enabled error reporting
  • Loading branch information
Denzo77 committed Nov 14, 2017
2 parents 4f5d93e + 54a1cfb commit 92b7b10
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ valveUI_t valveUI(
// Managed JSON stats.
OTV0P2BASE::SimpleStatsRotation<13> ss1; // Configured for maximum different stats.

// Error reporting
OTV0P2BASE::ErrorReport ErrorReporter;


/******************************************************************************
* INTERRUPT SERVICE ROUTINES
Expand Down Expand Up @@ -485,11 +488,8 @@ void bareStatsTX() {

// Show reset counter. Low priority.
ss1.put(V0p2_SENSOR_TAG_F("R"), resetCount, true);
// Send minimum stack left, saturating at 255 bytes.
const size_t curMinSP = OTV0P2BASE::MemoryChecks::getMinSP();
const uint8_t txMinSP = (255U >= curMinSP) ? (uint8_t) curMinSP : 255U;
ss1.put(V0p2_SENSOR_TAG_F("SP"), txMinSP, true);

// Send error reports.
ss1.put(ErrorReporter, true);

const uint8_t privacyLevel = OTV0P2BASE::stTXalwaysAll;
// Redirect JSON output appropriately.
Expand Down Expand Up @@ -920,6 +920,8 @@ void loop()
// Recompute target, valve position and call for heat, etc.
// Should be called once per minute to work correctly.
NominalRadValve.read();
// Update/age errors and warnings.
ErrorReporter.read();
break;
}
// Stats samples; should never be missed.
Expand Down

0 comments on commit 92b7b10

Please sign in to comment.