diff --git a/flight/CopterControl/Makefile b/flight/CopterControl/Makefile index d36c48fca..5f2939275 100644 --- a/flight/CopterControl/Makefile +++ b/flight/CopterControl/Makefile @@ -187,7 +187,7 @@ SRC += $(PIOSSTM32F10X)/pios_i2c.c SRC += $(PIOSSTM32F10X)/pios_spi.c SRC += $(PIOSSTM32F10X)/pios_ppm.c SRC += $(PIOSSTM32F10X)/pios_pwm.c -SRC += $(PIOSSTM32F10X)/pios_spektrum.c +SRC += $(PIOSSTM32F10X)/pios_dsm.c SRC += $(PIOSSTM32F10X)/pios_sbus.c SRC += $(PIOSSTM32F10X)/pios_debug.c SRC += $(PIOSSTM32F10X)/pios_gpio.c diff --git a/flight/CopterControl/System/inc/pios_config.h b/flight/CopterControl/System/inc/pios_config.h index bab05551d..fc5a23de4 100644 --- a/flight/CopterControl/System/inc/pios_config.h +++ b/flight/CopterControl/System/inc/pios_config.h @@ -46,7 +46,7 @@ #define PIOS_INCLUDE_RCVR /* Supported receiver interfaces */ -#define PIOS_INCLUDE_SPEKTRUM +#define PIOS_INCLUDE_DSM #define PIOS_INCLUDE_SBUS #define PIOS_INCLUDE_PPM #define PIOS_INCLUDE_PWM diff --git a/flight/CopterControl/System/pios_board.c b/flight/CopterControl/System/pios_board.c index 42f9538ea..a83307469 100644 --- a/flight/CopterControl/System/pios_board.c +++ b/flight/CopterControl/System/pios_board.c @@ -695,13 +695,13 @@ static const struct pios_usart_cfg pios_usart_gps_flexi_cfg = { }; #endif /* PIOS_INCLUDE_GPS */ -#if defined(PIOS_INCLUDE_SPEKTRUM) +#if defined(PIOS_INCLUDE_DSM) /* - * SPEKTRUM USART + * Spektrum/JR DSM USART */ -#include +#include -static const struct pios_usart_cfg pios_usart_spektrum_main_cfg = { +static const struct pios_usart_cfg pios_usart_dsm_main_cfg = { .regs = USART1, .init = { .USART_BaudRate = 115200, @@ -737,7 +737,7 @@ static const struct pios_usart_cfg pios_usart_spektrum_main_cfg = { }, }; -static const struct pios_spektrum_cfg pios_spektrum_main_cfg = { +static const struct pios_dsm_cfg pios_dsm_main_cfg = { .bind = { .gpio = GPIOA, .init = { @@ -748,7 +748,7 @@ static const struct pios_spektrum_cfg pios_spektrum_main_cfg = { }, }; -static const struct pios_usart_cfg pios_usart_spektrum_flexi_cfg = { +static const struct pios_usart_cfg pios_usart_dsm_flexi_cfg = { .regs = USART3, .init = { .USART_BaudRate = 115200, @@ -784,7 +784,7 @@ static const struct pios_usart_cfg pios_usart_spektrum_flexi_cfg = { }, }; -static const struct pios_spektrum_cfg pios_spektrum_flexi_cfg = { +static const struct pios_dsm_cfg pios_dsm_flexi_cfg = { .bind = { .gpio = GPIOB, .init = { @@ -795,7 +795,7 @@ static const struct pios_spektrum_cfg pios_spektrum_flexi_cfg = { }, }; -#endif /* PIOS_INCLUDE_SPEKTRUM */ +#endif /* PIOS_INCLUDE_DSM */ #if defined(PIOS_INCLUDE_SBUS) /* @@ -1200,7 +1200,7 @@ void PIOS_Board_Init(void) { case HWSETTINGS_CC_MAINPORT_DSM2: case HWSETTINGS_CC_MAINPORT_DSMX10BIT: case HWSETTINGS_CC_MAINPORT_DSMX11BIT: -#if defined(PIOS_INCLUDE_SPEKTRUM) +#if defined(PIOS_INCLUDE_DSM) { enum pios_dsm_proto proto; switch (hwsettings_cc_mainport) { @@ -1218,27 +1218,27 @@ void PIOS_Board_Init(void) { break; } - uint32_t pios_usart_spektrum_id; - if (PIOS_USART_Init(&pios_usart_spektrum_id, &pios_usart_spektrum_main_cfg)) { + uint32_t pios_usart_dsm_id; + if (PIOS_USART_Init(&pios_usart_dsm_id, &pios_usart_dsm_main_cfg)) { PIOS_Assert(0); } - uint32_t pios_spektrum_id; - if (PIOS_Spektrum_Init(&pios_spektrum_id, - &pios_spektrum_main_cfg, - &pios_usart_com_driver, - pios_usart_spektrum_id, - proto, 0)) { + uint32_t pios_dsm_id; + if (PIOS_DSM_Init(&pios_dsm_id, + &pios_dsm_main_cfg, + &pios_usart_com_driver, + pios_usart_dsm_id, + proto, 0)) { PIOS_Assert(0); } - uint32_t pios_spektrum_rcvr_id; - if (PIOS_RCVR_Init(&pios_spektrum_rcvr_id, &pios_spektrum_rcvr_driver, pios_spektrum_id)) { + uint32_t pios_dsm_rcvr_id; + if (PIOS_RCVR_Init(&pios_dsm_rcvr_id, &pios_dsm_rcvr_driver, pios_dsm_id)) { PIOS_Assert(0); } - pios_rcvr_group_map[MANUALCONTROLSETTINGS_CHANNELGROUPS_DSMMAINPORT] = pios_spektrum_rcvr_id; + pios_rcvr_group_map[MANUALCONTROLSETTINGS_CHANNELGROUPS_DSMMAINPORT] = pios_dsm_rcvr_id; } -#endif /* PIOS_INCLUDE_SPEKTRUM */ +#endif /* PIOS_INCLUDE_DSM */ break; case HWSETTINGS_CC_MAINPORT_COMAUX: break; @@ -1290,7 +1290,7 @@ void PIOS_Board_Init(void) { case HWSETTINGS_CC_FLEXIPORT_DSM2: case HWSETTINGS_CC_FLEXIPORT_DSMX10BIT: case HWSETTINGS_CC_FLEXIPORT_DSMX11BIT: -#if defined(PIOS_INCLUDE_SPEKTRUM) +#if defined(PIOS_INCLUDE_DSM) { enum pios_dsm_proto proto; switch (hwsettings_cc_flexiport) { @@ -1308,27 +1308,27 @@ void PIOS_Board_Init(void) { break; } - uint32_t pios_usart_spektrum_id; - if (PIOS_USART_Init(&pios_usart_spektrum_id, &pios_usart_spektrum_flexi_cfg)) { + uint32_t pios_usart_dsm_id; + if (PIOS_USART_Init(&pios_usart_dsm_id, &pios_usart_dsm_flexi_cfg)) { PIOS_Assert(0); } - uint32_t pios_spektrum_id; - if (PIOS_Spektrum_Init(&pios_spektrum_id, - &pios_spektrum_flexi_cfg, - &pios_usart_com_driver, - pios_usart_spektrum_id, - proto, hwsettings_DSMxBind)) { + uint32_t pios_dsm_id; + if (PIOS_DSM_Init(&pios_dsm_id, + &pios_dsm_flexi_cfg, + &pios_usart_com_driver, + pios_usart_dsm_id, + proto, hwsettings_DSMxBind)) { PIOS_Assert(0); } - uint32_t pios_spektrum_rcvr_id; - if (PIOS_RCVR_Init(&pios_spektrum_rcvr_id, &pios_spektrum_rcvr_driver, pios_spektrum_id)) { + uint32_t pios_dsm_rcvr_id; + if (PIOS_RCVR_Init(&pios_dsm_rcvr_id, &pios_dsm_rcvr_driver, pios_dsm_id)) { PIOS_Assert(0); } - pios_rcvr_group_map[MANUALCONTROLSETTINGS_CHANNELGROUPS_DSMFLEXIPORT] = pios_spektrum_rcvr_id; + pios_rcvr_group_map[MANUALCONTROLSETTINGS_CHANNELGROUPS_DSMFLEXIPORT] = pios_dsm_rcvr_id; } -#endif /* PIOS_INCLUDE_SPEKTRUM */ +#endif /* PIOS_INCLUDE_DSM */ break; case HWSETTINGS_CC_FLEXIPORT_COMAUX: break; diff --git a/flight/OpenPilot/Makefile b/flight/OpenPilot/Makefile index 468a54f25..cdf59befc 100644 --- a/flight/OpenPilot/Makefile +++ b/flight/OpenPilot/Makefile @@ -162,7 +162,7 @@ SRC += $(PIOSSTM32F10X)/pios_i2c.c SRC += $(PIOSSTM32F10X)/pios_spi.c SRC += $(PIOSSTM32F10X)/pios_ppm.c SRC += $(PIOSSTM32F10X)/pios_pwm.c -SRC += $(PIOSSTM32F10X)/pios_spektrum.c +SRC += $(PIOSSTM32F10X)/pios_dsm.c SRC += $(PIOSSTM32F10X)/pios_sbus.c SRC += $(PIOSSTM32F10X)/pios_tim.c SRC += $(PIOSSTM32F10X)/pios_debug.c diff --git a/flight/OpenPilot/System/inc/pios_config.h b/flight/OpenPilot/System/inc/pios_config.h index 8e37dc95a..68771ea44 100644 --- a/flight/OpenPilot/System/inc/pios_config.h +++ b/flight/OpenPilot/System/inc/pios_config.h @@ -44,7 +44,7 @@ #define PIOS_INCLUDE_RCVR -#define PIOS_INCLUDE_SPEKTRUM +#define PIOS_INCLUDE_DSM //#define PIOS_INCLUDE_SBUS #define PIOS_INCLUDE_PWM #define PIOS_INCLUDE_PPM diff --git a/flight/OpenPilot/System/openpilot.c b/flight/OpenPilot/System/openpilot.c index 0e6bcf671..c90f5fd81 100644 --- a/flight/OpenPilot/System/openpilot.c +++ b/flight/OpenPilot/System/openpilot.c @@ -143,8 +143,8 @@ static void TaskTesting(void *pvParameters) PIOS_COM_SendFormattedStringNonBlocking(COM_DEBUG_USART, "%u\r", PIOS_BMP085_GetPressure()); */ -#if defined(PIOS_INCLUDE_SPEKTRUM) - PIOS_COM_SendFormattedStringNonBlocking(COM_DEBUG_USART, "%u,%u,%u,%u,%u,%u,%u,%u\r", PIOS_SPEKTRUM_Get(0), PIOS_SPEKTRUM_Get(1), PIOS_SPEKTRUM_Get(2), PIOS_SPEKTRUM_Get(3), PIOS_SPEKTRUM_Get(4), PIOS_SPEKTRUM_Get(5), PIOS_SPEKTRUM_Get(6), PIOS_SPEKTRUM_Get(7)); +#if defined(PIOS_INCLUDE_DSM) + PIOS_COM_SendFormattedStringNonBlocking(COM_DEBUG_USART, "%u,%u,%u,%u,%u,%u,%u,%u\r", PIOS_DSM_Get(0), PIOS_DSM_Get(1), PIOS_DSM_Get(2), PIOS_DSM_Get(3), PIOS_DSM_Get(4), PIOS_DSM_Get(5), PIOS_DSM_Get(6), PIOS_DSM_Get(7)); #endif #if defined(PIOS_INCLUDE_SBUS) PIOS_COM_SendFormattedStringNonBlocking(COM_DEBUG_USART, "%u,%u,%u,%u,%u,%u,%u,%u\r", PIOS_SBus_Get(0), PIOS_SBus_Get(1), PIOS_SBus_Get(2), PIOS_SBus_Get(3), PIOS_SBus_Get(4), PIOS_SBus_Get(5), PIOS_SBus_Get(6), PIOS_SBus_Get(7)); diff --git a/flight/OpenPilot/System/pios_board.c b/flight/OpenPilot/System/pios_board.c index 6c4ae2d83..515ed1e2b 100644 --- a/flight/OpenPilot/System/pios_board.c +++ b/flight/OpenPilot/System/pios_board.c @@ -538,13 +538,13 @@ void PIOS_RTC_IRQ_Handler (void) #endif -#if defined(PIOS_INCLUDE_SPEKTRUM) +#if defined(PIOS_INCLUDE_DSM) /* - * SPEKTRUM USART + * Spektrum/JR DSM USART */ -#include +#include -static const struct pios_usart_cfg pios_usart_spektrum_cfg = { +static const struct pios_usart_cfg pios_usart_dsm_cfg = { .regs = USART1, .init = { .USART_BaudRate = 115200, @@ -580,7 +580,7 @@ static const struct pios_usart_cfg pios_usart_spektrum_cfg = { }, }; -static const struct pios_spektrum_cfg pios_spektrum_cfg = { +static const struct pios_dsm_cfg pios_dsm_cfg = { .bind = { .gpio = GPIOA, .init = { @@ -591,7 +591,7 @@ static const struct pios_spektrum_cfg pios_spektrum_cfg = { }, }; -#endif /* PIOS_COM_SPEKTRUM */ +#endif /* PIOS_COM_DSM */ #if defined(PIOS_INCLUDE_SBUS) #error PIOS_INCLUDE_SBUS not implemented @@ -1062,7 +1062,7 @@ uint32_t pios_com_telem_rf_id; uint32_t pios_com_telem_usb_id; uint32_t pios_com_gps_id; uint32_t pios_com_aux_id; -uint32_t pios_com_spektrum_id; +uint32_t pios_com_dsm_id; #include "ahrs_spi_comm.h" @@ -1206,7 +1206,7 @@ void PIOS_Board_Init(void) { case HWSETTINGS_OP_RCVRPORT_DSM2: case HWSETTINGS_OP_RCVRPORT_DSMX10BIT: case HWSETTINGS_OP_RCVRPORT_DSMX11BIT: -#if defined(PIOS_INCLUDE_SPEKTRUM) +#if defined(PIOS_INCLUDE_DSM) { enum pios_dsm_proto proto; switch (hwsettings_rcvrport) { @@ -1224,25 +1224,25 @@ void PIOS_Board_Init(void) { break; } - uint32_t pios_usart_spektrum_id; - if (PIOS_USART_Init(&pios_usart_spektrum_id, &pios_usart_spektrum_cfg)) { + uint32_t pios_usart_dsm_id; + if (PIOS_USART_Init(&pios_usart_dsm_id, &pios_usart_dsm_cfg)) { PIOS_Assert(0); } - uint32_t pios_spektrum_id; - if (PIOS_Spektrum_Init(&pios_spektrum_id, - &pios_spektrum_cfg, - &pios_usart_com_driver, - pios_usart_spektrum_id, - proto, 0)) { + uint32_t pios_dsm_id; + if (PIOS_DSM_Init(&pios_dsm_id, + &pios_dsm_cfg, + &pios_usart_com_driver, + pios_usart_dsm_id, + proto, 0)) { PIOS_Assert(0); } - uint32_t pios_spektrum_rcvr_id; - if (PIOS_RCVR_Init(&pios_spektrum_rcvr_id, &pios_spektrum_rcvr_driver, pios_spektrum_id)) { + uint32_t pios_dsm_rcvr_id; + if (PIOS_RCVR_Init(&pios_dsm_rcvr_id, &pios_dsm_rcvr_driver, pios_dsm_id)) { PIOS_Assert(0); } - pios_rcvr_group_map[MANUALCONTROLSETTINGS_CHANNELGROUPS_DSMMAINPORT] = pios_spektrum_rcvr_id; + pios_rcvr_group_map[MANUALCONTROLSETTINGS_CHANNELGROUPS_DSMMAINPORT] = pios_dsm_rcvr_id; } #endif break; diff --git a/flight/OpenPilot/System/pios_board_posix.c b/flight/OpenPilot/System/pios_board_posix.c index 48d6839bc..6d777e042 100644 --- a/flight/OpenPilot/System/pios_board_posix.c +++ b/flight/OpenPilot/System/pios_board_posix.c @@ -39,7 +39,7 @@ #include "pios_rcvr_priv.h" /* One slot per selectable receiver group. - * eg. PWM, PPM, GCS, SPEKTRUM1, SPEKTRUM2, SBUS + * eg. PWM, PPM, GCS, DSMMAINPORT, DSMFLEXIPORT, SBUS * NOTE: No slot in this map for NONE. */ uint32_t pios_rcvr_group_map[MANUALCONTROLSETTINGS_CHANNELGROUPS_NONE]; diff --git a/flight/PiOS/Boards/STM32103CB_CC_Rev1.h b/flight/PiOS/Boards/STM32103CB_CC_Rev1.h index 0815d350a..1a8a17c89 100644 --- a/flight/PiOS/Boards/STM32103CB_CC_Rev1.h +++ b/flight/PiOS/Boards/STM32103CB_CC_Rev1.h @@ -222,10 +222,10 @@ extern uint32_t pios_com_telem_usb_id; #define PIOS_PWM_NUM_INPUTS 6 //------------------------- -// Receiver SPEKTRUM input +// Receiver DSM input //------------------------- -#define PIOS_SPEKTRUM_MAX_DEVS 2 -#define PIOS_SPEKTRUM_NUM_INPUTS 12 +#define PIOS_DSM_MAX_DEVS 2 +#define PIOS_DSM_NUM_INPUTS 12 //------------------------- // Receiver S.Bus input diff --git a/flight/PiOS/Boards/STM3210E_OP.h b/flight/PiOS/Boards/STM3210E_OP.h index 16dcb66e9..c82bb8fe8 100644 --- a/flight/PiOS/Boards/STM3210E_OP.h +++ b/flight/PiOS/Boards/STM3210E_OP.h @@ -195,10 +195,10 @@ extern uint32_t pios_com_aux_id; #define PIOS_PWM_NUM_INPUTS 8 //------------------------- -// Receiver SPEKTRUM input +// Receiver DSM input //------------------------- -#define PIOS_SPEKTRUM_MAX_DEVS 1 -#define PIOS_SPEKTRUM_NUM_INPUTS 12 +#define PIOS_DSM_MAX_DEVS 1 +#define PIOS_DSM_NUM_INPUTS 12 //------------------------- // Receiver S.Bus input diff --git a/flight/PiOS/Common/pios_hcsr04.c b/flight/PiOS/Common/pios_hcsr04.c index 6db1bc401..cbdb31e7e 100644 --- a/flight/PiOS/Common/pios_hcsr04.c +++ b/flight/PiOS/Common/pios_hcsr04.c @@ -32,8 +32,8 @@ #include "pios.h" #if defined(PIOS_INCLUDE_HCSR04) -#if !(defined(PIOS_INCLUDE_SPEKTRUM) || defined(PIOS_INCLUDE_SBUS)) -#error Only supported with Spektrum or S.Bus interface! +#if !(defined(PIOS_INCLUDE_DSM) || defined(PIOS_INCLUDE_SBUS)) +#error Only supported with Spektrum/JR DSM or S.Bus interface! #endif /* Local Variables */ diff --git a/flight/PiOS/STM32F10x/pios_spektrum.c b/flight/PiOS/STM32F10x/pios_dsm.c similarity index 55% rename from flight/PiOS/STM32F10x/pios_spektrum.c rename to flight/PiOS/STM32F10x/pios_dsm.c index 80eb232ce..cb838b56b 100644 --- a/flight/PiOS/STM32F10x/pios_spektrum.c +++ b/flight/PiOS/STM32F10x/pios_dsm.c @@ -2,11 +2,11 @@ ****************************************************************************** * @addtogroup PIOS PIOS Core hardware abstraction layer * @{ - * @addtogroup PIOS_Spektrum Spektrum/JR DSMx satellite receiver functions + * @addtogroup PIOS_DSM Spektrum/JR DSMx satellite receiver functions * @brief Code to bind and read Spektrum/JR DSMx satellite receiver serial stream * @{ * - * @file pios_spektrum.c + * @file pios_dsm.c * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011. * @brief Code bind and read Spektrum/JR DSMx satellite receiver serial stream * @see The GNU Public License (GPL) Version 3 @@ -30,88 +30,88 @@ /* Project Includes */ #include "pios.h" -#include "pios_spektrum_priv.h" +#include "pios_dsm_priv.h" -#if defined(PIOS_INCLUDE_SPEKTRUM) +#if defined(PIOS_INCLUDE_DSM) /* Forward Declarations */ -static int32_t PIOS_Spektrum_Get(uint32_t rcvr_id, uint8_t channel); -static uint16_t PIOS_Spektrum_RxInCallback(uint32_t context, - uint8_t *buf, - uint16_t buf_len, - uint16_t *headroom, - bool *need_yield); -static void PIOS_Spektrum_Supervisor(uint32_t spektrum_id); +static int32_t PIOS_DSM_Get(uint32_t rcvr_id, uint8_t channel); +static uint16_t PIOS_DSM_RxInCallback(uint32_t context, + uint8_t *buf, + uint16_t buf_len, + uint16_t *headroom, + bool *need_yield); +static void PIOS_DSM_Supervisor(uint32_t dsm_id); /* Local Variables */ -const struct pios_rcvr_driver pios_spektrum_rcvr_driver = { - .read = PIOS_Spektrum_Get, +const struct pios_rcvr_driver pios_dsm_rcvr_driver = { + .read = PIOS_DSM_Get, }; -enum pios_spektrum_dev_magic { - PIOS_SPEKTRUM_DEV_MAGIC = 0x44534d78, +enum pios_dsm_dev_magic { + PIOS_DSM_DEV_MAGIC = 0x44534d78, }; -struct pios_spektrum_state { - uint16_t channel_data[PIOS_SPEKTRUM_NUM_INPUTS]; - uint8_t received_data[SPEKTRUM_FRAME_LENGTH]; +struct pios_dsm_state { + uint16_t channel_data[PIOS_DSM_NUM_INPUTS]; + uint8_t received_data[DSM_FRAME_LENGTH]; uint8_t receive_timer; uint8_t failsafe_timer; uint8_t frame_found; uint8_t byte_count; -#if SPEKTRUM_LOST_FRAME_COUNTER +#ifdef DSM_LOST_FRAME_COUNTER uint8_t frames_lost_last; uint16_t frames_lost; #endif }; -struct pios_spektrum_dev { - enum pios_spektrum_dev_magic magic; - const struct pios_spektrum_cfg *cfg; +struct pios_dsm_dev { + enum pios_dsm_dev_magic magic; + const struct pios_dsm_cfg *cfg; enum pios_dsm_proto proto; - struct pios_spektrum_state state; + struct pios_dsm_state state; }; -/* Allocate Spektrum device descriptor */ +/* Allocate DSM device descriptor */ #if defined(PIOS_INCLUDE_FREERTOS) -static struct pios_spektrum_dev *PIOS_Spektrum_Alloc(void) +static struct pios_dsm_dev *PIOS_DSM_Alloc(void) { - struct pios_spektrum_dev *spektrum_dev; + struct pios_dsm_dev *dsm_dev; - spektrum_dev = (struct pios_spektrum_dev *)pvPortMalloc(sizeof(*spektrum_dev)); - if (!spektrum_dev) + dsm_dev = (struct pios_dsm_dev *)pvPortMalloc(sizeof(*dsm_dev)); + if (!dsm_dev) return NULL; - spektrum_dev->magic = PIOS_SPEKTRUM_DEV_MAGIC; - return spektrum_dev; + dsm_dev->magic = PIOS_DSM_DEV_MAGIC; + return dsm_dev; } #else -static struct pios_spektrum_dev pios_spektrum_devs[PIOS_SPEKTRUM_MAX_DEVS]; -static uint8_t pios_spektrum_num_devs; -static struct pios_spektrum_dev *PIOS_Spektrum_Alloc(void) +static struct pios_dsm_dev pios_dsm_devs[PIOS_DSM_MAX_DEVS]; +static uint8_t pios_dsm_num_devs; +static struct pios_dsm_dev *PIOS_DSM_Alloc(void) { - struct pios_spektrum_dev *spektrum_dev; + struct pios_dsm_dev *dsm_dev; - if (pios_spektrum_num_devs >= PIOS_SPEKTRUM_MAX_DEVS) + if (pios_dsm_num_devs >= PIOS_DSM_MAX_DEVS) return NULL; - spektrum_dev = &pios_spektrum_devs[pios_spektrum_num_devs++]; - spektrum_dev->magic = PIOS_SPEKTRUM_DEV_MAGIC; + dsm_dev = &pios_dsm_devs[pios_dsm_num_devs++]; + dsm_dev->magic = PIOS_DSM_DEV_MAGIC; - return spektrum_dev; + return dsm_dev; } #endif -/* Validate Spektrum device descriptor */ -static bool PIOS_Spektrum_Validate(struct pios_spektrum_dev *spektrum_dev) +/* Validate DSM device descriptor */ +static bool PIOS_DSM_Validate(struct pios_dsm_dev *dsm_dev) { - return (spektrum_dev->magic == PIOS_SPEKTRUM_DEV_MAGIC); + return (dsm_dev->magic == PIOS_DSM_DEV_MAGIC); } /* Try to bind DSMx satellite using specified number of pulses */ -static void PIOS_Spektrum_Bind(struct pios_spektrum_dev *spektrum_dev, uint8_t bind) +static void PIOS_DSM_Bind(struct pios_dsm_dev *dsm_dev, uint8_t bind) { - const struct pios_spektrum_cfg *cfg = spektrum_dev->cfg; + const struct pios_dsm_cfg *cfg = dsm_dev->cfg; GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitStructure.GPIO_Pin = cfg->bind.init.GPIO_Pin; @@ -143,26 +143,26 @@ static void PIOS_Spektrum_Bind(struct pios_spektrum_dev *spektrum_dev, uint8_t b } /* Reset channels in case of lost signal or explicit failsafe receiver flag */ -static void PIOS_Spektrum_ResetChannels(struct pios_spektrum_dev *spektrum_dev) +static void PIOS_DSM_ResetChannels(struct pios_dsm_dev *dsm_dev) { - struct pios_spektrum_state *state = &(spektrum_dev->state); - for (int i = 0; i < PIOS_SPEKTRUM_NUM_INPUTS; i++) { + struct pios_dsm_state *state = &(dsm_dev->state); + for (int i = 0; i < PIOS_DSM_NUM_INPUTS; i++) { state->channel_data[i] = PIOS_RCVR_TIMEOUT; } } -/* Reset Spektrum receiver state */ -static void PIOS_Spektrum_ResetState(struct pios_spektrum_dev *spektrum_dev) +/* Reset DSM receiver state */ +static void PIOS_DSM_ResetState(struct pios_dsm_dev *dsm_dev) { - struct pios_spektrum_state *state = &(spektrum_dev->state); + struct pios_dsm_state *state = &(dsm_dev->state); state->receive_timer = 0; state->failsafe_timer = 0; state->frame_found = 0; -#if SPEKTRUM_LOST_FRAME_COUNTER +#ifdef DSM_LOST_FRAME_COUNTER state->frames_lost_last = 0; state->frames_lost = 0; #endif - PIOS_Spektrum_ResetChannels(spektrum_dev); + PIOS_DSM_ResetChannels(dsm_dev); } /** @@ -170,12 +170,12 @@ static void PIOS_Spektrum_ResetState(struct pios_spektrum_dev *spektrum_dev) * \output 0 frame data accepted * \output -1 frame error found */ -static int PIOS_Spektrum_UnrollChannels(struct pios_spektrum_dev *spektrum_dev) +static int PIOS_DSM_UnrollChannels(struct pios_dsm_dev *dsm_dev) { - struct pios_spektrum_state *state = &(spektrum_dev->state); + struct pios_dsm_state *state = &(dsm_dev->state); uint8_t resolution; -#if SPEKTRUM_LOST_FRAME_COUNTER +#ifdef DSM_LOST_FRAME_COUNTER /* increment the lost frame counter */ uint8_t frames_lost = state->received_data[0]; state->frames_lost += (frames_lost - state->frames_lost_last); @@ -189,9 +189,9 @@ static int PIOS_Spektrum_UnrollChannels(struct pios_spektrum_dev *spektrum_dev) case 0x02: case 0x12: /* DSM2, DSMJ stream */ - if (spektrum_dev->proto == PIOS_DSM_PROTO_DSM2) { + if (dsm_dev->proto == PIOS_DSM_PROTO_DSM2) { /* DSM2/DSMJ resolution is known from the header */ - resolution = (type & SPEKTRUM_DSM2_RES_MASK) ? 11 : 10; + resolution = (type & DSM_DSM2_RES_MASK) ? 11 : 10; } else { /* DSMX resolution should explicitly be selected */ goto stream_error; @@ -200,9 +200,9 @@ static int PIOS_Spektrum_UnrollChannels(struct pios_spektrum_dev *spektrum_dev) case 0xA2: case 0xB2: /* DSMX stream */ - if (spektrum_dev->proto == PIOS_DSM_PROTO_DSMX10BIT) { + if (dsm_dev->proto == PIOS_DSM_PROTO_DSMX10BIT) { resolution = 10; - } else if (spektrum_dev->proto == PIOS_DSM_PROTO_DSMX11BIT) { + } else if (dsm_dev->proto == PIOS_DSM_PROTO_DSMX11BIT) { resolution = 11; } else { /* DSMX resolution should explicitly be selected */ @@ -218,7 +218,7 @@ static int PIOS_Spektrum_UnrollChannels(struct pios_spektrum_dev *spektrum_dev) uint8_t *s = &(state->received_data[2]); uint16_t mask = (resolution == 10) ? 0x03ff : 0x07ff; - for (int i = 0; i < SPEKTRUM_CHANNELS_PER_FRAME; i++) { + for (int i = 0; i < DSM_CHANNELS_PER_FRAME; i++) { uint16_t word = ((uint16_t)s[0] << 8) | s[1]; s += 2; @@ -227,20 +227,20 @@ static int PIOS_Spektrum_UnrollChannels(struct pios_spektrum_dev *spektrum_dev) continue; /* minimal data validation */ - if ((i > 0) && (word & SPEKTRUM_2ND_FRAME_MASK)) { + if ((i > 0) && (word & DSM_2ND_FRAME_MASK)) { /* invalid frame data, ignore rest of the frame */ goto stream_error; } /* extract and save the channel value */ uint8_t channel_num = (word >> resolution) & 0x0f; - if (channel_num < PIOS_SPEKTRUM_NUM_INPUTS) + if (channel_num < PIOS_DSM_NUM_INPUTS) state->channel_data[channel_num] = (word & mask); } -#if SPEKTRUM_LOST_FRAME_COUNTER +#ifdef DSM_LOST_FRAME_COUNTER /* put lost frames counter into the last channel for debugging */ - state->channel_data[PIOS_SPEKTRUM_NUM_INPUTS-1] = state->frames_lost; + state->channel_data[PIOS_DSM_NUM_INPUTS-1] = state->frames_lost; #endif /* all channels processed */ @@ -252,17 +252,17 @@ stream_error: } /* Update decoder state processing input byte from the DSMx stream */ -static void PIOS_Spektrum_UpdateState(struct pios_spektrum_dev *spektrum_dev, uint8_t byte) +static void PIOS_DSM_UpdateState(struct pios_dsm_dev *dsm_dev, uint8_t byte) { - struct pios_spektrum_state *state = &(spektrum_dev->state); + struct pios_dsm_state *state = &(dsm_dev->state); if (state->frame_found) { /* receiving the data frame */ - if (state->byte_count < SPEKTRUM_FRAME_LENGTH) { + if (state->byte_count < DSM_FRAME_LENGTH) { /* store next byte */ state->received_data[state->byte_count++] = byte; - if (state->byte_count == SPEKTRUM_FRAME_LENGTH) { + if (state->byte_count == DSM_FRAME_LENGTH) { /* full frame received - process and wait for new one */ - if (!PIOS_Spektrum_UnrollChannels(spektrum_dev)) + if (!PIOS_DSM_UnrollChannels(dsm_dev)) /* data looking good */ state->failsafe_timer = 0; @@ -273,40 +273,40 @@ static void PIOS_Spektrum_UpdateState(struct pios_spektrum_dev *spektrum_dev, ui } } -/* Initialise Spektrum receiver interface */ -int32_t PIOS_Spektrum_Init(uint32_t *spektrum_id, - const struct pios_spektrum_cfg *cfg, - const struct pios_com_driver *driver, - uint32_t lower_id, - enum pios_dsm_proto proto, - uint8_t bind) +/* Initialise DSM receiver interface */ +int32_t PIOS_DSM_Init(uint32_t *dsm_id, + const struct pios_dsm_cfg *cfg, + const struct pios_com_driver *driver, + uint32_t lower_id, + enum pios_dsm_proto proto, + uint8_t bind) { - PIOS_DEBUG_Assert(spektrum_id); + PIOS_DEBUG_Assert(dsm_id); PIOS_DEBUG_Assert(cfg); PIOS_DEBUG_Assert(driver); - struct pios_spektrum_dev *spektrum_dev; + struct pios_dsm_dev *dsm_dev; - spektrum_dev = (struct pios_spektrum_dev *)PIOS_Spektrum_Alloc(); - if (!spektrum_dev) + dsm_dev = (struct pios_dsm_dev *)PIOS_DSM_Alloc(); + if (!dsm_dev) return -1; /* Bind the configuration to the device instance */ - spektrum_dev->cfg = cfg; - spektrum_dev->proto = proto; + dsm_dev->cfg = cfg; + dsm_dev->proto = proto; /* Bind the receiver if requested */ if (bind) - PIOS_Spektrum_Bind(spektrum_dev, bind); + PIOS_DSM_Bind(dsm_dev, bind); - PIOS_Spektrum_ResetState(spektrum_dev); + PIOS_DSM_ResetState(dsm_dev); - *spektrum_id = (uint32_t)spektrum_dev; + *dsm_id = (uint32_t)dsm_dev; /* Set comm driver callback */ - (driver->bind_rx_cb)(lower_id, PIOS_Spektrum_RxInCallback, *spektrum_id); + (driver->bind_rx_cb)(lower_id, PIOS_DSM_RxInCallback, *dsm_id); - if (!PIOS_RTC_RegisterTickCallback(PIOS_Spektrum_Supervisor, *spektrum_id)) { + if (!PIOS_RTC_RegisterTickCallback(PIOS_DSM_Supervisor, *dsm_id)) { PIOS_DEBUG_Assert(0); } @@ -314,26 +314,26 @@ int32_t PIOS_Spektrum_Init(uint32_t *spektrum_id, } /* Comm byte received callback */ -static uint16_t PIOS_Spektrum_RxInCallback(uint32_t context, - uint8_t *buf, - uint16_t buf_len, - uint16_t *headroom, - bool *need_yield) +static uint16_t PIOS_DSM_RxInCallback(uint32_t context, + uint8_t *buf, + uint16_t buf_len, + uint16_t *headroom, + bool *need_yield) { - struct pios_spektrum_dev *spektrum_dev = (struct pios_spektrum_dev *)context; + struct pios_dsm_dev *dsm_dev = (struct pios_dsm_dev *)context; - bool valid = PIOS_Spektrum_Validate(spektrum_dev); + bool valid = PIOS_DSM_Validate(dsm_dev); PIOS_Assert(valid); /* process byte(s) and clear receive timer */ for (uint8_t i = 0; i < buf_len; i++) { - PIOS_Spektrum_UpdateState(spektrum_dev, buf[i]); - spektrum_dev->state.receive_timer = 0; + PIOS_DSM_UpdateState(dsm_dev, buf[i]); + dsm_dev->state.receive_timer = 0; } /* Always signal that we can accept another byte */ if (headroom) - *headroom = SPEKTRUM_FRAME_LENGTH; + *headroom = DSM_FRAME_LENGTH; /* We never need a yield */ *need_yield = false; @@ -349,41 +349,41 @@ static uint16_t PIOS_Spektrum_RxInCallback(uint32_t context, * \output PIOS_RCVR_TIMEOUT failsafe condition or missing receiver * \output >0 channel value */ -static int32_t PIOS_Spektrum_Get(uint32_t rcvr_id, uint8_t channel) +static int32_t PIOS_DSM_Get(uint32_t rcvr_id, uint8_t channel) { - struct pios_spektrum_dev *spektrum_dev = (struct pios_spektrum_dev *)rcvr_id; + struct pios_dsm_dev *dsm_dev = (struct pios_dsm_dev *)rcvr_id; - if (!PIOS_Spektrum_Validate(spektrum_dev)) + if (!PIOS_DSM_Validate(dsm_dev)) return PIOS_RCVR_INVALID; /* return error if channel is not available */ - if (channel >= PIOS_SPEKTRUM_NUM_INPUTS) + if (channel >= PIOS_DSM_NUM_INPUTS) return PIOS_RCVR_INVALID; /* may also be PIOS_RCVR_TIMEOUT set by other function */ - return spektrum_dev->state.channel_data[channel]; + return dsm_dev->state.channel_data[channel]; } /** * Input data supervisor is called periodically and provides * two functions: frame syncing and failsafe triggering. * - * Spektrum frames come at 11ms or 22ms rate at 115200bps. + * DSM frames come at 11ms or 22ms rate at 115200bps. * RTC timer is running at 625Hz (1.6ms). So with divider 5 it gives - * 8ms pause between frames which is good for both Spektrum frame rates. + * 8ms pause between frames which is good for both DSM frame rates. * * Data receive function must clear the receive_timer to confirm new * data reception. If no new data received in 100ms, we must call the * failsafe function which clears all channels. */ -static void PIOS_Spektrum_Supervisor(uint32_t spektrum_id) +static void PIOS_DSM_Supervisor(uint32_t dsm_id) { - struct pios_spektrum_dev *spektrum_dev = (struct pios_spektrum_dev *)spektrum_id; + struct pios_dsm_dev *dsm_dev = (struct pios_dsm_dev *)dsm_id; - bool valid = PIOS_Spektrum_Validate(spektrum_dev); + bool valid = PIOS_DSM_Validate(dsm_dev); PIOS_Assert(valid); - struct pios_spektrum_state *state = &(spektrum_dev->state); + struct pios_dsm_state *state = &(dsm_dev->state); /* waiting for new frame if no bytes were received in 8ms */ if (++state->receive_timer > 4) { @@ -394,12 +394,12 @@ static void PIOS_Spektrum_Supervisor(uint32_t spektrum_id) /* activate failsafe if no frames have arrived in 102.4ms */ if (++state->failsafe_timer > 64) { - PIOS_Spektrum_ResetChannels(spektrum_dev); + PIOS_DSM_ResetChannels(dsm_dev); state->failsafe_timer = 0; } } -#endif /* PIOS_INCLUDE_SPEKTRUM */ +#endif /* PIOS_INCLUDE_DSM */ /** * @} diff --git a/flight/PiOS/inc/pios_spektrum.h b/flight/PiOS/inc/pios_dsm.h similarity index 87% rename from flight/PiOS/inc/pios_spektrum.h rename to flight/PiOS/inc/pios_dsm.h index 3b3ec8a71..4bd9ed481 100644 --- a/flight/PiOS/inc/pios_spektrum.h +++ b/flight/PiOS/inc/pios_dsm.h @@ -2,10 +2,10 @@ ****************************************************************************** * @addtogroup PIOS PIOS Core hardware abstraction layer * @{ - * @addtogroup PIOS_Spektrum Spektrum/JR DSMx satellite receiver functions + * @addtogroup PIOS_DSM Spektrum/JR DSMx satellite receiver functions * @{ * - * @file pios_spektrum.h + * @file pios_dsm.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011. * @brief Spektrum/JR DSMx satellite receiver functions header. * @see The GNU Public License (GPL) Version 3 @@ -27,14 +27,14 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef PIOS_SPEKTRUM_H -#define PIOS_SPEKTRUM_H +#ifndef PIOS_DSM_H +#define PIOS_DSM_H /* Global Types */ /* Public Functions */ -#endif /* PIOS_SPEKTRUM_H */ +#endif /* PIOS_DSM_H */ /** * @} diff --git a/flight/PiOS/inc/pios_spektrum_priv.h b/flight/PiOS/inc/pios_dsm_priv.h similarity index 85% rename from flight/PiOS/inc/pios_spektrum_priv.h rename to flight/PiOS/inc/pios_dsm_priv.h index 2c7f4520d..0d1a3803d 100644 --- a/flight/PiOS/inc/pios_spektrum_priv.h +++ b/flight/PiOS/inc/pios_dsm_priv.h @@ -2,11 +2,11 @@ ****************************************************************************** * @addtogroup PIOS PIOS Core hardware abstraction layer * @{ - * @addtogroup PIOS_Spektrum Spektrum/JR DSMx satellite receiver functions + * @addtogroup PIOS_DSM Spektrum/JR DSMx satellite receiver functions * @brief PIOS interface to bind and read Spektrum/JR DSMx satellite receiver * @{ * - * @file pios_spektrum_priv.h + * @file pios_dsm_priv.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011. * @brief Spektrum/JR DSMx satellite receiver private structures. * @see The GNU Public License (GPL) Version 3 @@ -28,8 +28,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef PIOS_SPEKTRUM_PRIV_H -#define PIOS_SPEKTRUM_PRIV_H +#ifndef PIOS_DSM_PRIV_H +#define PIOS_DSM_PRIV_H #include #include @@ -99,39 +99,39 @@ * to bind in low resolution mode. */ -#define SPEKTRUM_CHANNELS_PER_FRAME 7 -#define SPEKTRUM_FRAME_LENGTH (1+1+SPEKTRUM_CHANNELS_PER_FRAME*2) -#define SPEKTRUM_DSM2_RES_MASK 0x0010 -#define SPEKTRUM_2ND_FRAME_MASK 0x8000 +#define DSM_CHANNELS_PER_FRAME 7 +#define DSM_FRAME_LENGTH (1+1+DSM_CHANNELS_PER_FRAME*2) +#define DSM_DSM2_RES_MASK 0x0010 +#define DSM_2ND_FRAME_MASK 0x8000 /* * Include lost frame counter and provide it as a last channel value * for debugging. Currently is not used by the receiver layer. */ -#define SPEKTRUM_LOST_FRAME_COUNTER 0 +//#define DSM_LOST_FRAME_COUNTER -/* Spektrum protocol variations */ +/* DSM protocol variations */ enum pios_dsm_proto { PIOS_DSM_PROTO_DSM2, PIOS_DSM_PROTO_DSMX10BIT, PIOS_DSM_PROTO_DSMX11BIT, }; -/* Spektrum receiver instance configuration */ -struct pios_spektrum_cfg { +/* DSM receiver instance configuration */ +struct pios_dsm_cfg { struct stm32_gpio bind; }; -extern const struct pios_rcvr_driver pios_spektrum_rcvr_driver; +extern const struct pios_rcvr_driver pios_dsm_rcvr_driver; -extern int32_t PIOS_Spektrum_Init(uint32_t *spektrum_id, - const struct pios_spektrum_cfg *cfg, - const struct pios_com_driver *driver, - uint32_t lower_id, - enum pios_dsm_proto proto, - uint8_t bind); +extern int32_t PIOS_DSM_Init(uint32_t *dsm_id, + const struct pios_dsm_cfg *cfg, + const struct pios_com_driver *driver, + uint32_t lower_id, + enum pios_dsm_proto proto, + uint8_t bind); -#endif /* PIOS_SPEKTRUM_PRIV_H */ +#endif /* PIOS_DSM_PRIV_H */ /** * @} diff --git a/flight/PiOS/pios.h b/flight/PiOS/pios.h index a675f93b1..6347983d3 100644 --- a/flight/PiOS/pios.h +++ b/flight/PiOS/pios.h @@ -79,7 +79,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj b/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj index 0b3b6fe51..d807e49ad 100644 --- a/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj +++ b/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj @@ -96,7 +96,7 @@ 65643CAD1413322000A32F59 /* pios_rtc_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_rtc_priv.h; sourceTree = ""; }; 65643CAE1413322000A32F59 /* pios_sbus_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_sbus_priv.h; sourceTree = ""; }; 65643CAF1413322000A32F59 /* pios_sbus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_sbus.h; sourceTree = ""; }; - 65643CB01413322000A32F59 /* pios_spektrum_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_spektrum_priv.h; sourceTree = ""; }; + 65643CB01413322000A32F59 /* pios_dsm_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_dsm_priv.h; sourceTree = ""; }; 65643CB91413456D00A32F59 /* pios_tim.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pios_tim.c; sourceTree = ""; }; 65643CBA141350C200A32F59 /* pios_sbus.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pios_sbus.c; sourceTree = ""; }; 6572CB1613D0F2B200FC2972 /* link_STM32103CB_CC_Rev1_memory.ld */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = link_STM32103CB_CC_Rev1_memory.ld; path = ../../PiOS/STM32F10x/link_STM32103CB_CC_Rev1_memory.ld; sourceTree = SOURCE_ROOT; }; @@ -2796,7 +2796,7 @@ 65E8F04911EFF25C00BBF654 /* pios_pwm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pios_pwm.h; path = ../../PiOS/inc/pios_pwm.h; sourceTree = SOURCE_ROOT; }; 65E8F04A11EFF25C00BBF654 /* pios_sdcard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pios_sdcard.h; path = ../../PiOS/inc/pios_sdcard.h; sourceTree = SOURCE_ROOT; }; 65E8F04B11EFF25C00BBF654 /* pios_servo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pios_servo.h; path = ../../PiOS/inc/pios_servo.h; sourceTree = SOURCE_ROOT; }; - 65E8F04C11EFF25C00BBF654 /* pios_spektrum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pios_spektrum.h; path = ../../PiOS/inc/pios_spektrum.h; sourceTree = SOURCE_ROOT; }; + 65E8F04C11EFF25C00BBF654 /* pios_dsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pios_dsm.h; path = ../../PiOS/inc/pios_dsm.h; sourceTree = SOURCE_ROOT; }; 65E8F04D11EFF25C00BBF654 /* pios_spi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pios_spi.h; path = ../../PiOS/inc/pios_spi.h; sourceTree = SOURCE_ROOT; }; 65E8F04E11EFF25C00BBF654 /* pios_spi_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pios_spi_priv.h; path = ../../PiOS/inc/pios_spi_priv.h; sourceTree = SOURCE_ROOT; }; 65E8F04F11EFF25C00BBF654 /* pios_stm32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pios_stm32.h; path = ../../PiOS/inc/pios_stm32.h; sourceTree = SOURCE_ROOT; }; @@ -2925,7 +2925,7 @@ 65E8F0E411EFF25C00BBF654 /* pios_ppm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pios_ppm.c; path = ../../PiOS/STM32F10x/pios_ppm.c; sourceTree = SOURCE_ROOT; }; 65E8F0E511EFF25C00BBF654 /* pios_pwm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pios_pwm.c; path = ../../PiOS/STM32F10x/pios_pwm.c; sourceTree = SOURCE_ROOT; }; 65E8F0E611EFF25C00BBF654 /* pios_servo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pios_servo.c; path = ../../PiOS/STM32F10x/pios_servo.c; sourceTree = SOURCE_ROOT; }; - 65E8F0E711EFF25C00BBF654 /* pios_spektrum.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pios_spektrum.c; path = ../../PiOS/STM32F10x/pios_spektrum.c; sourceTree = SOURCE_ROOT; }; + 65E8F0E711EFF25C00BBF654 /* pios_dsm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pios_dsm.c; path = ../../PiOS/STM32F10x/pios_dsm.c; sourceTree = SOURCE_ROOT; }; 65E8F0E811EFF25C00BBF654 /* pios_spi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pios_spi.c; path = ../../PiOS/STM32F10x/pios_spi.c; sourceTree = SOURCE_ROOT; }; 65E8F0E911EFF25C00BBF654 /* pios_sys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pios_sys.c; path = ../../PiOS/STM32F10x/pios_sys.c; sourceTree = SOURCE_ROOT; }; 65E8F0EA11EFF25C00BBF654 /* pios_usart.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pios_usart.c; path = ../../PiOS/STM32F10x/pios_usart.c; sourceTree = SOURCE_ROOT; }; @@ -7739,8 +7739,8 @@ 65E8F04A11EFF25C00BBF654 /* pios_sdcard.h */, 65E8F04B11EFF25C00BBF654 /* pios_servo.h */, 65FBE14412E7C98100176B5A /* pios_servo_priv.h */, - 65E8F04C11EFF25C00BBF654 /* pios_spektrum.h */, - 65643CB01413322000A32F59 /* pios_spektrum_priv.h */, + 65E8F04C11EFF25C00BBF654 /* pios_dsm.h */, + 65643CB01413322000A32F59 /* pios_dsm_priv.h */, 65E8F04D11EFF25C00BBF654 /* pios_spi.h */, 65E8F04E11EFF25C00BBF654 /* pios_spi_priv.h */, 65E8F04F11EFF25C00BBF654 /* pios_stm32.h */, @@ -7782,7 +7782,7 @@ 6589A9DB131DEE76006BD67C /* pios_rtc.c */, 65643CBA141350C200A32F59 /* pios_sbus.c */, 65E8F0E611EFF25C00BBF654 /* pios_servo.c */, - 65E8F0E711EFF25C00BBF654 /* pios_spektrum.c */, + 65E8F0E711EFF25C00BBF654 /* pios_dsm.c */, 65E8F0E811EFF25C00BBF654 /* pios_spi.c */, 65E8F0E911EFF25C00BBF654 /* pios_sys.c */, 65643CB91413456D00A32F59 /* pios_tim.c */,