Autoupdates for the bluetooth chip
This commit is contained in:
+16
-3
@@ -1802,9 +1802,22 @@ void opentxInit()
|
||||
|
||||
#if defined(AUTOUPDATE)
|
||||
if (f_stat(AUTOUPDATE_FILENAME, nullptr) == FR_OK) {
|
||||
FrskyChipFirmwareUpdate device;
|
||||
if (device.flashFirmware(AUTOUPDATE_FILENAME, false) == nullptr)
|
||||
f_unlink(AUTOUPDATE_FILENAME);
|
||||
FrSkyFirmwareInformation information;
|
||||
if (readFirmwareInformation(AUTOUPDATE_FILENAME, information) == nullptr) {
|
||||
#if defined(BLUETOOTH)
|
||||
if (information.productFamily == FIRMWARE_FAMILY_BLUETOOTH_CHIP) {
|
||||
if (bluetooth.flashFirmware(AUTOUPDATE_FILENAME) == nullptr)
|
||||
f_unlink(AUTOUPDATE_FILENAME);
|
||||
}
|
||||
#endif
|
||||
#if defined(HARDWARE_POWER_MANAGEMENT_UNIT)
|
||||
if (information.productFamily == FIRMWARE_FAMILY_POWER_MANAGEMENT_UNIT) {
|
||||
FrskyChipFirmwareUpdate device;
|
||||
if (device.flashFirmware(AUTOUPDATE_FILENAME, false) == nullptr)
|
||||
f_unlink(AUTOUPDATE_FILENAME);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user