Skip to content

Commit

Permalink
Enabling stack-headroom print with CLI 'S'.
Browse files Browse the repository at this point in the history
  • Loading branch information
DamonHD committed Nov 7, 2016
1 parent 092cab8 commit 30c9bea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Arduino/V0p2_Main/UI_Minimal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,10 @@ void pollCLI(const uint8_t maxSCT, const bool startOfMinute, const OTV0P2BASE::S
Serial.print(overrunCount);
#endif // !defined(ENABLE_WATCHDOG_SLOW)
Serial.println();
bareStatsTX(); // Default light-weight print and TX of stats.
// Show stack headroom.
OTV0P2BASE::serialPrintAndFlush(F("SH ")); OTV0P2BASE::serialPrintAndFlush(OTV0P2BASE::MemoryChecks::getMinSPSpaceBelowStackToEnd()); OTV0P2BASE::serialPrintlnAndFlush();
// Default light-weight print and TX of stats.
bareStatsTX();
break; // Note that status is by default printed after processing input line.
}

Expand Down
2 changes: 1 addition & 1 deletion Arduino/V0p2_Main/V0p2_Main.ino
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ void loop()
// Complain and keep complaining when getting near stack overflow.
// TODO: make DEBUG-only when confident all configs OK.
const int16_t minsp = OTV0P2BASE::MemoryChecks::getMinSPSpaceBelowStackToEnd();
if(minsp < 64) { OTV0P2BASE::serialPrintAndFlush(F("!SP ")); OTV0P2BASE::serialPrintAndFlush(OTV0P2BASE::MemoryChecks::getMinSPSpaceBelowStackToEnd()); OTV0P2BASE::serialPrintlnAndFlush(); }
if(minsp < 64) { OTV0P2BASE::serialPrintlnAndFlush(F("!SH")); }

loopOpenTRV();

Expand Down

0 comments on commit 30c9bea

Please sign in to comment.