8000 Nicla_System: specify if mounted on MKR via begin() · karlsoderby/ArduinoCore-mbed@bebe478 · GitHub
[go: up one dir, main page]

Skip to content

Commit bebe478

Browse files
committed
Nicla_System: specify if mounted on MKR via begin()
1 parent 04ccf55 commit bebe478

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

libraries/Nicla_System/src/Nicla_System.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ void nicla::pingI2CThd() {
2323
}
2424
}
2525

26-
bool nicla::begin()
26+
bool nicla::begin(bool mounted_on_mkr)
2727
{
28-
pinMode(p25, OUTPUT);
29-
pinMode(P0_10, OUTPUT);
30-
digitalWrite(P0_10, HIGH);
28+
if (mounted_on_mkr) {
29+
// GPIO3 is on MKR RESET pin, so we must configure it HIGH or it will, well, reset the board :)
30+
pinMode(p25, OUTPUT);
31+
pinMode(P0_10, OUTPUT);
32+
digitalWrite(P0_10, HIGH);
33+
}
3134
Wire1.begin();
3235
_chg_reg = _pmic.readByte(BQ25120A_ADDRESS, BQ25120A_FAST_CHG);
3336
#ifndef NO_NEED_FOR_WATCHDOG_THREAD

libraries/Nicla_System/src/Nicla_System.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
class nicla {
2424

2525
public:
26-
static bool begin();
26+
static bool begin(bool mounted_on_mkr = false);
2727
static bool enable3V3LDO();
2828
static bool enable1V8LDO();
2929
static bool disableLDO();

0 commit comments

Comments
 (0)
0