Skip to content

Commit da92e9e

Browse files
SpiDrv avoid resetting the nina chip every time, unless forced
1 parent 8e6e90d commit da92e9e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/utility/spi_drv.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,12 @@ bool SpiDrv::initialized = false;
7070

7171
extern WiFiClass WiFi;
7272

73-
void SpiDrv::begin()
73+
void SpiDrv::begin(bool force)
7474
{
75+
if(initialized && !force) {
76+
return;
77+
}
78+
7579
#ifdef ARDUINO_SAMD_MKRVIDOR4000
7680
FPGA.begin();
7781
#endif

src/utility/spi_drv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class SpiDrv
4747
public:
4848
static bool initialized;
4949

50-
static void begin();
50+
static void begin(bool force=false);
5151

5252
static void end();
5353

0 commit comments

Comments
 (0)