From dc61c93455a9ab2b03f0e7a5e8979b6807da8999 Mon Sep 17 00:00:00 2001 From: Julius Jurgelenas Date: Sun, 15 Sep 2024 17:50:09 +0300 Subject: [PATCH] Fix RX_AS_TX for esp32-c3 targets --- src/api/src/factories/TargetUserDefinesFactory.ts | 4 ++-- .../BinaryFlashingStrategy/DeviceDescriptionsLoader/index.ts | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/api/src/factories/TargetUserDefinesFactory.ts b/src/api/src/factories/TargetUserDefinesFactory.ts index b1d00a8e..e7555d5a 100644 --- a/src/api/src/factories/TargetUserDefinesFactory.ts +++ b/src/api/src/factories/TargetUserDefinesFactory.ts @@ -91,10 +91,10 @@ export default class TargetUserDefinesFactory { return UserDefine.Text(UserDefineKey.AUTO_WIFI_ON_INTERVAL, '60', true); case UserDefineKey.RX_AS_TX: let rxAxTxTypes: string[] = []; - if (this.platform === 'esp32') { + if (this.platform?.startsWith('esp32')) { rxAxTxTypes = ['internal', 'external']; } - if (this.platform === 'esp8285') { + if (this.platform?.startsWith('esp8285')) { rxAxTxTypes = ['internal']; } return UserDefine.Enum(UserDefineKey.RX_AS_TX, rxAxTxTypes, 'internal'); diff --git a/src/api/src/services/BinaryFlashingStrategy/DeviceDescriptionsLoader/index.ts b/src/api/src/services/BinaryFlashingStrategy/DeviceDescriptionsLoader/index.ts index 5568c943..e994887f 100644 --- a/src/api/src/services/BinaryFlashingStrategy/DeviceDescriptionsLoader/index.ts +++ b/src/api/src/services/BinaryFlashingStrategy/DeviceDescriptionsLoader/index.ts @@ -395,7 +395,10 @@ export default class DeviceDescriptionsLoader { userDefines.push( targetUserDefinesFactory.build(UserDefineKey.LOCK_ON_FIRST_CONNECTION) ); - if (config.platform !== 'stm32') { + if ( + config.platform.startsWith('esp32') || + config.platform.startsWith('esp8285') + ) { userDefines.push( targetUserDefinesFactory.build(UserDefineKey.RX_AS_TX) );