diff --git a/Makefile b/Makefile index e78824e5e..dd3522760 100644 --- a/Makefile +++ b/Makefile @@ -158,7 +158,7 @@ $(BUILD_DIR): ############################################################### # Set up QT toolchain -QT_SDK_DIR := $(TOOLS_DIR)/qtsdk-v1.2 +QT_SDK_DIR := $(TOOLS_DIR)/qtsdk-v1.2.1 .PHONY: qt_sdk_install qt_sdk_install: QT_SDK_URL := http://www.developer.nokia.com/dp?uri=http://sw.nokia.com/id/8ea74da4-fec1-4277-8b26-c58cc82e204b/Qt_SDK_Lin32_offline diff --git a/flight/PiOS/STM32F10x/pios_led.c b/flight/PiOS/STM32F10x/pios_led.c index 30c6f1296..1714a9165 100644 --- a/flight/PiOS/STM32F10x/pios_led.c +++ b/flight/PiOS/STM32F10x/pios_led.c @@ -93,7 +93,10 @@ void PIOS_LED_On(uint32_t led_id) const struct pios_led * led = &(led_cfg->leds[led_id]); - GPIO_ResetBits(led->pin.gpio, led->pin.init.GPIO_Pin); + if (led->active_high) + GPIO_SetBits(led->pin.gpio, led->pin.init.GPIO_Pin); + else + GPIO_ResetBits(led->pin.gpio, led->pin.init.GPIO_Pin); } /** @@ -111,7 +114,10 @@ void PIOS_LED_Off(uint32_t led_id) const struct pios_led * led = &(led_cfg->leds[led_id]); - GPIO_SetBits(led->pin.gpio, led->pin.init.GPIO_Pin); + if (led->active_high) + GPIO_ResetBits(led->pin.gpio, led->pin.init.GPIO_Pin); + else + GPIO_SetBits(led->pin.gpio, led->pin.init.GPIO_Pin); } /** @@ -130,9 +136,15 @@ void PIOS_LED_Toggle(uint32_t led_id) const struct pios_led * led = &(led_cfg->leds[led_id]); if (GPIO_ReadOutputDataBit(led->pin.gpio, led->pin.init.GPIO_Pin) == Bit_SET) { - PIOS_LED_On(led_id); + if (led->active_high) + PIOS_LED_Off(led_id); + else + PIOS_LED_On(led_id); } else { - PIOS_LED_Off(led_id); + if (led->active_high) + PIOS_LED_On(led_id); + else + PIOS_LED_Off(led_id); } } diff --git a/flight/PiOS/STM32F4xx/pios_led.c b/flight/PiOS/STM32F4xx/pios_led.c index c73d37198..5a8d25d33 100644 --- a/flight/PiOS/STM32F4xx/pios_led.c +++ b/flight/PiOS/STM32F4xx/pios_led.c @@ -77,7 +77,10 @@ void PIOS_LED_On(uint32_t led_id) const struct pios_led * led = &(led_cfg->leds[led_id]); - GPIO_ResetBits(led->pin.gpio, led->pin.init.GPIO_Pin); + if (led->active_high) + GPIO_SetBits(led->pin.gpio, led->pin.init.GPIO_Pin); + else + GPIO_ResetBits(led->pin.gpio, led->pin.init.GPIO_Pin); } /** @@ -95,7 +98,10 @@ void PIOS_LED_Off(uint32_t led_id) const struct pios_led * led = &(led_cfg->leds[led_id]); - GPIO_SetBits(led->pin.gpio, led->pin.init.GPIO_Pin); + if (led->active_high) + GPIO_ResetBits(led->pin.gpio, led->pin.init.GPIO_Pin); + else + GPIO_SetBits(led->pin.gpio, led->pin.init.GPIO_Pin); } /** @@ -114,9 +120,15 @@ void PIOS_LED_Toggle(uint32_t led_id) const struct pios_led * led = &(led_cfg->leds[led_id]); if (GPIO_ReadOutputDataBit(led->pin.gpio, led->pin.init.GPIO_Pin) == Bit_SET) { - PIOS_LED_On(led_id); + if (led->active_high) + PIOS_LED_Off(led_id); + else + PIOS_LED_On(led_id); } else { - PIOS_LED_Off(led_id); + if (led->active_high) + PIOS_LED_On(led_id); + else + PIOS_LED_Off(led_id); } } diff --git a/flight/PiOS/inc/pios_led_priv.h b/flight/PiOS/inc/pios_led_priv.h index 20f09eafc..36a1ee3f7 100644 --- a/flight/PiOS/inc/pios_led_priv.h +++ b/flight/PiOS/inc/pios_led_priv.h @@ -37,6 +37,7 @@ struct pios_led { struct stm32_gpio pin; uint32_t remap; + bool active_high; }; struct pios_led_cfg { diff --git a/flight/SimPosix/Makefile b/flight/SimPosix/Makefile index 84a9bb060..622d7f53c 100644 --- a/flight/SimPosix/Makefile +++ b/flight/SimPosix/Makefile @@ -71,6 +71,8 @@ PIOSINC = $(PIOS)/inc OPMODULEDIR = ../Modules FLIGHTLIB = ../Libraries FLIGHTLIBINC = ../Libraries/inc +MATHLIB = ../Libraries/math +MATHLIBINC = ../Libraries/math PIOSPOSIX = $(PIOS)/posix PIOSCOMMON = $(PIOS)/posix PIOSBOARDS = $(PIOS)/Boards @@ -132,6 +134,9 @@ SRC += $(FLIGHTLIB)/WorldMagModel.c SRC += $(FLIGHTLIB)/insgps13state.c SRC += $(FLIGHTLIB)/taskmonitor.c +SRC += $(MATHLIB)/sin_lookup.c +SRC += $(MATHLIB)/pid.c + ## PIOS Hardware (STM32F4xx) include $(PIOS)/posix/library.mk @@ -190,6 +195,7 @@ EXTRAINCDIRS += $(OPUAVOBJ) EXTRAINCDIRS += $(OPUAVOBJINC) EXTRAINCDIRS += $(UAVOBJSYNTHDIR) EXTRAINCDIRS += $(FLIGHTLIBINC) +EXTRAINCDIRS += $(MATHLIBINC) #EXTRAINCDIRS += $(PIOSSTM32F4XX) EXTRAINCDIRS += $(PIOSCOMMON) EXTRAINCDIRS += $(PIOSBOARDS) diff --git a/flight/SimPosix/UAVObjects.inc b/flight/SimPosix/UAVObjects.inc index 8953c7462..b2400f16b 100644 --- a/flight/SimPosix/UAVObjects.inc +++ b/flight/SimPosix/UAVObjects.inc @@ -63,6 +63,8 @@ UAVOBJSRCFILENAMES += positionactual UAVOBJSRCFILENAMES += positiondesired UAVOBJSRCFILENAMES += ratedesired UAVOBJSRCFILENAMES += revocalibration +UAVOBJSRCFILENAMES += relaytuning +UAVOBJSRCFILENAMES += relaytuningsettings UAVOBJSRCFILENAMES += sonaraltitude UAVOBJSRCFILENAMES += stabilizationdesired UAVOBJSRCFILENAMES += stabilizationsettings