Skip to content

k_timer: remaining semantic divergences from upstream (remaining_get type, status_sync busy-poll) #28

@swoisz

Description

@swoisz

Tracked divergences on the k_timer API, post-#17:

  • k_timer_remaining_get() return type: Boreas int64_t, upstream uint32_t ms. Consumer code doing uint32_t r = k_timer_remaining_get(...) silently truncates today. Widening is the safer divergence but should either match upstream or carry an explicit @note.
  • k_timer_status_sync() busy-polls: a sem-based implementation was attempted and reverted — the embedded stack-local struct k_sem blocking on K_FOREVER corrupts FreeRTOS scheduler state on ESP32-S3 (see the k_sem corruption issue). Doxygen documents the busy-poll. Re-attempt once the k_sem issue is fixed.
  • Callback context visibility: with CONFIG_K_TIMER_DISPATCH_ISR=y (default) expiry runs in ISR context matching upstream; the task-context fallback path deserves a louder callout in the zkernel README for consumers porting Zephyr code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    zephyr-parityDivergence from upstream Zephyr API/semantics

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions