Skip to content

Commit

Permalink
fix: USART IRQ prio for external module
Browse files Browse the repository at this point in the history
Should fix missing bytes in CRSF telemetry stream.
  • Loading branch information
raphaelcoeffic committed Sep 15, 2023
1 parent 2596b0e commit bdac492
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions radio/src/boards/generic_stm32/module_ports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#if defined(INTMODULE_USART)

#define INTMODULE_USART_IRQ_PRIORITY 6
#define INTMODULE_USART_IRQ_PRIORITY 5

static const stm32_usart_t intmoduleUSART = {
.USARTx = INTMODULE_USART,
Expand Down Expand Up @@ -138,7 +138,7 @@ DEFINE_STM32_SERIAL_PORT(ExternalModule, extmoduleUSART, INTMODULE_FIFO_SIZE, 0)
DEFINE_STM32_SOFTSERIAL_PORT(ExternalModule, extmoduleTimer);
#endif

#define TELEMETRY_USART_IRQ_PRIORITY 5
#define TELEMETRY_USART_IRQ_PRIORITY 0
#define TELEMETRY_DMA_IRQ_PRIORITY 0

static void _set_sport_input(uint8_t enable)
Expand Down
3 changes: 3 additions & 0 deletions radio/src/targets/taranis/hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1752,6 +1752,9 @@
// #define INTMODULE_DMA NULL
// #define INTMODULE_DMA_CHANNEL 0
// #define INTMODULE_DMA_STREAM 0
#define INTMODULE_RX_DMA DMA1
#define INTMODULE_RX_DMA_STREAM LL_DMA_STREAM_1
#define INTMODULE_RX_DMA_CHANNEL LL_DMA_CHANNEL_4
#else
#define INTMODULE_PULSES
#define INTMODULE_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_DMA2)
Expand Down
1 change: 1 addition & 0 deletions radio/src/targets/taranis/lcd_driver_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ void lcdHardwareInit()
#endif
LCD_DMA_Stream->FCR = 0x05; // DMA_SxFCR_DMDIS | DMA_SxFCR_FTH_0;

NVIC_SetPriority(LCD_DMA_Stream_IRQn, 7);
NVIC_EnableIRQ(LCD_DMA_Stream_IRQn);
}

Expand Down

0 comments on commit bdac492

Please sign in to comment.