Skip to content

Commit b1cdba1

Browse files
committed
add(airlift): report FW version in boot log
1 parent 120ee47 commit b1cdba1

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

src/Wippersnapper.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,11 @@ class Wippersnapper {
372372
ws_uart *_uartComponent; ///< Instance of UART class
373373

374374
// TODO: does this really need to be global?
375-
uint8_t _macAddr[6]; /*!< Unique network iface identifier */
376-
char sUID[13]; /*!< Unique network iface identifier */
377-
const char *_boardId; /*!< Adafruit IO+ board string */
378-
Adafruit_MQTT *_mqtt; /*!< Reference to Adafruit_MQTT, _mqtt. */
375+
uint8_t _macAddr[6]; /*!< Unique network iface identifier */
376+
char sUID[13]; /*!< Unique network iface identifier */
377+
const char *_airlift_version; /*!< AirLift Firmware version */
378+
const char *_boardId; /*!< Adafruit IO+ board string */
379+
Adafruit_MQTT *_mqtt; /*!< Reference to Adafruit_MQTT, _mqtt. */
379380

380381
secretsConfig _config; /*!< Wippersnapper secrets.json as a struct. */
381382
networkConfig _multiNetworks[3]; /*!< Wippersnapper networks as structs. */

src/network_interfaces/Wippersnapper_AIRLIFT.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class Wippersnapper_AIRLIFT : public Wippersnapper {
195195
*/
196196
/********************************************************/
197197
bool firmwareCheck() {
198-
_fv = WiFi.firmwareVersion();
198+
WS._airlift_version = _fv = WiFi.firmwareVersion();
199199
return compareVersions(_fv, NINAFWVER);
200200
}
201201

@@ -242,6 +242,9 @@ class Wippersnapper_AIRLIFT : public Wippersnapper {
242242
*/
243243
/********************************************************/
244244
void getMacAddr() {
245+
if (_fv == "0.0.1") {
246+
(void)firmwareCheck(); // ensure _fv is set in bootlog
247+
}
245248
byte mac[6] = {0};
246249
WiFi.macAddress(mac);
247250
memcpy(WS._macAddr, mac, sizeof(mac));

src/provisioning/tinyusb/Wippersnapper_FS.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,13 @@ bool Wippersnapper_FS::createBootFile() {
296296
bootFile.print("Board ID: ");
297297
bootFile.println(BOARD_ID);
298298

299+
#if defined(ADAFRUIT_PYPORTAL_M4_TITANO) || defined(USE_AIRLIFT) || \
300+
defined(ADAFRUIT_METRO_M4_AIRLIFT_LITE) || defined(ADAFRUIT_PYPORTAL) || \
301+
defined(ARDUINO_ADAFRUIT_FRUITJAM_RP2350)
302+
bootFile.print("AirLift FW Revision: ");
303+
bootFile.println(WS._airlift_version);
304+
#endif
305+
299306
sprintf(sMAC, "%02X:%02X:%02X:%02X:%02X:%02X", WS._macAddr[0],
300307
WS._macAddr[1], WS._macAddr[2], WS._macAddr[3], WS._macAddr[4],
301308
WS._macAddr[5]);

0 commit comments

Comments
 (0)