Skip to content

Commit

Permalink
SpiDrv avoid resetting the nina chip every time, unless forced
Browse files Browse the repository at this point in the history
  • Loading branch information
andreagilardoni committed Jan 21, 2025
1 parent 83ba122 commit 95c0b15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/utility/spi_drv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ bool SpiDrv::initialized = false;

extern WiFiClass WiFi;

void SpiDrv::begin()
void SpiDrv::begin(bool force)
{
if(initialized && !force) {
return;
}

#ifdef ARDUINO_SAMD_MKRVIDOR4000
FPGA.begin();
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/utility/spi_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class SpiDrv
public:
static bool initialized;

static void begin();
static void begin(bool force=false);

static void end();

Expand Down

0 comments on commit 95c0b15

Please sign in to comment.