Open budulinek opened 1 year ago
Hi @budulinek,
Thanks for the EHV support extension, good to hear from you again, would love to add it!
As for the run-time bytestart calculation, I would rather not add it, as it results in a lot of avoidable CPU cycles. It avoids human mistakes in preparing the code, so I feel is it then better to calculate it once and store is in an array? Originally I considered that but didn't to reduce its (limited) RAM usage.
Arnold
Hi Arnold, at first I was trying to figure out whether the bytestart calculation could be done during compile-time (in combination with macros). Here is a discussion suggesting that some calculations could be done during compile-time: https://forum.arduino.cc/t/calculating-variables-at-compile-time/262409/18 https://forum.arduino.cc/t/run-time-vs-compile-time-functions/379649/8
If you are woried about CPU cycles, you can fill the bytestart[][] array during setup(). RAM usage? The code is supposed to run on ESP8266, so I think we can afford to spend few more bytes of RAM in order to avoid human mistake in the code. And by the way, why uint32_t bytestart and uint32_t nr_bytes?? uint16_t should suffice.
Yeah, I am working on a major upgrade of my Daikin P1P2 ⇔ UDP Gateway. I have noticed you have made a huge progress with P1P2 in the meantime, congratulations!
Hi @budulinek , Thanks! I agree data size seems enough (80kB), but we were still running out of space, that is why the schedule code has been disabled for now. This code will disappear with the planned rewrite anyway. Indeed uint16_t for bytestart should suffice if in RAM, but it is easier to use uint32_t if in flash (PROGMEM).