Skip to content

Commit

Permalink
vTaskPrioritySet(NULL, 0) doesn't always fix the issue it was trying …
Browse files Browse the repository at this point in the history
…to address and could even prevent the current task to be run again. Use a vTaskDelay of 500 ms to address the missing response issue and also make sure the task can execute the device reset. (#26585)
  • Loading branch information
jmartinez-silabs authored and pull[bot] committed Oct 2, 2023
1 parent 6c75e8c commit 1823296
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/platform/silabs/efr32/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,8 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg)

// When called from an RPC, the following reset occurs before the RPC can respond,
// which breaks tests (because it looks like the RPC hasn't successfully completed).
// One way to fix this is to reduce the priority of this task, to allow logging to
// complete before the reset occurs.
vTaskPrioritySet(NULL, 0);
// Block the task for 500 ms before the reset occurs to allow RPC response to be sent
vTaskDelay(pdMS_TO_TICKS(500));

NVIC_SystemReset();
}
Expand Down

0 comments on commit 1823296

Please sign in to comment.