Multi module support for Taranis

Reuse some of the DSM2 routines to avoid code duplication.

This first version only implements the protocol on the Taranis. (and not

Telemetry code is currently untested and will not work (Polarity mismatch). The main protocols to use telemetry are FrSky protocols and not a high priority on the Taranis.

Patch v3: Fix myeeprom.h, include option value in menu.
Patch v4: Fix identing, name substructs of modeldata
This commit is contained in:
Arne Schwabe
2016-03-29 21:41:14 +02:00
parent c788ad6add
commit 119e413a6d
13 changed files with 458 additions and 26 deletions
+6 -4
View File
@@ -32,7 +32,7 @@ static void intmodulePxxStop( void ) ;
#endif
static void extmodulePxxStart( void ) ;
static void extmodulePxxStop( void ) ;
#if defined(DSM2)
#if defined(DSM2) || defined(MULTIMODULE)
static void extmoduleDsm2Start( void ) ;
static void extmoduleDsm2Stop( void ) ;
#endif
@@ -61,7 +61,7 @@ void disable_pxx(uint32_t port)
extmodulePxxStop() ;
}
#if defined(DSM2)
#if defined(DSM2) || defined(MULTIMODULE)
void init_dsm2(uint32_t port)
{
if (port == EXTERNAL_MODULE) {
@@ -469,7 +469,7 @@ static void extmodulePxxStop()
}
}
#if defined(DSM2)
#if defined(DSM2) || defined(MULTIMODULE)
static void extmoduleDsm2Start()
{
EXTERNAL_MODULE_ON();
@@ -589,7 +589,9 @@ extern "C" void TIM8_CC_IRQHandler()
EXTMODULE_TIMER->DIER |= TIM_DIER_CC2IE ; // Enable this interrupt
}
#if defined(DSM2)
else if (s_current_protocol[EXTERNAL_MODULE] >= PROTO_DSM2_LP45 && s_current_protocol[EXTERNAL_MODULE] <= PROTO_DSM2_DSMX) {
else if ((s_current_protocol[EXTERNAL_MODULE] >= PROTO_DSM2_LP45 && s_current_protocol[EXTERNAL_MODULE] <= PROTO_DSM2_DSMX) || IS_MULTIMODULE_PROTOCOL (s_current_protocol[EXTERNAL_MODULE]))
{
DMA2_Stream2->CR &= ~DMA_SxCR_EN ; // Disable DMA
DMA2->LIFCR = DMA_LIFCR_CTCIF2 | DMA_LIFCR_CHTIF2 | DMA_LIFCR_CTEIF2 | DMA_LIFCR_CDMEIF2 | DMA_LIFCR_CFEIF2 ; // Write ones to clear bits
DMA2_Stream2->M0AR = CONVERT_PTR_UINT(&modulePulsesData[EXTERNAL_MODULE].dsm2.pulses[1]);