mirror of
https://github.com/liberatedsystems/RNode_Firmware_CE.git
synced 2025-05-03 15:14:53 -04:00
Fix race condition on multiple interfaces receiving at once
This commit is contained in:
parent
6035e1a2c2
commit
81aff16c2d
4 changed files with 36 additions and 41 deletions
|
@ -88,8 +88,7 @@
|
|||
#define FREQ_DIV_6X (double)pow(2.0, 25.0)
|
||||
#define FREQ_STEP_6X (double)(XTAL_FREQ_6X / FREQ_DIV_6X)
|
||||
|
||||
extern bool process_packet;
|
||||
extern uint8_t packet_interface;
|
||||
extern FIFOBuffer packet_rdy_interfaces;
|
||||
extern RadioInterface* interface_obj[];
|
||||
|
||||
// ISRs cannot provide parameters to the functions they call. Since we have
|
||||
|
@ -99,9 +98,7 @@ extern RadioInterface* interface_obj[];
|
|||
void ISR_VECT onDio0Rise() {
|
||||
for (int i = 0; i < INTERFACE_COUNT; i++) {
|
||||
if (digitalRead(interface_pins[i][5]) == HIGH) {
|
||||
process_packet = true;
|
||||
packet_interface = i;
|
||||
break;
|
||||
fifo_push(&packet_rdy_interfaces, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue