Wismy/frsky new receivers (#7449)

Add internal module OTA
Change virtual keys for X-Lite(S) Lua scripts
This commit is contained in:
WismyYao
2020-03-24 15:15:10 +01:00
committed by GitHub
parent 9e22b1c6c4
commit 629f98a930
31 changed files with 350 additions and 59 deletions
+2 -2
View File
@@ -313,12 +313,12 @@ const char * FrskyDeviceFirmwareUpdate::doFlashFirmware(const char * filename)
}
else {
#if defined(PCBHORUS)
information.productId = FIRMWARE_ID_XJT;
information.productId = FIRMWARE_ID_MODULE_XJT;
#endif
}
#if defined(PCBHORUS)
if (module == INTERNAL_MODULE && information.productId == FIRMWARE_ID_XJT) {
if (module == INTERNAL_MODULE && information.productId == FIRMWARE_ID_MODULE_XJT) {
INTERNAL_MODULE_ON();
RTOS_WAIT_MS(1);
intmoduleSerialStart(38400, true, USART_Parity_No, USART_StopBits_1, USART_WordLength_8b);
+37 -5
View File
@@ -24,6 +24,7 @@
#include "dataconstants.h"
#include "definitions.h"
#include "frsky_pxx2.h"
#include "pulses/modules_helpers.h"
#include "ff.h"
enum FrskyFirmwareProductFamily {
@@ -35,12 +36,43 @@ enum FrskyFirmwareProductFamily {
FIRMWARE_FAMILY_POWER_MANAGEMENT_UNIT,
};
enum FrskyFirmwareProductId {
FIRMWARE_ID_NONE,
FIRMWARE_ID_XJT = 0x01,
FIRMWARE_ID_ISRM = 0x02,
enum FrskyFirmwareModuleProductId {
FIRMWARE_ID_MODULE_NONE,
FIRMWARE_ID_MODULE_XJT = 0x01,
FIRMWARE_ID_MODULE_ISRM = 0x02,
};
enum FrskyFirmwareReceiverProductId {
FIRMWARE_ID_RECEIVER_NONE,
FIRMWARE_ID_RECEIVER_ARCHER = 0xC0, // TODO use the right constant
FIRMWARE_ID_RECEIVER_R9MX = 0xF0, // TODO use the right constant
// TODO fill the table
};
inline bool isReceiverOTAEnabledFromModule(uint8_t moduleIdx, uint8_t productId)
{
switch (productId) {
case FIRMWARE_ID_RECEIVER_ARCHER:
return isModuleISRM(moduleIdx);
case FIRMWARE_ID_RECEIVER_R9MX:
return isModuleR9M(moduleIdx);
// TODO add all those OTA receivers here
/*
"R9-MINI-OTA", // this one has OTA (different bootloader)
"R9-MM-OTA", // this one has OTA (different bootloader)
"R9-SLIM+-OTA", // this one has OTA (different bootloader)
"R9SX", // this one has OTA
*/
default:
return false;
}
}
PACK(struct FrSkyFirmwareInformation {
uint32_t fourcc;
uint8_t headerVersion;
@@ -69,7 +101,7 @@ class FrskyDeviceFirmwareUpdate {
};
public:
FrskyDeviceFirmwareUpdate(ModuleIndex module):
explicit FrskyDeviceFirmwareUpdate(ModuleIndex module):
module(module) {
}