Skip to content

fw: enable FreeRTOS tickless idle and optimize USB-PD task loop for low-power sleep - #17

Open
genneth wants to merge 2 commits into
Modos-Labs:mainfrom
genneth:opt/freertos-tickless-idle
Open

fw: enable FreeRTOS tickless idle and optimize USB-PD task loop for low-power sleep#17
genneth wants to merge 2 commits into
Modos-Labs:mainfrom
genneth:opt/freertos-tickless-idle

Conversation

@genneth

@genneth genneth commented Jul 21, 2026

Copy link
Copy Markdown

This PR enables low-power MCU sleep during system idle and suspended states:

  1. FreeRTOS Tickless Idle: Enables configUSE_TICKLESS_IDLE in FreeRTOSConfig.h with PreSleepProcessing / PostSleepProcessing HAL tick suspension, allowing the STM32 MCU to enter low-power sleep mode when no RTOS tasks are active.
  2. USB-PD Task Yielding: Patches the do-while alert loop in fw/User/usbpd.c to yield after 5 iterations when processing TCPC interrupts, preventing 100% CPU lockup and allowing tickless sleep to engage.

Tested and verified on Modos Paper Monitor hardware.

UavL added a commit to UavL/Glider that referenced this pull request Aug 2, 2026
…riage

Static analysis of the video-loss path, power/suspend state machine, and
upstream PRs Modos-Labs#16 and Modos-Labs#17, plus an ordered hardware test plan.

No hardware was observed; every claim is labelled code-derived, inferred,
estimated, or needing a test.
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