From ce7f4241316253f22f05571f26c85697fea46f75 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 11 Oct 2011 00:17:21 -0500 Subject: [PATCH] CC: When receiver port is set to PPM_SERVO use the spare pins as outputs --- flight/CopterControl/System/pios_board.c | 12 ++++++++++- .../OpenPilotOSX.xcodeproj/project.pbxproj | 20 +------------------ shared/uavobjectdefinition/hwsettings.xml | 2 +- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/flight/CopterControl/System/pios_board.c b/flight/CopterControl/System/pios_board.c index df0076955..71fdd54e9 100644 --- a/flight/CopterControl/System/pios_board.c +++ b/flight/CopterControl/System/pios_board.c @@ -1345,6 +1345,7 @@ void PIOS_Board_Init(void) { #endif /* PIOS_INCLUDE_PWM */ break; case HWSETTINGS_CC_RCVRPORT_PPM: + case HWSETTINGS_CC_RCVRPORT_PPM_SERVO: #if defined(PIOS_INCLUDE_PPM) { uint32_t pios_ppm_id; @@ -1374,7 +1375,16 @@ void PIOS_Board_Init(void) { GPIO_PinRemapConfig( GPIO_Remap_SWJ_NoJTRST, ENABLE); #ifndef PIOS_DEBUG_ENABLE_DEBUG_PINS - PIOS_Servo_Init(&pios_servo_cfg); + switch (hwsettings_rcvrport) { + case HWSETTINGS_CC_RCVRPORT_DISABLED: + case HWSETTINGS_CC_RCVRPORT_PWM: + case HWSETTINGS_CC_RCVRPORT_PPM: + PIOS_Servo_Init(&pios_servo_cfg); + break; + case HWSETTINGS_CC_RCVRPORT_PPM_SERVO: + PIOS_Servo_Init(&pios_servo_rcvr_cfg); + break; + } #else PIOS_DEBUG_Init(&pios_tim_servo_all_channels, NELEMENTS(pios_tim_servo_all_channels)); #endif /* PIOS_DEBUG_ENABLE_DEBUG_PINS */ diff --git a/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj b/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj index b860e748c..06c0487b7 100644 --- a/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj +++ b/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj @@ -99,8 +99,6 @@ 65643CB01413322000A32F59 /* pios_spektrum_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_spektrum_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 = ""; }; - 65643CEC141429A100A32F59 /* NMEA.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = NMEA.c; sourceTree = ""; }; - 65643CEE141429AF00A32F59 /* NMEA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NMEA.h; 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; }; 6572CB1713D0F2B200FC2972 /* link_STM32103CB_CC_Rev1_sections.ld */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = link_STM32103CB_CC_Rev1_sections.ld; path = ../../PiOS/STM32F10x/link_STM32103CB_CC_Rev1_sections.ld; sourceTree = SOURCE_ROOT; }; 657CEEAD121DB6C8007A1FBE /* homelocation.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = homelocation.xml; sourceTree = ""; }; @@ -7436,7 +7434,6 @@ 65C35E4F12EFB2F3004811C2 /* uavobjectdefinition */ = { isa = PBXGroup; children = ( - 65E6D80713E3A4D0002A557A /* hwsettings.xml */, 65E8C788139AA2A800E1F979 /* accessorydesired.xml */, 65C35E5012EFB2F3004811C2 /* actuatorcommand.xml */, 65C35E5112EFB2F3004811C2 /* actuatordesired.xml */, @@ -7463,6 +7460,7 @@ 65C35E6412EFB2F3004811C2 /* gpstime.xml */, 65C35E6512EFB2F3004811C2 /* guidancesettings.xml */, 65C35E6612EFB2F3004811C2 /* homelocation.xml */, + 65E6D80713E3A4D0002A557A /* hwsettings.xml */, 65C35E6712EFB2F3004811C2 /* i2cstats.xml */, 65C35E6812EFB2F3004811C2 /* manualcontrolcommand.xml */, 65C35E6912EFB2F3004811C2 /* manualcontrolsettings.xml */, @@ -7768,24 +7766,8 @@ 65E8F05811EFF25C00BBF654 /* STM32F10x */ = { isa = PBXGroup; children = ( - 65D1FBD813F51865006374A6 /* pios_bmp085.c */, - 6560A39D13EE277E00105DA5 /* pios_iap.c */, - 6560A39E13EE277E00105DA5 /* pios_sbus.c */, - 6560A38E13EE270C00105DA5 /* link_STM3210E_INS_BL_sections.ld */, - 6560A38F13EE270C00105DA5 /* link_STM3210E_INS_memory.ld */, - 6560A39013EE270C00105DA5 /* link_STM3210E_INS_sections.ld */, - 6560A39113EE270C00105DA5 /* link_STM3210E_OP_BL_sections.ld */, - 6560A39213EE270C00105DA5 /* link_STM3210E_OP_memory.ld */, - 6560A39313EE270C00105DA5 /* link_STM3210E_OP_sections.ld */, - 6560A39413EE270C00105DA5 /* link_STM32103CB_AHRS_BL_sections.ld */, - 6560A39513EE270C00105DA5 /* link_STM32103CB_AHRS_memory.ld */, - 6560A39613EE270C00105DA5 /* link_STM32103CB_AHRS_sections.ld */, - 6560A39713EE270C00105DA5 /* link_STM32103CB_CC_Rev1_BL_sections.ld */, 6572CB1613D0F2B200FC2972 /* link_STM32103CB_CC_Rev1_memory.ld */, 6572CB1713D0F2B200FC2972 /* link_STM32103CB_CC_Rev1_sections.ld */, - 6560A39813EE270C00105DA5 /* link_STM32103CB_PIPXTREME_BL_sections.ld */, - 6560A39913EE270C00105DA5 /* link_STM32103CB_PIPXTREME_memory.ld */, - 6560A39A13EE270C00105DA5 /* link_STM32103CB_PIPXTREME_sections.ld */, 65E8F05911EFF25C00BBF654 /* Libraries */, 65E8F0D811EFF25C00BBF654 /* link_stm32f10x_HD.ld */, 65E8F0DB11EFF25C00BBF654 /* link_stm32f10x_MD.ld */, diff --git a/shared/uavobjectdefinition/hwsettings.xml b/shared/uavobjectdefinition/hwsettings.xml index 228d50b5e..e500282c2 100644 --- a/shared/uavobjectdefinition/hwsettings.xml +++ b/shared/uavobjectdefinition/hwsettings.xml @@ -3,7 +3,7 @@ Selection of optional hardware configurations. - +