-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Conversation
/bot run checks |
/bot run checks |
1 similar comment
/bot run checks |
Note: Same issue is posted in Nordic forum and the fix is pending in Nordic SDK. Fixing for now in the porting layer, until a proper fix has been merged from upstream. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
@@ -133,27 +134,35 @@ uint32_t app_timer_create(app_timer_id_t const * p_timer_id, | |||
return NRF_ERROR_INVALID_STATE; | |||
} | |||
|
|||
if (pinfo->osHandle == NULL) | |||
/* If already a FreeRTOS timer exists, delete and recreate the timer. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar suggestion: "If a FreeRTOS timer already exists,..."
if (pinfo->osHandle == NULL) | ||
err_code = NRF_ERROR_NULL; | ||
} | ||
if (mode == APP_TIMER_MODE_SINGLE_SHOT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add {...}
, also lines 158-160
pinfo->func = timeout_handler; | ||
pinfo->osHandle = xTimerCreate(" ", 1000, timer_mode, pinfo, app_timer_callback); | ||
|
||
if (pinfo->osHandle == NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add {...}
/bot run checks |
* Fix nordic freertos timer create function * Improving comments. include {}
Fix freertos timer create function for Nordic
Description
Nordic has an implementation for app timer APIs using FreeRTOS timers.
app_timer_create
API is expected to re-create a new timer with a new handler (note: there is no API to delete a timer). Currently the API returns an error if a timer already exists. With this PR, API ensures if timer is inactive, then delete and create a new timer with the new handler.Also added a check in demo runner to handle user initiated network disable transition in network manager callback.
Checklist:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.