LibreSolar / charge-controller-firmware

Firmware for Libre Solar MPPT/PWM charge controllers
https://libre.solar/charge-controller-firmware/
Apache License 2.0
144 stars 71 forks source link

Offload ThingSet processing to dedicated thread #103

Open martinjaeger opened 4 years ago

martinjaeger commented 4 years ago

The processing of ThingSet requests that result in a large amount of returned data (e.g. ?conf and ?rec) requires considerable amount of RAM (around 1kB). Currently, each thread that processes ThingSet messages (serial, CAN at the moment, GSM, LoRa in future extensions) needs to reserve that amount of stack memory.

Suggested improvement: Offload the processing into a dedicated processing thread that is called asynchronously from other threads that send and receive the data via comms interfaces.