Skip to content

NRF52 - power management cleanups (NRF_APM)#11040

Draft
phaseloop wants to merge 6 commits into
meshtastic:developfrom
phaseloop:nrf52-power-cleanup
Draft

NRF52 - power management cleanups (NRF_APM)#11040
phaseloop wants to merge 6 commits into
meshtastic:developfrom
phaseloop:nrf52-power-cleanup

Conversation

@phaseloop

@phaseloop phaseloop commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Small cleanup of redundant power management code:

  • NRF_APM (VBUS detection) is present in all NRF52 chips and there is no point in defining it only in certain variants. It is now set globally in NRF52 architecture.

  • USB power detection in NRF52 is already covered in PowerHAL implementation and is used by analogBatteryLevel class, so USB power and battery charging is now detected properly without any need for NRF52 specific code. That redundant part was removed.

  • PowerHAL VBUS detection (powerHAL_isVBUSConnected()) in analogBatteryLevel class is now used for all devices. If specific platform does not have it implemented - it's just ignored.

  • Enabling INA sensor will use it's readings and ignore NRF_APM VBUS detection as intended.

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ab3d1947-01c5-49d2-82f9-0f733ae6c809

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@phaseloop
phaseloop force-pushed the nrf52-power-cleanup branch from d38dad6 to b9f3f8a Compare July 17, 2026 01:23
@github-actions

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Note

Building this pull request… the flash button, badges and supported-board
list will appear here automatically once CI finishes.

@basement-labs

Copy link
Copy Markdown

cc: @Jorropo - I think you added original code to fix some RAK4631 issues

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.

2 participants