mchr3k / arduino-libs-manchester

172 stars 113 forks source link

fix race condition for attiny85 #57

Closed endail closed 1 year ago

endail commented 3 years ago

I've been trying to get an ATTiny85 receiving Manchester-encoded data from another ATTiny85 transmitting Manchester-encoded data. I had an Arduino Pro Mini with an identical receiver/code to confirm the transmitter was indeed transmitting.

From the very limited testing I've done, there appears to be a race condition (or something...) preventing rx_mode changing to RX_MODE_MSG.

On a hunch, I set each of the relevant variables to volatile, which now seems to make it work (ie. man.receiveComplete() now returns true).

Fixes #55