pebble: port the platform glue to the pbl kernel API - #2
Draft
gmarull wants to merge 1 commit into
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PebbleOS is moving onto its own kernel API (coredevices/PebbleOS#1985); FreeRTOS becomes private to
kernel/freertosthere and a native backend can replace it. The Pebble platform files here were the last code outside that folder including FreeRTOS headers.gFlashMutex/gDebugMutexbecome statically definedpbl_mutexobjects; the lazy create paths go away.modDelayMilliseconds/modDelayMicrosecondsand the debugger receive loop usepbl_thread_sleep.modCriticalSectionBegin/Endusepbl_irq_lock/unlock.modTaskGetCurrentreturnspbl_thread_current.gMainTaskdeclaration 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