Pulses refactoring (another one!) (#6510)
Pulses refactoring (another one!)
This commit is contained in:
@@ -208,31 +208,15 @@ void SDRAM_Init(void);
|
||||
#define IS_PXX1_INTERNAL_ENABLED() (true)
|
||||
#endif
|
||||
|
||||
void init_ppm(uint8_t module);
|
||||
void disable_ppm(uint8_t module);
|
||||
void init_pxx1_pulses(uint8_t module);
|
||||
void init_pxx1_serial(uint8_t module);
|
||||
void disable_pxx1_pulses(uint8_t module);
|
||||
void disable_pxx1_serial(uint8_t module);
|
||||
void init_pxx2(uint8_t module);
|
||||
void disable_pxx2(uint8_t module);
|
||||
void disable_serial(uint8_t module);
|
||||
|
||||
void init_intmodule_heartbeat();
|
||||
void check_intmodule_heartbeat();
|
||||
|
||||
void intmoduleStop();
|
||||
void intmoduleSerialStart(uint32_t baudrate, uint8_t rxEnable);
|
||||
void intmodulePxxStart();
|
||||
void intmoduleSendBuffer(const uint8_t * data, uint8_t size);
|
||||
void intmoduleSendNextFrame();
|
||||
|
||||
void extmoduleSerialStart(uint32_t baudrate, uint32_t period_half_us, bool inverted);
|
||||
void extmoduleSendNextFrame();
|
||||
void extmoduleStop();
|
||||
void extmodulePpmStart();
|
||||
void extmodulePxxStart();
|
||||
void extmodulePxx2Start();
|
||||
|
||||
// Trainer driver
|
||||
void init_trainer_ppm(void);
|
||||
|
||||
@@ -83,7 +83,7 @@ void extmodulePpmStart()
|
||||
NVIC_SetPriority(EXTMODULE_TIMER_IRQn, 7);
|
||||
}
|
||||
|
||||
void extmodulePxxStart()
|
||||
void extmodulePxx1PulsesStart()
|
||||
{
|
||||
EXTERNAL_MODULE_ON();
|
||||
|
||||
@@ -127,11 +127,6 @@ void extmodulePxxStart()
|
||||
NVIC_SetPriority(EXTMODULE_TIMER_IRQn, 7);
|
||||
}
|
||||
|
||||
void extmodulePxx2Start()
|
||||
{
|
||||
// TODO just enable the S.PORT line (or let telemetry init do it)
|
||||
}
|
||||
|
||||
#if defined(DSM2)
|
||||
void extmoduleSerialStart(uint32_t /*baudrate*/, uint32_t period_half_us, bool inverted)
|
||||
{
|
||||
@@ -284,6 +279,6 @@ extern "C" void EXTMODULE_TIMER_IRQHandler()
|
||||
{
|
||||
EXTMODULE_TIMER->DIER &= ~TIM_DIER_CC2IE; // Stop this interrupt
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_CC2IF;
|
||||
if (setupPulses(EXTERNAL_MODULE))
|
||||
if (setupPulsesExternalModule())
|
||||
extmoduleSendNextFrame();
|
||||
}
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
void init_ppm(uint8_t module)
|
||||
{
|
||||
if (module == EXTERNAL_MODULE) {
|
||||
extmodulePpmStart();
|
||||
}
|
||||
}
|
||||
|
||||
void disable_ppm(uint8_t module)
|
||||
{
|
||||
if (module == EXTERNAL_MODULE) {
|
||||
extmoduleStop();
|
||||
}
|
||||
}
|
||||
|
||||
void init_pxx2(uint8_t module)
|
||||
{
|
||||
if (module == INTERNAL_MODULE)
|
||||
intmoduleSerialStart(INTMODULE_PXX_BAUDRATE, true);
|
||||
else
|
||||
extmodulePxx2Start();
|
||||
}
|
||||
|
||||
void disable_pxx2(uint8_t module)
|
||||
{
|
||||
if (module == INTERNAL_MODULE)
|
||||
intmoduleStop();
|
||||
else
|
||||
extmoduleStop();
|
||||
}
|
||||
|
||||
void init_pxx1_pulses(uint8_t module)
|
||||
{
|
||||
if (module == INTERNAL_MODULE)
|
||||
intmodulePxxStart();
|
||||
else
|
||||
extmodulePxxStart();
|
||||
}
|
||||
|
||||
void init_pxx1_serial(uint8_t module)
|
||||
{
|
||||
if (module == INTERNAL_MODULE)
|
||||
intmodulePxxStart();
|
||||
else
|
||||
extmodulePxxStart();
|
||||
}
|
||||
|
||||
void disable_pxx1_pulses(uint8_t module)
|
||||
{
|
||||
if (module == INTERNAL_MODULE)
|
||||
intmoduleStop();
|
||||
else
|
||||
extmoduleStop();
|
||||
}
|
||||
|
||||
void disable_pxx1_serial(uint8_t module)
|
||||
{
|
||||
if (module == INTERNAL_MODULE)
|
||||
intmoduleStop();
|
||||
else
|
||||
extmoduleStop();
|
||||
}
|
||||
|
||||
#if defined(DSM2)
|
||||
void disable_serial(uint8_t module)
|
||||
{
|
||||
if (module == EXTERNAL_MODULE) {
|
||||
extmoduleStop();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user