NRF52 - power management cleanups (NRF_APM)#11040
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
d38dad6 to
b9f3f8a
Compare
⚡ Try this PR in the Web FlasherNote Building this pull request… the flash button, badges and supported-board |
|
cc: @Jorropo - I think you added original code to fix some RAK4631 issues |
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