Skip to content

Commit fd8b6c5

Browse files
Convert to C++ class, clean up code
Convert the entire file into a C++ class (with C wrappers to preserve the ABI). This allows for setting individual values of the global struct(class) in-situ instead of a cryptic list at the end of the struct definition. It also removes a lot of redundant `twi.`s from most class members. Clean up the code by converting from `#defines` to inline functions, get rid of ternarys-as-ifs, use real enums, etc. For slave_receiver.ino, the numbers are: GIT Master IRAM: 0x723c This push IRAM: 0x6fc0 For a savings of 636 total IRAM bytes (note, there may be a slight flash text increase, but we have 1MB of flash to work with and only 32K of IRAM so the tradeoff makes sense.
1 parent 31e54a0 commit fd8b6c5

File tree

1 file changed

+285
-217
lines changed

1 file changed

+285
-217
lines changed

0 commit comments

Comments
 (0)