Skip to content

pebble: port the platform glue to the pbl kernel API - #2

Draft
gmarull wants to merge 1 commit into
pebbleosfrom
kernel-api
Draft

pebble: port the platform glue to the pbl kernel API#2
gmarull wants to merge 1 commit into
pebbleosfrom
kernel-api

Conversation

@gmarull

@gmarull gmarull commented Sep 3, 2026

Copy link
Copy Markdown
Member

PebbleOS is moving onto its own kernel API (coredevices/PebbleOS#1985); FreeRTOS becomes private to kernel/freertos there and a native backend can replace it. The Pebble platform files here were the last code outside that folder including FreeRTOS headers.

  • gFlashMutex / gDebugMutex become statically defined pbl_mutex objects; the lazy create paths go away.
  • modDelayMilliseconds / modDelayMicroseconds and the debugger receive loop use pbl_thread_sleep.
  • modCriticalSectionBegin/End use pbl_irq_lock/unlock.
  • modTaskGetCurrent returns pbl_thread_current.
  • The unused gMainTask declaration is dropped.

Needs the PebbleOS branch above to build (it provides include/pbl/kernel). Verified on qemu_gabbro with XS enabled on both the FreeRTOS shim and the native backend: boot, app launch and exit, no asserts.

🤖 Generated with Claude Code

https://claude.ai/code/session_0115ghSX4ArXuBNC2M9bbEpL

PebbleOS now owns its kernel API (include/pbl/kernel) and FreeRTOS is
private to its kernel/freertos backend, so the Pebble platform files can
no longer include FreeRTOS headers. Use pbl_mutex for the flash and
debug mutexes, pbl_thread_sleep for delays, pbl_irq_lock for critical
sections and pbl_thread_current for the task identity. The mutexes are
defined statically, so the lazy creation goes away. gMainTask was
declared but never defined or used.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0115ghSX4ArXuBNC2M9bbEpL
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant