Skip to content

Commit 32de705

Browse files
committed
Add applyOTA API
1 parent 82534db commit 32de705

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/utility/wifi_drv.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,4 +1148,16 @@ int8_t WiFiDrv::fileOperation(uint8_t operation, const char *filename, uint8_t f
11481148
return _dataLen;
11491149
}
11501150

1151+
void WiFiDrv::applyOTA() {
1152+
WAIT_FOR_SLAVE_SELECT();
1153+
1154+
// Send Command
1155+
SpiDrv::sendCmd(APPLY_OTA_COMMAND, PARAM_NUMS_0);
1156+
1157+
SpiDrv::spiSlaveDeselect();
1158+
1159+
// don't wait for return; OTA operation should be fire and forget :)
1160+
}
1161+
1162+
11511163
WiFiDrv wiFiDrv;

src/utility/wifi_drv.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ class WiFiDrv
306306
return length >= 0;
307307
};
308308

309+
static void applyOTA();
310+
309311
friend class WiFiUDP;
310312
friend class WiFiClient;
311313
};

0 commit comments

Comments
 (0)