patience4711 / read-APSystems-YC600-QS1-DS3

Software for an esp8266 nodemcu to read data from APS inverters.
130 stars 24 forks source link

Remove unused variables and make actionFlag a uint8_t #107

Open fwolfst opened 1 year ago

fwolfst commented 1 year ago

I hope the changes can still easily be merged to 9_9 (there is no ino file released yet). It looks as the compiler optimizes them away (minimal difference in .bin size), but relevant improvement for (human) readers.

patience4711 commented 1 year ago

@fwolfst Making actionFlag an uint8_t wasn't such a good idea after all. This could be set to a value of 301 which means overflow resulting in 45 which in turn caused the sendZB to send a rubbish message. Which crashed the Zigbee module. Took me hours to figure that out because i didn't realize the consequences of using that uint8_t. So I changed 301 to 250 to solve it.

fwolfst commented 1 year ago

@fwolfst Making actionFlag an uint8_t wasn't such a good idea after all. This could be set to a value of 301 which means overflow resulting in 45 which in turn caused the sendZB to send a rubbish message. Which crashed the Zigbee module. Took me hours to figure that out because i didn't realize the consequences of using that uint8_t. So I changed 301 to 250 to solve it.

Oh gosh. Yeah, I should have checked that before. I had not much time, my code does not yet pair (but I get closer, command-by-command ....)