File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
src/api/src/services/BinaryFlashingStrategy Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -339,8 +339,20 @@ export default class BinaryFlashingStrategyService implements FlashingStrategy {
339339 return `${ regulatoryDomain } /${ platformioTarget } /firmware.bin` ;
340340 }
341341
342- getCompileTarget ( config : DeviceDescription ) : string {
343- let target = `${ config . firmware } _via_UART` ;
342+ getCompileTarget (
343+ config : DeviceDescription ,
344+ userDefines : UserDefine [ ]
345+ ) : string {
346+ const rxAsTx =
347+ userDefines . find ( ( item ) => {
348+ return item . key === UserDefineKey . RX_AS_TX && item . enabled ;
349+ } ) !== undefined ;
350+ const firmwareName = rxAsTx
351+ ? config . firmware . replace ( '_RX' , '_TX' )
352+ : config . firmware ;
353+
354+ let target = `${ firmwareName } _via_UART` ;
355+
344356 if ( config . upload_methods . includes ( 'stlink' ) ) {
345357 target = `${ config . firmware } _via_STLINK` ;
346358 }
@@ -510,7 +522,7 @@ export default class BinaryFlashingStrategyService implements FlashingStrategy {
510522
511523 // we were not able to find cloud binaries, so we will build them on the spot
512524 if ( firmwareDescriptionsPath === firmwareSourcePath ) {
513- const target = this . getCompileTarget ( config ) ;
525+ const target = this . getCompileTarget ( config , params . userDefines ) ;
514526 sourceFirmwareBinPath = await this . compileBinary (
515527 target ,
516528 firmwareSourcePath ,
You can’t perform that action at this time.
0 commit comments