Skip to content

Commit 5ad1de1

Browse files
jihleinmlyle
authored andcommitted
Flight: Lux target RX port definition
1 parent e20b4fa commit 5ad1de1

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

flight/targets/lux/board-info/board_hw_defs.c

+25
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,31 @@ static const struct pios_usart_cfg pios_main_usart_cfg = {
360360
.pin_source = GPIO_PinSource10,
361361
},
362362
};
363+
364+
static const struct pios_usart_cfg pios_rcvr_usart_cfg = {
365+
.regs = USART1,
366+
.remap = GPIO_AF_7,
367+
.irq = {
368+
.init = {
369+
.NVIC_IRQChannel = USART1_IRQn,
370+
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGHEST,
371+
.NVIC_IRQChannelSubPriority = 0,
372+
.NVIC_IRQChannelCmd = ENABLE,
373+
},
374+
},
375+
.rx = {
376+
.gpio = GPIOC,
377+
.init = {
378+
.GPIO_Pin = GPIO_Pin_5,
379+
.GPIO_Speed = GPIO_Speed_2MHz,
380+
.GPIO_Mode = GPIO_Mode_AF,
381+
.GPIO_OType = GPIO_OType_PP,
382+
.GPIO_PuPd = GPIO_PuPd_UP
383+
},
384+
.pin_source = GPIO_PinSource5,
385+
},
386+
};
387+
363388
#endif /* PIOS_INCLUDE_USART */
364389

365390
#if defined(PIOS_INCLUDE_COM)

flight/targets/lux/fw/pios_board.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ void PIOS_Board_Init(void)
296296
uint8_t hw_rcvrport;
297297
HwLuxRcvrPortGet(&hw_rcvrport);
298298
PIOS_HAL_ConfigurePort(hw_rcvrport, // port_type
299-
NULL, // usart_port_cfg
299+
&pios_rcvr_usart_cfg, // usart_port_cfg
300300
&pios_usart_com_driver, // com_driver
301301
NULL, // i2c_id
302302
NULL, // i2c_cfg

0 commit comments

Comments
 (0)