You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I know, all commands like debugI("Debug message") or Serial.print("something to print") by default put string data to the RAM.
When I compile my app with many debug inserts, I can see that RAM utilization grows rapidly.
If there is a huge amount of RAM available, then there is no issue, but sometime we hit the limit and additional consumption by debug is a problem.
if (Debug.isActive(Debug.INFO)) Debug.printf(cF("example"));
With cf and this macro's:
#define _gFmtBufSize 100+1
// ERB - Force format strings and string constants into FLASH Memory
#define sF(x) String( F(x) )
// Used as an F() when being used as the first Element
// of a Multi-Element Expression
char _gFmtBuf[_gFmtBufSize];
// Buffer, Used with cF() to store constants in program space (FLASH)
#define cF(x) strncpy_P(_gFmtBuf, (PGM_P)PSTR(x), sizeof(_gFmtBuf))
// Used with printf() for the char format string
Is your feature request related to a problem? Please describe.
All messages processed by debug are stored in RAM memory.
So in effect, observing/debugging application causes huge difference in RAM utilisation.
Describe the solution you'd like
Something like:
debugI(F("some message stored in flash"));
Besides: excellent library.
The text was updated successfully, but these errors were encountered: