mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-18 08:54:15 +01:00
Fixes for SBUS support on RM2.
Note: it needs the RTC timing to be fixed as it seems that it runs at half its nominal 625Hz value
This commit is contained in:
parent
c6effbbb0f
commit
2d83e8a779
@ -240,7 +240,6 @@ SRC += $(PIOSSTM32F10X)/pios_spi.c
|
|||||||
SRC += $(PIOSSTM32F10X)/pios_ppm.c
|
SRC += $(PIOSSTM32F10X)/pios_ppm.c
|
||||||
SRC += $(PIOSSTM32F10X)/pios_pwm.c
|
SRC += $(PIOSSTM32F10X)/pios_pwm.c
|
||||||
SRC += $(PIOSSTM32F10X)/pios_dsm.c
|
SRC += $(PIOSSTM32F10X)/pios_dsm.c
|
||||||
SRC += $(PIOSSTM32F10X)/pios_sbus.c
|
|
||||||
SRC += $(PIOSSTM32F10X)/pios_debug.c
|
SRC += $(PIOSSTM32F10X)/pios_debug.c
|
||||||
SRC += $(PIOSSTM32F10X)/pios_gpio.c
|
SRC += $(PIOSSTM32F10X)/pios_gpio.c
|
||||||
SRC += $(PIOSSTM32F10X)/pios_exti.c
|
SRC += $(PIOSSTM32F10X)/pios_exti.c
|
||||||
@ -270,6 +269,7 @@ SRC += $(PIOSCOMMON)/pios_flash_jedec.c
|
|||||||
SRC += $(PIOSCOMMON)/pios_adxl345.c
|
SRC += $(PIOSCOMMON)/pios_adxl345.c
|
||||||
SRC += $(PIOSCOMMON)/pios_mpu6000.c
|
SRC += $(PIOSCOMMON)/pios_mpu6000.c
|
||||||
SRC += $(PIOSCOMMON)/pios_com.c
|
SRC += $(PIOSCOMMON)/pios_com.c
|
||||||
|
SRC += $(PIOSCOMMON)/pios_sbus.c
|
||||||
#SRC += $(PIOSCOMMON)/pios_i2c_esc.c
|
#SRC += $(PIOSCOMMON)/pios_i2c_esc.c
|
||||||
#SRC += $(PIOSCOMMON)/pios_bmp085.c
|
#SRC += $(PIOSCOMMON)/pios_bmp085.c
|
||||||
SRC += $(PIOSCOMMON)/pios_rcvr.c
|
SRC += $(PIOSCOMMON)/pios_rcvr.c
|
||||||
|
@ -171,6 +171,7 @@ SRC += $(PIOSCOMMON)/pios_crc.c
|
|||||||
SRC += $(PIOSCOMMON)/pios_com.c
|
SRC += $(PIOSCOMMON)/pios_com.c
|
||||||
SRC += $(PIOSCOMMON)/pios_rfm22b.c
|
SRC += $(PIOSCOMMON)/pios_rfm22b.c
|
||||||
SRC += $(PIOSCOMMON)/pios_rcvr.c
|
SRC += $(PIOSCOMMON)/pios_rcvr.c
|
||||||
|
SRC += $(PIOSCOMMON)/pios_sbus.c
|
||||||
SRC += $(PIOSCOMMON)/pios_flash_jedec.c
|
SRC += $(PIOSCOMMON)/pios_flash_jedec.c
|
||||||
SRC += $(PIOSCOMMON)/pios_flashfs_objlist.c
|
SRC += $(PIOSCOMMON)/pios_flashfs_objlist.c
|
||||||
SRC += $(PIOSCOMMON)/printf-stdarg.c
|
SRC += $(PIOSCOMMON)/printf-stdarg.c
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
/* Supported receiver interfaces */
|
/* Supported receiver interfaces */
|
||||||
#define PIOS_INCLUDE_RCVR
|
#define PIOS_INCLUDE_RCVR
|
||||||
#define PIOS_INCLUDE_DSM
|
#define PIOS_INCLUDE_DSM
|
||||||
//#define PIOS_INCLUDE_SBUS
|
#define PIOS_INCLUDE_SBUS
|
||||||
#define PIOS_INCLUDE_PPM
|
#define PIOS_INCLUDE_PPM
|
||||||
#define PIOS_INCLUDE_PWM
|
#define PIOS_INCLUDE_PWM
|
||||||
#define PIOS_INCLUDE_GCSRCVR
|
#define PIOS_INCLUDE_GCSRCVR
|
||||||
|
@ -190,6 +190,7 @@ SRC += $(PIOSCOMMON)/pios_ms5611.c
|
|||||||
SRC += $(PIOSCOMMON)/pios_crc.c
|
SRC += $(PIOSCOMMON)/pios_crc.c
|
||||||
SRC += $(PIOSCOMMON)/pios_com.c
|
SRC += $(PIOSCOMMON)/pios_com.c
|
||||||
SRC += $(PIOSCOMMON)/pios_rcvr.c
|
SRC += $(PIOSCOMMON)/pios_rcvr.c
|
||||||
|
SRC += $(PIOSCOMMON)/pios_sbus.c
|
||||||
SRC += $(PIOSCOMMON)/pios_flash_jedec.c
|
SRC += $(PIOSCOMMON)/pios_flash_jedec.c
|
||||||
SRC += $(PIOSCOMMON)/pios_flashfs_objlist.c
|
SRC += $(PIOSCOMMON)/pios_flashfs_objlist.c
|
||||||
SRC += $(PIOSCOMMON)/printf-stdarg.c
|
SRC += $(PIOSCOMMON)/printf-stdarg.c
|
||||||
|
@ -997,6 +997,7 @@ static const struct pios_dsm_cfg pios_dsm_flexi_cfg = {
|
|||||||
|
|
||||||
static const struct pios_usart_cfg pios_usart_sbus_auxsbus_cfg = {
|
static const struct pios_usart_cfg pios_usart_sbus_auxsbus_cfg = {
|
||||||
.regs = UART4,
|
.regs = UART4,
|
||||||
|
.remap = GPIO_AF_UART4,
|
||||||
.init = {
|
.init = {
|
||||||
.USART_BaudRate = 100000,
|
.USART_BaudRate = 100000,
|
||||||
.USART_WordLength = USART_WordLength_8b,
|
.USART_WordLength = USART_WordLength_8b,
|
||||||
@ -1046,9 +1047,10 @@ static const struct pios_sbus_cfg pios_sbus_cfg = {
|
|||||||
.GPIO_Speed = GPIO_Speed_2MHz,
|
.GPIO_Speed = GPIO_Speed_2MHz,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
.gpio_clk_func = RCC_AHB1PeriphClockCmd,
|
|
||||||
.gpio_clk_periph = RCC_AHB1Periph_GPIOB,
|
|
||||||
.gpio_inv_enable = Bit_SET,
|
.gpio_inv_enable = Bit_SET,
|
||||||
|
.gpio_inv_disable = Bit_RESET,
|
||||||
|
.gpio_clk_func = RCC_AHB1PeriphClockCmd,
|
||||||
|
.gpio_clk_periph = RCC_AHB1Periph_GPIOC,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* PIOS_INCLUDE_SBUS */
|
#endif /* PIOS_INCLUDE_SBUS */
|
||||||
|
@ -553,8 +553,11 @@ static const struct pios_dsm_cfg pios_dsm_main_cfg = {
|
|||||||
/*
|
/*
|
||||||
* S.Bus USART
|
* S.Bus USART
|
||||||
*/
|
*/
|
||||||
|
#include <pios_sbus_priv.h>
|
||||||
|
|
||||||
static const struct pios_usart_cfg pios_usart_sbus_main_cfg = {
|
static const struct pios_usart_cfg pios_usart_sbus_main_cfg = {
|
||||||
.regs = USART1,
|
.regs = USART1,
|
||||||
|
.remap = GPIO_AF_USART1,
|
||||||
.init = {
|
.init = {
|
||||||
.USART_BaudRate = 100000,
|
.USART_BaudRate = 100000,
|
||||||
.USART_WordLength = USART_WordLength_8b,
|
.USART_WordLength = USART_WordLength_8b,
|
||||||
@ -576,7 +579,9 @@ static const struct pios_usart_cfg pios_usart_sbus_main_cfg = {
|
|||||||
.init = {
|
.init = {
|
||||||
.GPIO_Pin = GPIO_Pin_10,
|
.GPIO_Pin = GPIO_Pin_10,
|
||||||
.GPIO_Speed = GPIO_Speed_2MHz,
|
.GPIO_Speed = GPIO_Speed_2MHz,
|
||||||
.GPIO_Mode = GPIO_Mode_IPU,
|
.GPIO_Mode = GPIO_Mode_AF,
|
||||||
|
.GPIO_OType = GPIO_OType_PP,
|
||||||
|
.GPIO_PuPd = GPIO_PuPd_UP
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
.tx = {
|
.tx = {
|
||||||
@ -584,7 +589,9 @@ static const struct pios_usart_cfg pios_usart_sbus_main_cfg = {
|
|||||||
.init = {
|
.init = {
|
||||||
.GPIO_Pin = GPIO_Pin_9,
|
.GPIO_Pin = GPIO_Pin_9,
|
||||||
.GPIO_Speed = GPIO_Speed_2MHz,
|
.GPIO_Speed = GPIO_Speed_2MHz,
|
||||||
.GPIO_Mode = GPIO_Mode_IN_FLOATING,
|
.GPIO_Mode = GPIO_Mode_OUT,
|
||||||
|
.GPIO_OType = GPIO_OType_PP,
|
||||||
|
.GPIO_PuPd = GPIO_PuPd_NOPULL
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -606,6 +613,8 @@ static const struct pios_sbus_cfg pios_sbus_cfg = {
|
|||||||
},
|
},
|
||||||
.gpio_inv_enable = Bit_SET,
|
.gpio_inv_enable = Bit_SET,
|
||||||
.gpio_inv_disable = Bit_RESET,
|
.gpio_inv_disable = Bit_RESET,
|
||||||
|
.gpio_clk_func = RCC_AHB1PeriphClockCmd,
|
||||||
|
.gpio_clk_periph = RCC_AHB1Periph_GPIOC,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user