Skip to content

Incorrect parameter type in Timebase sync callback #664

@jphickey

Description

@jphickey

Is your feature request related to a problem? Please describe.
Timebase sync callback prototype is currently defined as:

typedef uint32 (*OS_TimerSync_t)(osal_index_t timer_id); /**< @brief Timer sync */

But indices (table position) is an internal OSAL value that shouldn't be used externally from OSAL. More importantly, it is easy to alias, and cannot be differentiated if an object is deleted and then created again.

Describe the solution you'd like
Use the full ID value, not the index. So the prototype would be:

typedef uint32 (*OS_TimerSync_t)(osal_id_t timer_id); /**< @brief Timer sync */

Describe alternatives you've considered
Leave as is.

Additional context
I was going to roll this into a larger change, but figured this technically qualifies as an "API change" so writing it as a separate issue for specific awareness. However, nothing outside of OSAL itself (and the included tests) actually implements a sync callback. PSPs could, but none currently do, so this really shouldn't have any current impact to users. But if users do start using this option, better to have the full ID value than just the index.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions