Removed Strings
This saves 20%(800 bytes) Memory cost of library :D. Only tested with EpoxyDuino. Not safe for deploy.
Needs to be tested with other controllers.
I started a build check.
I used the String class here to hide (Harvard) architectural differences from most of this code.
As the comment says, there may need to be some more work needed to continue to support ESP8266/ESP32.
There may be issues with upstream tools -- new ESP8266 compiler warnings may be breaking the base build?
I will check.
Upstream tools still build the latest release OK.
It looks like there's a build regression for the ESP8266 family. See Action build https://github.com/philj404/SimpleSerialShell/runs/7162744916?check_suite_focus=true (link may go stale eventually)
It looks like there's some pointer math that may need more formal casts.
...
AdjustableBlink.ino esp8266:esp8266:huzzah:eesz=4M3M,xtal=80 built output
Used libraryVersionPath
SimpleSerialShell 0.9.2 /home/runner/work/SimpleSerialShell/SimpleSerialShell
Used platformVersionPath
esp8266:esp8266 3.0.2 /home/runner/.arduino15/packages/esp8266/hardware/esp8266/3.0.2
In file included from /home/runner/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/assert.h:10,
from /home/runner/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/sys/reent.h:503,
from /home/runner/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/stdlib.h:18,
from /home/runner/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/cstdlib:75,
from /home/runner/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/c++/10.3.0/stdlib.h:36,
from /home/runner/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/Arduino.h:27,
from /home/runner/Arduino/libraries/SimpleSerialShell/src/SimpleSerialShell.cpp:1:
/home/runner/Arduino/libraries/SimpleSerialShell/src/SimpleSerialShell.cpp: In member function 'int SimpleSerialShell::Command::compareName(const char*) const':
/home/runner/Arduino/libraries/SimpleSerialShell/src/SimpleSerialShell.cpp:61:51: error: invalid conversion from 'size_t' {aka 'unsigned int'} to 'const void*' [-fpermissive]
61 | work[i] = (char)pgm_read_byte(addr+i);
| ~~~~^~
| |
| size_t {aka unsigned int}
/home/runner/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/include/sys/pgmspace.h:98:57: note: initializing argument 1 of 'uint8_t pgm_read_byte_inlined(const void*)'
98 | static inline uint8_t pgm_read_byte_inlined(const void* addr) {
| ~~~~~~~~~~~~^~~~
Error during build: exit status 1
AlternateTokenizer.ino
...
I'm going to close out this (draft) pull request for now. If you get it working with ESP8266 builds, we can open it again.