SiliconLabs / arduino

Arduino Core for Silicon Labs devices
74 stars 15 forks source link

[bug] examples contain classic race between ISR and main thread #74

Closed ericwertz closed 1 month ago

ericwertz commented 1 month ago

Hardware

xG2x dev kits

Core version

2.x

Arduino IDE version

2.x

Operating system

any

Radio stack variant

BLE

OpenThread Border Router device (if using Matter)

No response

Issue description

ble_blinky and ble_hid_keyboard examples both contain the data-sharing-between-ISR-and-main bug where the shared data isn't declared volatile. The code will only work as long as the optimizer is turned down/off and the globals' re-loads into registers aren't optimized away.

Serial output

No response

RTT output (if using Matter)

No response

Minimal reproducer code

No response

silabs-bozont commented 1 month ago

Hello @ericwertz - please fill in the missing parts of the issue template - especially the title. Thank you!

silabs-bozont commented 1 month ago

Hello @ericwertz, It has been fixed in 2.1.0 - thank you for the report!