Skip to content

Commit bdac492

Browse files
fix: USART IRQ prio for external module
Should fix missing bytes in CRSF telemetry stream.
1 parent 2596b0e commit bdac492

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

radio/src/boards/generic_stm32/module_ports.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
#if defined(INTMODULE_USART)
3131

32-
#define INTMODULE_USART_IRQ_PRIORITY 6
32+
#define INTMODULE_USART_IRQ_PRIORITY 5
3333

3434
static const stm32_usart_t intmoduleUSART = {
3535
.USARTx = INTMODULE_USART,
@@ -138,7 +138,7 @@ DEFINE_STM32_SERIAL_PORT(ExternalModule, extmoduleUSART, INTMODULE_FIFO_SIZE, 0)
138138
DEFINE_STM32_SOFTSERIAL_PORT(ExternalModule, extmoduleTimer);
139139
#endif
140140

141-
#define TELEMETRY_USART_IRQ_PRIORITY 5
141+
#define TELEMETRY_USART_IRQ_PRIORITY 0
142142
#define TELEMETRY_DMA_IRQ_PRIORITY 0
143143

144144
static void _set_sport_input(uint8_t enable)

radio/src/targets/taranis/hal.h

+3
Original file line numberDiff line numberDiff line change
@@ -1752,6 +1752,9 @@
17521752
// #define INTMODULE_DMA NULL
17531753
// #define INTMODULE_DMA_CHANNEL 0
17541754
// #define INTMODULE_DMA_STREAM 0
1755+
#define INTMODULE_RX_DMA DMA1
1756+
#define INTMODULE_RX_DMA_STREAM LL_DMA_STREAM_1
1757+
#define INTMODULE_RX_DMA_CHANNEL LL_DMA_CHANNEL_4
17551758
#else
17561759
#define INTMODULE_PULSES
17571760
#define INTMODULE_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_DMA2)

radio/src/targets/taranis/lcd_driver_spi.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ void lcdHardwareInit()
108108
#endif
109109
LCD_DMA_Stream->FCR = 0x05; // DMA_SxFCR_DMDIS | DMA_SxFCR_FTH_0;
110110

111+
NVIC_SetPriority(LCD_DMA_Stream_IRQn, 7);
111112
NVIC_EnableIRQ(LCD_DMA_Stream_IRQn);
112113
}
113114

0 commit comments

Comments
 (0)