SimpleSerialShell icon indicating copy to clipboard operation
SimpleSerialShell copied to clipboard

Removed Strings

Open cyborgdennett opened this issue 3 years ago • 3 comments

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.

cyborgdennett avatar Jul 01 '22 21:07 cyborgdennett

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.

philj404 avatar Jul 02 '22 15:07 philj404

There may be issues with upstream tools -- new ESP8266 compiler warnings may be breaking the base build?

I will check.

philj404 avatar Jul 02 '22 16:07 philj404

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 
...

philj404 avatar Jul 03 '22 00:07 philj404

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.

philj404 avatar Jan 07 '23 22:01 philj404