Move all serial internal module functions into proper drivers

This commit is contained in:
Raphael Coeffic
2022-03-20 16:22:12 +01:00
parent f733810c79
commit 803b472c85
15 changed files with 216 additions and 81 deletions
@@ -0,0 +1,27 @@
/*
* Copyright (C) EdgeTX
*
* Based on code named
* opentx - https://github.com/opentx/opentx
* 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.
*/
#pragma once
void init_intmodule_heartbeat();
void check_intmodule_heartbeat();
void stop_intmodule_heartbeat();
@@ -20,6 +20,7 @@
*/
#include "opentx.h"
#include "heartbeat_driver.h"
uint8_t rotencPosition;
-3
View File
@@ -194,9 +194,6 @@ void SDRAM_Init();
#define IS_PXX1_INTERNAL_ENABLED() (true)
#endif
void init_intmodule_heartbeat();
void check_intmodule_heartbeat();
void extmoduleSerialStart();
void extmoduleInvertedSerialStart(uint32_t baudrate);
void extmoduleSendBuffer(const uint8_t * data, uint8_t size);
+1 -1
View File
@@ -345,7 +345,7 @@ void extmoduleSendNextFrame()
#if defined(PXX2) && defined(EXTMODULE_USART)
case PROTOCOL_CHANNELS_PXX2_HIGHSPEED:
case PROTOCOL_CHANNELS_PXX2_LOWSPEED:
extmoduleSendBuffer(extmodulePulsesData.pxx2.getData(), extmodulePulsesData.pxx2.getSize());
Pxx2ModuleDriver.sendPulses((void*)EXTERNAL_MODULE);
break;
#endif
-10
View File
@@ -192,16 +192,6 @@ void extmoduleSendInvertedByte(uint8_t byte);
#define stop_trainer_module_sbus()
#endif
#if defined(INTMODULE_HEARTBEAT_GPIO)
void init_intmodule_heartbeat();
void stop_intmodule_heartbeat();
void check_intmodule_heartbeat();
#else
#define init_intmodule_heartbeat()
#define stop_intmodule_heartbeat()
#define check_intmodule_heartbeat()
#endif
void check_telemetry_exti();
// SBUS
@@ -21,6 +21,10 @@
#include "opentx.h"
#if defined(CROSSFIRE)
#include "pulses/crossfire.h"
#endif
void extmoduleStop()
{
NVIC_DisableIRQ(EXTMODULE_TIMER_DMA_STREAM_IRQn);
@@ -286,7 +290,7 @@ void extmoduleSendNextFrame()
#if defined(PXX2)
case PROTOCOL_CHANNELS_PXX2_HIGHSPEED:
case PROTOCOL_CHANNELS_PXX2_LOWSPEED:
extmoduleSendBuffer(extmodulePulsesData.pxx2.getData(), extmodulePulsesData.pxx2.getSize());
Pxx2ModuleDriver.sendPulses((void*)EXTERNAL_MODULE);
break;
#endif
#endif
@@ -295,7 +299,8 @@ void extmoduleSendNextFrame()
case PROTOCOL_CHANNELS_AFHDS3:
{
#if defined(EXTMODULE_USART) && defined(EXTMODULE_TX_INVERT_GPIO)
extmoduleSendBuffer(extmodulePulsesData.afhds3.getData(), extmodulePulsesData.afhds3.getSize());
extmoduleSendBuffer(extmodulePulsesData.afhds3.getData(),
extmodulePulsesData.afhds3.getSize());
#else
if (EXTMODULE_TIMER_DMA_STREAM->CR & DMA_SxCR_EN)
return;