Skip to content

Refactor SDL/FreeRTOS implementation to support macOS simulator properly - #653

Open
KenVanHoeylandt wants to merge 2 commits into
mainfrom
macos-simulator-support
Open

KenVanHoeylandt wants to merge 2 commits into
mainfrom
macos-simulator-support

Conversation

@KenVanHoeylandt

@KenVanHoeylandt KenVanHoeylandt commented Sep 16, 2026

Copy link
Copy Markdown
Contributor
  • Run SDL from main() and place FreeRTOS in separate thread. This fixes macOS support.
  • Updated GitHub Actions to publish macOS simulator build for testing, updated amd64 to x86_64 for consistent naming.

Summary by CodeRabbit

  • New Features

    • Added SDL-based simulator window rendering with coordinated display updates.
    • Simulator input events are now processed through the application’s main window loop, with thread-safe pointer, keyboard, and text-input access.
    • Simulator builds now support explicit architecture selection for Linux and macOS.
  • Bug Fixes

    • Improved simulator stability on macOS by ensuring window creation, event handling, and rendering run on the required main thread.
    • Prevented competing simulator threads from processing SDL events simultaneously.

This fixes macOS support.
Updated GitHub Actions to publish macOS simulator build for testing,
updated amd64 to x86_64 for consistent naming.
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: c449ec58-0239-426f-a177-ded6f78a7e15

📥 Commits

Reviewing files that changed from the base of the PR and between c788f3a and bc7530f.

📒 Files selected for processing (1)
  • .github/actions/build-simulator/action.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/actions/build-simulator/action.yml

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The simulator action now requires an architecture input and always uploads artifacts. Linux and macOS workflows provide architecture values. The simulator runs FreeRTOS on a detached thread and reserves the OS main thread for SDL. A synchronized bridge transfers bitmap presentation requests to the SDL loop. SDL input state is mutex-protected, and input polling no longer pumps events from LVGL drivers.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to bc753

The simulator artifact naming now matches the Linux and macOS workflow inputs and release output directories. No actionable current-head risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 7 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: refactoring the SDL/FreeRTOS implementation to support the macOS simulator. It is concise and directly related to the pull request objectives.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 7 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch macos-simulator-support

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: e6ea5acb-9956-4ab3-a2e0-86daa0775aac

📥 Commits

Reviewing files that changed from the base of the PR and between 65ee223 and c788f3a.

📒 Files selected for processing (11)
  • .github/actions/build-simulator/action.yml
  • .github/workflows/build-simulator.yml
  • Devices/simulator/Source/Main.cpp
  • Devices/simulator/Source/Simulator.h
  • Devices/simulator/Source/drivers/sdl_bridge.cpp
  • Devices/simulator/Source/drivers/sdl_bridge.h
  • Devices/simulator/Source/drivers/sdl_display.cpp
  • Devices/simulator/Source/drivers/sdl_input.cpp
  • Devices/simulator/Source/drivers/sdl_input.h
  • Devices/simulator/Source/drivers/sdl_keyboard.cpp
  • Devices/simulator/Source/drivers/sdl_pointer.cpp
💤 Files with no reviewable changes (2)
  • Devices/simulator/Source/drivers/sdl_keyboard.cpp
  • Devices/simulator/Source/drivers/sdl_pointer.cpp

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Comment thread .github/actions/build-simulator/action.yml
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