Skip to content

Commit

Permalink
Merge pull request #1276 from pepepr08/fix1244-rtemstimebase
Browse files Browse the repository at this point in the history
Fix #1244, Add RTEMS timebase callback wrapper
  • Loading branch information
dzbaker committed Aug 4, 2022
2 parents fb892b5 + 942a1f6 commit e6a8537
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/os/rtems/src/os-impl-timebase.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,24 @@ void OS_UsecsToTicks(uint32 usecs, rtems_interval *ticks)
/* The user may specify whether to use priority inheritance on mutexes via osconfig.h */
#define OSAL_TIMEBASE_MUTEX_ATTRIBS RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY

/*----------------------------------------------------------------
*
* Function: OS_TimeBase_CallbackThreadEntry
*
* Purpose: Local helper routine, not part of OSAL API.
* Wrapper function used by OS_TimeBaseCreate_Impl to
* convert the rtems_task_argument on newly created
* timebase task into an osal_id_t used by the
* OS_TimeBase_CallbackThread.
*
*-----------------------------------------------------------------*/
static void OS_TimeBase_CallbackThreadEntry(rtems_task_argument arg)
{
osal_id_t id;
id = OS_ObjectIdFromInteger(arg);
OS_TimeBase_CallbackThread(id);
}

/*----------------------------------------------------------------
*
* Function: OS_TimeBaseCreate_Impl
Expand Down Expand Up @@ -390,9 +408,9 @@ int32 OS_TimeBaseCreate_Impl(const OS_object_token_t *token)
else
{
/* will place the task in 'ready for scheduling' state */
rtems_sc = rtems_task_start(local->handler_task, /*rtems task id*/
(rtems_task_entry)OS_TimeBase_CallbackThread, /* task entry point */
(rtems_task_argument)r_name); /* passed argument */
rtems_sc = rtems_task_start(local->handler_task, /*rtems task id*/
(rtems_task_entry)OS_TimeBase_CallbackThreadEntry, /* task entry point */
(rtems_task_argument)r_name); /* passed argument */

if (rtems_sc != RTEMS_SUCCESSFUL)
{
Expand Down

0 comments on commit e6a8537

Please sign in to comment.