Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions smtc_rac_lib/radio_planner/src/radio_planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,15 @@ rp_stats_t rp_get_stats( const radio_planner_t* rp )

void rp_callback( radio_planner_t* rp )
{
// UNLOCK_RADIO_ACCESS must be exempt like LOCK_RADIO_ACCESS: a lock task
// held open longer than the failsafe window (e.g. continuous RX under the
// raw RAC) keeps its original start_time_ms, and unlock_radio_access
// retypes the still-RUNNING task to UNLOCK before the engine processes
// it — the very next rp_callback would evaluate the failsafe against the
// stale start time and panic at the moment the client releases the lock.
if( ( rp->tasks[rp->radio_task_id].state == RP_TASK_STATE_RUNNING ) &&
( rp->tasks[rp->radio_task_id].type != RP_TASK_TYPE_LOCK_RADIO_ACCESS ) &&
( rp->tasks[rp->radio_task_id].type != RP_TASK_TYPE_UNLOCK_RADIO_ACCESS ) &&
( rp->disable_failsafe != RP_DISABLE_FAILSAFE_KEY ) &&
( ( int32_t ) ( rp->tasks[rp->radio_task_id].start_time_ms + 128000 - smtc_modem_hal_get_time_in_ms( ) ) < 0 ) )
{
Expand Down