puuu / ESPiLight

ESPiLight - pilight 433.92 MHz protocols library for Arduino
GNU General Public License v3.0
110 stars 41 forks source link

place pilight log messages in PROGMEM #24

Closed janLo closed 6 years ago

janLo commented 6 years ago

This places the pilight log message string literals into PROGMEM. With that they don't take up space in RAM. Testing with test_parse.ino gave the following results for "free heap": before: 26152 byte after: 32936 byte diff: 6784 byte

That is 71.5% free compared to the 56.8% of the 46032 byte free Heap without pilight.

puuu commented 6 years ago

🎉 Very good. 🥇 I never thought about this.

Merged in 4d1c1f22b989775cc711a818f6c97c9059ccb1da .

puuu commented 6 years ago

@janLo unfortunately, this changes lead to stack traces as shown in puuu/MQTT433gateway#23, because the flash needs to be read 32bit aligned on esp8266. So we need to use printf_P() , but for some reason the linker can not find it. So i did my own implementation in 717e138359b64325afcf20e3f0c96c07c191409a . Furthermore, 32f7dac5a06ad4cec8a1490d0aeff2abddbc810b introduce ESPiLight::setErrorOutput(Print &output) to redirect the pilight error messages to any Print class.