Serial pass-through

This commit is contained in:
Raphael Coeffic
2021-11-21 11:18:35 +01:00
committed by Raphael Coeffic
parent 1f0480532d
commit c8a4a80ffd
6 changed files with 138 additions and 4 deletions
@@ -1,6 +1,7 @@
set(TIMERS 3 CACHE STRING "Timers count (2 or 3)")
set_property(CACHE TIMERS PROPERTY STRINGS 2 3)
option(CLI "Command Line Interface" OFF)
option(ENABLE_SERIAL_PASSTHROUGH "Enable serial passthrough" OFF)
option(DEBUG "Debug mode" OFF)
option(LOG_TELEMETRY "Telemetry Logs on SD card" OFF)
option(LOG_BLUETOOTH "Bluetooth Logs on SD card" OFF)
@@ -101,6 +102,10 @@ if(CLI OR DEBUG)
set(SRC ${SRC} dump.cpp)
endif()
if(ENABLE_SERIAL_PASSTHROUGH)
add_definitions(-DENABLE_SERIAL_PASSTHROUGH)
endif()
if(DEBUG)
add_definitions(-DDEBUG)
endif()
@@ -205,3 +205,15 @@ void intmoduleSendNextFrame()
#endif
}
}
void intmoduleWaitForTxCompleted()
{
#if defined(INTMODULE_DMA_STREAM)
if (DMA_GetCmdStatus(INTMODULE_DMA_STREAM) == ENABLE) {
while(DMA_GetFlagStatus(INTMODULE_DMA_STREAM, INTMODULE_DMA_FLAG_TC) == RESET);
DMA_ClearFlag(INTMODULE_DMA_STREAM, INTMODULE_DMA_FLAG_TC);
}
#else
#error "intmoduleWaitForTC() not implemented for IRQ based transfer"
#endif
}
+1
View File
@@ -106,6 +106,7 @@ if (PCB STREQUAL X10)
set(AUX2_SERIAL ON)
endif()
set(INTERNAL_GPS_BAUDRATE "9600" CACHE STRING "Baud rate for internal GPS")
set(ENABLE_SERIAL_PASSTHROUGH ON CACHE BOOL "Enable serial passthrough")
set(CLI ON CACHE BOOL "Enable CLI")
elseif (PCBREV STREQUAL T18)
set(FLAVOUR t18)
+1
View File
@@ -202,6 +202,7 @@ void intmoduleSerialStart(uint32_t baudrate, uint8_t rxEnable, uint16_t parity,
void intmoduleSendByte(uint8_t byte);
void intmoduleSendBuffer(const uint8_t * data, uint8_t size);
void intmoduleSendNextFrame();
void intmoduleWaitForTxCompleted();
void extmoduleSerialStart();
void extmoduleInvertedSerialStart(uint32_t baudrate);
+1 -1
View File
@@ -817,7 +817,7 @@
#define INTMODULE_DMA_STREAM DMA2_Stream7
#define INTMODULE_DMA_STREAM_IRQ DMA2_Stream7_IRQn
#define INTMODULE_DMA_STREAM_IRQHandler DMA2_Stream7_IRQHandler
#define INTMODULE_DMA_FLAG_TC DMA_IT_TCIF7
#define INTMODULE_DMA_FLAG_TC DMA_FLAG_TCIF7
#define INTMODULE_DMA_CHANNEL DMA_Channel_4
#if defined(PCBX12S)
#define INTMODULE_BOOTCMD_GPIO GPIOC