Skip to content

Fix BatteryChargerInterrupt compilation error #21

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
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions examples/BatteryChargerInterrupt/BatteryChargerInterrupt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ void setup() {
; // wait for serial port to connect. Needed for native USB port only
}

// Available only for MKRGSM1400 and MKRNB1500
#if defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRNB1500)
// Attach the PMIC IRQ pin
attachInterrupt(digitalPinToInterrupt(PMIC_IRQ_PIN), batteryConnected, FALLING);
#endif

if (!PMIC.begin()) {
Serial.println("Failed to initialize PMIC!");
Expand Down Expand Up @@ -72,20 +75,16 @@ void loop() {

// loop until charge is done
if (PMIC.chargeStatus() != CHARGE_TERMINATION_DONE) {
Serial.println("Charge mode");
Serial.println(PMIC.isCharging());
delay(1000);
} else {
// Disable the charger

Serial.println("Disable Charge mode");
if (!PMIC.disableCharge()) {
Serial.println("Error disabling Charge mode");
}
// if you really want to detach the battery call
// PMIC.disableBATFET();
//isbatteryconnected = false;

}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/PMICBoostMode/PMICBoostMode.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include <Arduino_PMIC.h>

int usb_mode = UNKNOWM_MODE;
int usb_mode = UNKNOWN_MODE;

void setup()
{
Expand Down