Skip to content

BugFix: Issue #53 - Fix set setInputCurrentLimit() for 900mA. #54

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 1 commit into from
May 20, 2025

Conversation

ir-mark
Copy link
Contributor

@ir-mark ir-mark commented May 19, 2025

Bug: Setting the input current limit to 900mA does not work
Issue #53

Summary: Setting the input current limit to 900mA does not work.

File: BQ24195.cpp
Function: bool PMICClass::setInputCurrentLimit(float current)

Problem: There is a typo preventing correct operation:

Line 350:
if (current >= CURRENT_LIM_900) { current_val = CURRENT_LIM_900; }

should be:
if (current >= 0.9) { current_val = CURRENT_LIM_900; }

Copy link

Memory usage change @ 6484835

Board flash % RAM for global variables %
arduino:mbed_nano:nano33ble 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 🔺 0 - +12 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A
arduino:mbed_portenta:envie_m7:target_core=cm4 N/A N/A N/A N/A
arduino:samd:mkrgsm1400 🔺 0 - +12 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 🔺 0 - +12 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrvidor4000 🔺 0 - +12 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 🔺 0 - +12 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 🔺 0 - +12 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/BatteryCharger
flash
% examples/BatteryCharger
RAM for global variables
% examples/BatteryChargerInterrupt
flash
% examples/BatteryChargerInterrupt
RAM for global variables
% examples/PMICBoostMode
flash
% examples/PMICBoostMode
RAM for global variables
% examples/PMICFaultCheck
flash
% examples/PMICFaultCheck
RAM for global variables
%
arduino:mbed_nano:nano33ble 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect 12 0.0 0 0.0 12 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
arduino:mbed_portenta:envie_m7:target_core=cm4 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
arduino:samd:mkrgsm1400 12 0.0 0 0.0 12 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrnb1500 12 0.0 0 0.0 12 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrvidor4000 12 0.0 0 0.0 12 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwifi1010 12 0.0 0 0.0 12 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:nano_33_iot 12 0.0 0 0.0 12 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/BatteryCharger<br>flash,%,examples/BatteryCharger<br>RAM for global variables,%,examples/BatteryChargerInterrupt<br>flash,%,examples/BatteryChargerInterrupt<br>RAM for global variables,%,examples/PMICBoostMode<br>flash,%,examples/PMICBoostMode<br>RAM for global variables,%,examples/PMICFaultCheck<br>flash,%,examples/PMICFaultCheck<br>RAM for global variables,%
arduino:mbed_nano:nano33ble,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,12,0.0,0,0.0,12,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_portenta:envie_m7,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A
arduino:mbed_portenta:envie_m7:target_core=cm4,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A
arduino:samd:mkrgsm1400,12,0.0,0,0.0,12,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrnb1500,12,0.0,0,0.0,12,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrvidor4000,12,0.0,0,0.0,12,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwifi1010,12,0.0,0,0.0,12,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:nano_33_iot,12,0.0,0,0.0,12,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0

@per1234 per1234 linked an issue May 20, 2025 that may be closed by this pull request
Copy link
Collaborator

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix proposed was previously submitted in #34

That pull request was not merged due to uncertainty regarding additional changes it contained, but the specific parts of that patch that are contained in this PR were approved:

#34 (comment)

And also here:

#35 (comment)

So I will approve this PR based on that previous approval.

Thanks @ir-mark!

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels May 20, 2025
@per1234 per1234 merged commit 8d74082 into arduino-libraries:master May 20, 2025
12 checks passed
@per1234 per1234 self-assigned this May 20, 2025
@ir-mark
Copy link
Contributor Author

ir-mark commented Jun 5, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Setting the input current limit to 900mA does not work
2 participants