Skip to content

Commit

Permalink
Add applyOTA API
Browse files Browse the repository at this point in the history
  • Loading branch information
facchinm committed Aug 8, 2019
1 parent 82534db commit 32de705
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/utility/wifi_drv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1148,4 +1148,16 @@ int8_t WiFiDrv::fileOperation(uint8_t operation, const char *filename, uint8_t f
return _dataLen;
}

void WiFiDrv::applyOTA() {
WAIT_FOR_SLAVE_SELECT();

// Send Command
SpiDrv::sendCmd(APPLY_OTA_COMMAND, PARAM_NUMS_0);

SpiDrv::spiSlaveDeselect();

// don't wait for return; OTA operation should be fire and forget :)
}


WiFiDrv wiFiDrv;
2 changes: 2 additions & 0 deletions src/utility/wifi_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ class WiFiDrv
return length >= 0;
};

static void applyOTA();

friend class WiFiUDP;
friend class WiFiClient;
};
Expand Down

0 comments on commit 32de705

Please sign in to comment.