Tx16s sbus in (#7787)

Enable SBUS trainer input
This commit is contained in:
3djc
2020-07-07 15:56:18 +02:00
committed by GitHub
parent 94ba22a74d
commit 0eb203e827
9 changed files with 96 additions and 19 deletions
+9
View File
@@ -66,6 +66,7 @@ if (PCB STREQUAL X10)
set(HARDWARE_TOUCH YES)
set(USB_CHARGER YES)
set(DEFAULT_THEME "DARKBLUE")
set(SBUS ON)
set(AUX_SERIAL ON)
if (NOT BLUETOOTH AND NOT INTERNAL_GPS)
set(AUX2_SERIAL ON)
@@ -254,6 +255,14 @@ if (AUX2_SERIAL)
set(AUX_SERIAL_DRIVER ../common/arm/stm32/aux_serial_driver.cpp)
endif()
if (SBUS)
add_definitions(-DSBUS)
set(SRC
${SRC}
sbus.cpp
)
endif()
set(FIRMWARE_TARGET_SRC
${FIRMWARE_TARGET_SRC}
${LCD_DRIVER}
+3
View File
@@ -197,6 +197,9 @@ void stop_trainer_ppm();
void init_trainer_capture();
void stop_trainer_capture();
// SBUS
int sbusGetByte(uint8_t * byte);
// Keys driver
enum EnumKeys
{
@@ -20,6 +20,10 @@
#include "opentx.h"
#if defined(SBUS)
Fifo<uint8_t, 32> trainerSbusFifo;
#endif
void trainerSendNextFrame();
void init_trainer_ppm()
@@ -152,3 +156,15 @@ extern "C" void TRAINER_TIMER_IRQHandler()
trainerSendNextFrame();
}
}
int sbusGetByte(uint8_t * byte)
{
switch (currentTrainerMode) {
#if defined(AUX_SERIAL)
case TRAINER_MODE_MASTER_BATTERY_COMPARTMENT:
return trainerSbusFifo.pop(*byte);
#endif
default:
return false;
}
}