Skip to content

feat(radio): OS compatibility layer #5840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 3, 2025
Merged

feat(radio): OS compatibility layer #5840

merged 4 commits into from
May 3, 2025

Conversation

raphaelcoeffic
Copy link
Member

@raphaelcoeffic raphaelcoeffic commented Jan 26, 2025

This PR is aimed at providing a cleaner way to deal with differences btw. simulator and firmware.

Tasks and mutex were already kind of provided by rtos.h, but we lacked support for timers and async calls, which were provided exclusively by FreeRTOS timers. Now there is an implementation of timers for native platform, which is used as well for async calls, the same way it is done with FreeRTOS.

Supported features:

  • time
  • timers
  • asynchronous calls
  • tasks and mutex

@raphaelcoeffic raphaelcoeffic force-pushed the async-calls branch 4 times, most recently from a4dd3c2 to 9a31c80 Compare January 26, 2025 15:57
@raphaelcoeffic raphaelcoeffic force-pushed the async-calls branch 2 times, most recently from d94a177 to dd2757a Compare March 10, 2025 12:10
@raphaelcoeffic raphaelcoeffic marked this pull request as ready for review March 10, 2025 12:16
@raphaelcoeffic raphaelcoeffic added the house keeping 🧹 Cleanup of code and house keeping label Mar 10, 2025
@raphaelcoeffic raphaelcoeffic added this to the 3.0 milestone Mar 10, 2025
This helps reducing the pressure on the timer queue.
Supports:
- time
- timers
- asynchronous calls
- tasks and mutexes
@pfeerick
Copy link
Member

Tried this on T15, GX12, TX16S, everything seems ok ... except... wait for it!

Display brightness in the bootloader is dim in this PR vs main/nightly (on T15 and TX16S)... 🤪

@raphaelcoeffic
Copy link
Member Author

Display brightness in the bootloader is dim in this PR vs main/nightly (on T15 and TX16S)... 🤪

Apparently the bootloader was still relying on per10ms() being called, so that basically nothing related to time worked (no inputs, no frame timer, etc).

I added basic "nortos" support to fix this.

Stop relying on `per10ms()` or `per5ms()` being called.
@pfeerick
Copy link
Member

pfeerick commented May 2, 2025

TX16S: Bootloader backlight is good again. Is there anything you can do about the responsiveness of the hard keys? As RTN / ENT seem to take abnormally long to respond now, but rotary encoder seems fine.

@raphaelcoeffic
Copy link
Member Author

raphaelcoeffic commented May 2, 2025

TX16S: Bootloader backlight is good again. Is there anything you can do about the responsiveness of the hard keys? As RTN / ENT seem to take abnormally long to respond now, but rotary encoder seems fine.

In the bootloader, or in general? I moved the input polling back to IRQ, which should behave better.

This should avoid the lag created by screen / storage processing.
@pfeerick
Copy link
Member

pfeerick commented May 3, 2025

Sorry, I should have been clearer - yes, bootloader. I hadn't noticed any behaviour changes in main UI. And thanks bootloader hard keys are nice and responsive again on TX16S. :)

@pfeerick pfeerick merged commit ab2a19e into main May 3, 2025
53 checks passed
@pfeerick pfeerick deleted the async-calls branch May 3, 2025 09:07
@philmoz
Copy link
Collaborator

philmoz commented May 3, 2025

This PR crashes Companion when simulator window is closed.
Happens 100% on MacOS, have not tested Windows or Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
house keeping 🧹 Cleanup of code and house keeping
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants