drivers/saul: Improved stringification#11394
Conversation
|
@haukepetersen: Please have a look. This reduces RAM requirements on ATmegas by 512B (or 25% of the available RAM of e.g. the Arduino Uno, the Arduino Duemilanove, or the Arduino Nano). I would love to see this merged. |
|
I'll solve the merge conflicts now |
40dc243 to
f6764d7
Compare
b678f1e to
05e8244
Compare
|
Rebased to solve merge conflict |
|
An underscore followed by an upper case letter is a reserved identifier according to the C standard. I fixed the code to stop using them. @benpicco: Would you mind to have a look? To me, this PR is super uncontroversial and would be a huge step in getting |
benpicco
left a comment
There was a problem hiding this comment.
This is a nice cleanup.
I see no functional changes - please squash.
- Changed declaration of SAUL classes (while keeping the format)
- Termed "class of SAUL classes" category of SAUL classes in the doc to
avoid confusion. (E.g. a SAUL class will now be in category sensor or
actuator.)
- Separate enums for SAUL category and intra-category ID. Numbers will now
but auto-assigned by the compiler
- Use constant look-up tables for stringification (one table per SAUL category).
==> This saves 512B in .data section of AVR
88e6da1 to
837e9c1
Compare
Done. All green :-) |
Contribution description
==> This saves 512B in .data section of AVR
TL;DR:
Pro:
Cons:
Testing procedure
examples/saulshould still work with your favorite boardIssues/PRs references
Split off from #11392