mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2026-12-06 07:37:38 +00:00
Futaba: T-FHSS Surface and SR left out of AIR builds (#1216)
The serial AIR firmware (MULTI_AIR) no longer fit the 128KB STM32 after T-FHSS and FrSkyA: 476 bytes over. T-FHSS Surface and SR are surface sub protocols (cars, boats), so AIR builds keep T-FHSS Air only, as DSM drops DSMR and DSM2_SFC there: FUTABA_init() invalidates TFHSS and TFHSS_SR, and their code isn't linked. -1060 bytes, AIR now 120224 of 120808. Co-authored-by: Raphael Coeffic <1050031+raphaelcoeffic@users.noreply.github.com>
This commit is contained in:
1 parent
56c286c379
commit
eea0a0f3c2
2 files changed
+16
-1
No files matched your search
@@ -590,6 +590,9 @@ static uint16_t __attribute__((unused)) TFHSS_callback()
|
|||||||
phase = TFHSS_DATA;
|
phase = TFHSS_DATA;
|
||||||
return 1000;
|
return 1000;
|
||||||
}
|
}
|
||||||
|
#ifdef MULTI_AIR
|
||||||
|
return TFHSS_air_callback(); // Surface and SR: not in AIR builds
|
||||||
|
#else
|
||||||
if(sub_protocol == TFHSS_AIR)
|
if(sub_protocol == TFHSS_AIR)
|
||||||
return TFHSS_air_callback();
|
return TFHSS_air_callback();
|
||||||
|
|
||||||
@@ -634,6 +637,7 @@ static uint16_t __attribute__((unused)) TFHSS_callback()
|
|||||||
return TFHSS_PERIOD - TFHSS_RX_ON;
|
return TFHSS_PERIOD - TFHSS_RX_ON;
|
||||||
}
|
}
|
||||||
return TFHSS_PERIOD;
|
return TFHSS_PERIOD;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __attribute__((unused)) TFHSS_init()
|
static void __attribute__((unused)) TFHSS_init()
|
||||||
@@ -643,9 +647,13 @@ static void __attribute__((unused)) TFHSS_init()
|
|||||||
for(uint8_t i = 0; i < 4; i++)
|
for(uint8_t i = 0; i < 4; i++)
|
||||||
TFHSS_id[i] = id >> (8 * i);
|
TFHSS_id[i] = id >> (8 * i);
|
||||||
// Surface: the receiver's ID from the last bind of this model
|
// Surface: the receiver's ID from the last bind of this model
|
||||||
|
#ifdef MULTI_AIR
|
||||||
|
memset(TFHSS_rx_id, 0, 4);
|
||||||
|
#else
|
||||||
uint16_t addr = TFHSS_eeprom();
|
uint16_t addr = TFHSS_eeprom();
|
||||||
for(uint8_t i = 0; i < 4; i++)
|
for(uint8_t i = 0; i < 4; i++)
|
||||||
TFHSS_rx_id[i] = sub_protocol == TFHSS_AIR ? 0 : eeprom_read_byte((EE_ADDR)(addr + i));
|
TFHSS_rx_id[i] = sub_protocol == TFHSS_AIR ? 0 : eeprom_read_byte((EE_ADDR)(addr + i));
|
||||||
|
#endif
|
||||||
TFHSS_row = id % TFHSS_CHANNELS;
|
TFHSS_row = id % TFHSS_CHANNELS;
|
||||||
TFHSS_rx_known = false;
|
TFHSS_rx_known = false;
|
||||||
TFHSS_misses = 0;
|
TFHSS_misses = 0;
|
||||||
@@ -686,6 +694,13 @@ uint16_t FUTABA_callback()
|
|||||||
|
|
||||||
void FUTABA_init()
|
void FUTABA_init()
|
||||||
{
|
{
|
||||||
|
#ifdef MULTI_AIR
|
||||||
|
if(sub_protocol == TFHSS || sub_protocol == TFHSS_SR)
|
||||||
|
{ // Surface sub protocols: SURFACE and full builds only (space)
|
||||||
|
SUB_PROTO_INVALID;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if(sub_protocol == SFHSS)
|
if(sub_protocol == SFHSS)
|
||||||
SFHSS_init();
|
SFHSS_init();
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1175,7 +1175,7 @@ Settings include:
|
|||||||
* setting failsafe values
|
* setting failsafe values
|
||||||
|
|
||||||
## Futaba - *21*
|
## Futaba - *21*
|
||||||
Also called SFHSS depending on radio version. Sub protocols S-FHSS, T-FHSS (Surface), T-FHSS SR and T-FHSS Air. The T-FHSS sub protocols are only available on the 128KB STM32 modules.
|
Also called SFHSS depending on radio version. Sub protocols S-FHSS, T-FHSS (Surface), T-FHSS SR and T-FHSS Air. The T-FHSS sub protocols are only available on the 128KB STM32 modules, and the AIR firmwares only have T-FHSS Air (TFHSS and TFHSS_SR are surface sub protocols).
|
||||||
|
|
||||||
### Sub_protocol SFHSS - *0*
|
### Sub_protocol SFHSS - *0*
|
||||||
Models: Futaba SFHSS RXs and some XK models.
|
Models: Futaba SFHSS RXs and some XK models.
|
||||||
|
|||||||
Reference in new issue
Block a user