-
Notifications
You must be signed in to change notification settings - Fork 635
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
debug: refactoring & remove special case for PROGMEM
Don't use variable length array and remove `debugSend_P`, directly give the format to `vsnprintf_P`. Common functions moved into namespace debug { ... } Module functions moved into namespace { ... } Provide len argument to most outputs, so it's calculated exactly once. Early checks for nullptr and zero length. Fix include order once again, try not to depend on config in header and only use it in the actual .cpp code. Still involves strlen for flash strings, but that needs to be addressed by using a custom type like: ``` struct PstrWithLength { const char* const ptr; size_t size; }; ``` And define PSTR macro to return: ``` PstrWithLength{&__pstr__[0], sizeof(__pstr__)};` ``` (and, probably, for any `const char (&fixed)[Size]` arrays as well)
- Loading branch information
Showing
6 changed files
with
634 additions
and
423 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.