read-APSystems-YC600-QS1-DS3 icon indicating copy to clipboard operation
read-APSystems-YC600-QS1-DS3 copied to clipboard

Remove unused variables and make actionFlag a uint8_t

Open fwolfst opened this issue 1 year ago • 3 comments

fwolfst avatar Apr 19 '23 20:04 fwolfst

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.

fwolfst avatar Apr 19 '23 20:04 fwolfst

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

patience4711 avatar May 12 '23 13:05 patience4711

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

fwolfst avatar May 12 '23 16:05 fwolfst