Skip to content

Commit bc6ea2c

Browse files
authored
Fix BatteryChargerInterrupt compilation error (arduino-libraries#21)
Fix BatteryChargerInterrupt compilation error on gsm, nb and 1010
1 parent 8d7fd01 commit bc6ea2c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

examples/BatteryChargerInterrupt/BatteryChargerInterrupt.ino

+3-4
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ void setup() {
2323
; // wait for serial port to connect. Needed for native USB port only
2424
}
2525

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

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

7376
// loop until charge is done
7477
if (PMIC.chargeStatus() != CHARGE_TERMINATION_DONE) {
75-
Serial.println("Charge mode");
76-
Serial.println(PMIC.isCharging());
7778
delay(1000);
7879
} else {
7980
// Disable the charger
80-
8181
Serial.println("Disable Charge mode");
8282
if (!PMIC.disableCharge()) {
8383
Serial.println("Error disabling Charge mode");
8484
}
8585
// if you really want to detach the battery call
8686
// PMIC.disableBATFET();
8787
//isbatteryconnected = false;
88-
8988
}
9089
}
9190
}

examples/PMICBoostMode/PMICBoostMode.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include <Arduino_PMIC.h>
1717

18-
int usb_mode = UNKNOWM_MODE;
18+
int usb_mode = UNKNOWN_MODE;
1919

2020
void setup()
2121
{

0 commit comments

Comments
 (0)