kscheff / BlueBasic

BASIC interpreter for CC2540 and CC2541 Bluetooth LE chips
11 stars 9 forks source link

Suggested change #11

Closed Alex079 closed 5 years ago

Alex079 commented 5 years ago

https://github.com/kscheff/BlueBasic/blob/abe8ea6d4b145bbd8c0e2428546ec6f1d8c9b9ba/BLE-CC254x-1.4.2.2/Projects/ble/BlueBasic/Source/os.c#L231

This line checks the free interrupt slot if (blueBasic_interrupts[i].linenum == 0)

I believe the check should look like this if (blueBasic_interrupts[i].pin == pin || blueBasic_interrupts[i].linenum == 0) in order to be able to reassign the interrupt on the same pin

Could you please check?

kscheff commented 5 years ago

I have not used the interrupt so far, so I am not aware of any issues or usage scenarios. It looks to me that you would need to first detach the pin before you can reassign a new value. It might avoid any raise condition.

kscheff commented 5 years ago

adapted 0c7a27393d644272b9d3aa1e6d2bbdc9069c9bef