Skip to content

Generate a power_manager object for MSPM0 and HPM - #30

Merged
Jiu-xiao merged 1 commit into
devfrom
feat/mspm0-hpm-power-manager-20261008
Oct 10, 2026
Merged

Jiu-xiao merged 1 commit into
devfrom
feat/mspm0-hpm-power-manager-20261008

Conversation

@Jiu-xiao

@Jiu-xiao Jiu-xiao commented Oct 8, 2026

Copy link
Copy Markdown
Member

Follows STM32: the MSPM0 and HPM generators now always emit static MSPM0PowerManager power_manager; / static HPMPowerManager power_manager; after PlatformInit() and include mspm0_power.hpp / hpm_power.hpp; with XRobot the object is registered as a PowerManager (initialize_registry(use_xrobot) registers it first, so GPIO renames cannot take its name — on MSPM0 via registered_devices, on HPM additionally via GENERATED_NAMES).

Depends on xrobot-org/libxr#335 (the generated code does not compile against a LibXR without the MSPM0/HPM power managers).

  • expected app_main fixtures of the five test projects regenerated from the actual output (each gains the include, the object line and the XR_REGISTER(power_manager, LibXR::PowerManager); line);
  • one new test per platform: without XRobot the object is generated but nothing is registered, with XRobot it is registered, and renaming a GPIO to power_manager fails generation;
  • the README sections of MSPM0 and HPM mention the generated power_manager.

Verified: python -m unittest discover -s tests -p "test_*.py" — 509 tests OK (6 skipped), ruff check and ruff format --check clean.

MSPM0 and HPM now emit static MSPM0PowerManager / HPMPowerManager power_manager
after PlatformInit and include mspm0_power.hpp / hpm_power.hpp; with XRobot the
object is registered as a PowerManager (like STM32), and GPIO renames cannot
take its name. The expected app_main fixtures and the README sections of both
platforms follow.
@Jiu-xiao
Jiu-xiao merged commit 4d22e6f into dev Oct 10, 2026
54 checks passed
@Jiu-xiao
Jiu-xiao deleted the feat/mspm0-hpm-power-manager-20261008 branch October 11, 2026 02:33
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