Skip to content

Commit c64c7b8

Browse files
committed
Added critical section around rf_start_cca
1 parent 5f76ff9 commit c64c7b8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

features/nanostack/FEATURE_NANOSTACK/targets/TARGET_SL_RAIL/NanostackRfPhyEfr32.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ static void rf_thread_loop(const void *arg)
211211

212212
memoryFree(handle);
213213
rx_queue[rx_queue_tail] = NULL;
214-
215214
rx_queue_tail = (rx_queue_tail + 1) % RF_QUEUE_SIZE;
216215
}
217216

@@ -423,6 +422,8 @@ static int8_t rf_start_cca(uint8_t *data_ptr, uint16_t data_length, uint8_t tx_h
423422
}
424423
}
425424

425+
platform_enter_critical();
426+
426427
data_ptr[0] = data_length + 2;
427428
RAIL_RfIdleExt(RAIL_IDLE_ABORT , true);
428429
RAIL_TxDataLoad(&txData);
@@ -443,15 +444,18 @@ static int8_t rf_start_cca(uint8_t *data_ptr, uint16_t data_length, uint8_t tx_h
443444
//Save packet number and sequence
444445
current_tx_handle = tx_handle;
445446
current_tx_sequence = data_ptr[3];
447+
platform_exit_critical();
446448
return 0;
447449
} else {
448450
RAIL_RfIdle();
449451
RAIL_RxStart(channel);
450452
radio_state = RADIO_RX;
453+
platform_exit_critical();
451454
return -1;
452455
}
453456
}
454457
//Should never get here...
458+
platform_exit_critical();
455459
return -1;
456460
}
457461

0 commit comments

Comments
 (0)