diff --git a/MILESTONES.txt b/MILESTONES.txt index 528f1ce7e..f0dd1962d 100644 --- a/MILESTONES.txt +++ b/MILESTONES.txt @@ -112,17 +112,18 @@ C: Oleg Semyonov (osnwt) D: May 2011 V: http://www.youtube.com/watch?v=-J8cxqzxxWw -M: First Y6 CopterControl flight -C: ? -D: ? -V: +M: First V8 Octo OpenPilot flight +C: Sami Korhonen (Sambas) +D: May 2011 +V: http://vimeo.com/24258192 + An incomplete list of some future Milestones is below: +* First Y6 CopterControl flight * First Helicopter flight with OpenPilot -* First Octo flight with OpenPilot * First successful flight using the GCS only and no RC TX * First use of Magic Waypoint * First Flybarless Helicopter flight with OpenPilot diff --git a/Makefile b/Makefile index 0d2700868..6b0601ebb 100644 --- a/Makefile +++ b/Makefile @@ -77,19 +77,24 @@ help: @echo " all_flight - Build all firmware, bootloaders and bootloader updaters" @echo " all_fw - Build only firmware for all boards" @echo " all_bl - Build only bootloaders for all boards" - @echo " all_blupd - Build only bootloader updaters for all boards" + @echo " all_bu - Build only bootloader updaters for all boards" @echo @echo " all_clean - Remove your build directory ($(BUILD_DIR))" @echo " all_flight_clean - Remove all firmware, bootloaders and bootloader updaters" @echo " all_fw_clean - Remove firmware for all boards" @echo " all_bl_clean - Remove bootlaoders for all boards" - @echo " all_blupd_clean - Remove bootloader updaters for all boards" + @echo " all_bu_clean - Remove bootloader updaters for all boards" + @echo + @echo " all_ - Build all available images for " + @echo " all__clean - Remove all available images for " @echo @echo " [Firmware]" @echo " - Build firmware for " + @echo " supported boards are ($(ALL_BOARDS))" + @echo " fw_ - Build firmware for " @echo " supported boards are ($(FW_TARGETS))" - @echo " _clean - Remove firmware for " - @echo " _program - Use OpenOCD + JTAG to write firmware to " + @echo " fw__clean - Remove firmware for " + @echo " fw__program - Use OpenOCD + JTAG to write firmware to " @echo @echo " [Bootloader]" @echo " bl_ - Build bootloader for " @@ -98,9 +103,9 @@ help: @echo " bl__program - Use OpenOCD + JTAG to write bootloader to " @echo @echo " [Bootloader Updater]" - @echo " blupd_ - Build bootloader updater for " - @echo " supported boards are ($(BLUPD_TARGETS))" - @echo " blupd__clean - Remove bootloader updater for " + @echo " bu_ - Build bootloader updater for " + @echo " supported boards are ($(BU_TARGETS))" + @echo " bu__clean - Remove bootloader updater for " @echo @echo " [Simulation]" @echo " sim_posix - Build OpenPilot simulation firmware for" @@ -311,254 +316,128 @@ uavobjects_clean: # ############################## -FW_TARGETS := openpilot ahrs coptercontrol pipxtreme ins -BL_TARGETS := $(addprefix bl_, $(FW_TARGETS)) -BLUPD_TARGETS := $(addprefix blupd_, $(FW_TARGETS)) +# $(1) = Canonical board name all in lower case (e.g. coptercontrol) +# $(2) = Name of board used in source tree (e.g. CopterControl) +define FW_TEMPLATE +.PHONY: $(1) fw_$(1) +$(1): fw_$(1)_opfw +fw_$(1): fw_$(1)_opfw + +fw_$(1)_%: uavobjects_flight + $(V1) mkdir -p $(BUILD_DIR)/fw_$(1)/dep + $(V1) cd $(ROOT_DIR)/flight/$(2) && \ + $$(MAKE) -r --no-print-directory \ + BOARD_NAME=$(1) \ + TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ + REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \ + $$* + +.PHONY: $(1)_clean +$(1)_clean: fw_$(1)_clean +fw_$(1)_clean: + $(V0) @echo " CLEAN $$@" + $(V1) $(RM) -fr $(BUILD_DIR)/fw_$(1) +endef + +# $(1) = Canonical board name all in lower case (e.g. coptercontrol) +# $(2) = Name of board used in source tree (e.g. CopterControl) +define BL_TEMPLATE +.PHONY: bl_$(1) +bl_$(1): bl_$(1)_bin +bl_$(1)_bino: bl_$(1)_bin + +bl_$(1)_%: + $(V1) mkdir -p $(BUILD_DIR)/bl_$(1)/dep + $(V1) cd $(ROOT_DIR)/flight/Bootloaders/$(2) && \ + $$(MAKE) -r --no-print-directory \ + BOARD_NAME=$(1) \ + TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ + REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \ + $$* + +.PHONY: bl_$(1)_clean +bl_$(1)_clean: + $(V0) @echo " CLEAN $$@" + $(V1) $(RM) -fr $(BUILD_DIR)/bl_$(1) +endef + +# $(1) = Canonical board name all in lower case (e.g. coptercontrol) +define BU_TEMPLATE +.PHONY: bu_$(1) +bu_$(1): bu_$(1)_opfw + +bu_$(1)_%: bl_$(1)_bino + $(V1) mkdir -p $(BUILD_DIR)/bu_$(1)/dep + $(V1) cd $(ROOT_DIR)/flight/Bootloaders/BootloaderUpdater && \ + $$(MAKE) -r --no-print-directory \ + BOARD_NAME=$(1) \ + TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ + REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \ + $$* + +.PHONY: bu_$(1)_clean +bu_$(1)_clean: + $(V0) @echo " CLEAN $$@" + $(V1) $(RM) -fr $(BUILD_DIR)/bu_$(1) +endef + +# $(1) = Canonical board name all in lower case (e.g. coptercontrol) +define BOARD_PHONY_TEMPLATE +.PHONY: all_$(1) +all_$(1): $$(filter fw_$(1), $$(FW_TARGETS)) +all_$(1): $$(filter bl_$(1), $$(BL_TARGETS)) +all_$(1): $$(filter bu_$(1), $$(BU_TARGETS)) + +.PHONY: all_$(1)_clean +all_$(1)_clean: $$(addsuffix _clean, $$(filter fw_$(1), $$(FW_TARGETS))) +all_$(1)_clean: $$(addsuffix _clean, $$(filter bl_$(1), $$(BL_TARGETS))) +all_$(1)_clean: $$(addsuffix _clean, $$(filter bu_$(1), $$(BU_TARGETS))) +endef + +ALL_BOARDS := openpilot ahrs coptercontrol pipxtreme ins + +# Friendly names of each board (used to find source tree) +openpilot_friendly := OpenPilot +coptercontrol_friendly := CopterControl +pipxtreme_friendly := PipXtreme +ins_friendly := INS +ahrs_friendly := AHRS + +FW_TARGETS := $(addprefix fw_, $(ALL_BOARDS)) +BL_TARGETS := $(addprefix bl_, $(ALL_BOARDS)) +BU_TARGETS := $(addprefix bu_, $(ALL_BOARDS)) # FIXME: The INS build doesn't have a bootloader or bootloader # updater yet so we need to filter them out to prevent errors. -BL_TARGETS := $(filter-out bl_ins, $(BL_TARGETS)) -BLUPD_TARGETS := $(filter-out blupd_ins, $(BLUPD_TARGETS)) +BL_TARGETS := $(filter-out bl_ins, $(BL_TARGETS)) +BU_TARGETS := $(filter-out bu_ins, $(BU_TARGETS)) .PHONY: all_fw all_fw_clean -all_fw: $(addsuffix _bin, $(FW_TARGETS)) -all_fw_clean: $(addsuffix _clean, $(FW_TARGETS)) +all_fw: $(addsuffix _opfw, $(FW_TARGETS)) +all_fw_clean: $(addsuffix _clean, $(FW_TARGETS)) .PHONY: all_bl all_bl_clean -all_bl: $(addsuffix _bin, $(BL_TARGETS)) -all_bl_clean: $(addsuffix _clean, $(BL_TARGETS)) +all_bl: $(addsuffix _bin, $(BL_TARGETS)) +all_bl_clean: $(addsuffix _clean, $(BL_TARGETS)) -.PHONY: all_blupd all_blupd_clean -all_blupd: $(addsuffix _bin, $(BLUPD_TARGETS)) -all_blupd_clean: $(addsuffix _clean, $(BLUPD_TARGETS)) +.PHONY: all_bu all_bu_clean +all_bu: $(addsuffix _opfw, $(BU_TARGETS)) +all_bu_clean: $(addsuffix _clean, $(BU_TARGETS)) .PHONY: all_flight all_flight_clean -all_flight: all_fw all_bl all_blupd -all_flight_clean: all_fw_clean all_bl_clean all_blupd_clean +all_flight: all_fw all_bl all_bu +all_flight_clean: all_fw_clean all_bl_clean all_bu_clean -.PHONY: openpilot -openpilot: openpilot_bin +$(foreach board, $(ALL_BOARDS), $(eval $(call BOARD_PHONY_TEMPLATE,$(board)))) -openpilot_%: uavobjects_flight - $(V1) mkdir -p $(BUILD_DIR)/openpilot/dep - $(V1) cd $(ROOT_DIR)/flight/OpenPilot && \ - $(MAKE) -r --no-print-directory \ - OUTDIR="$(BUILD_DIR)/openpilot" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ - REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $* +# Expand the bootloader updater rules +$(foreach board, $(ALL_BOARDS), $(eval $(call BU_TEMPLATE,$(board),$($(board)_friendly)))) -.PHONY: openpilot_clean -openpilot_clean: - $(V0) @echo " CLEAN $@" - $(V1) $(RM) -fr $(BUILD_DIR)/openpilot - -.PHONY: bl_openpilot -bl_openpilot: bl_openpilot_bin -bl_openpilot_bino: bl_openpilot_bin - -bl_openpilot_%: - $(V1) mkdir -p $(BUILD_DIR)/bl_openpilot/dep - $(V1) cd $(ROOT_DIR)/flight/Bootloaders/OpenPilot && \ - $(MAKE) -r --no-print-directory \ - OUTDIR="$(BUILD_DIR)/bl_openpilot" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ - REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $* - -.PHONY: bl_openpilot_clean -bl_openpilot_clean: - $(V0) @echo " CLEAN $@" - $(V1) $(RM) -fr $(BUILD_DIR)/bl_openpilot - -.PHONY: blupd_openpilot -blupd_openpilot: blupd_openpilot_bin - -blupd_openpilot_%: bl_openpilot_bino - $(V1) mkdir -p $(BUILD_DIR)/blupd_openpilot/dep - $(V1) cd $(ROOT_DIR)/flight/Bootloaders/BootloaderUpdater && \ - $(MAKE) -r --no-print-directory \ - OUTDIR="$(BUILD_DIR)/blupd_openpilot" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ - REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \ - BOARD=STM3210E_OP MODEL=HD MODEL_SUFFIX=_OP \ - BLOBJ=$(BUILD_DIR)/bl_openpilot/OpenPilot_BL.bin.o $* - -.PHONY: blupd_openpilot_clean -blupd_openpilot_clean: - $(V0) @echo " CLEAN $@" - $(V1) $(RM) -fr $(BUILD_DIR)/blupd_openpilot - -.PHONY: ahrs -ahrs: ahrs_bin - -ahrs_%: uavobjects_flight - $(V1) mkdir -p $(BUILD_DIR)/ahrs/dep - $(V1) cd $(ROOT_DIR)/flight/AHRS && \ - $(MAKE) -r --no-print-directory \ - OUTDIR="$(BUILD_DIR)/ahrs" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ - REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $* - -.PHONY: ahrs_clean -ahrs_clean: - $(V0) @echo " CLEAN $@" - $(V1) $(RM) -fr $(BUILD_DIR)/ahrs - -.PHONY: bl_ahrs -bl_ahrs: bl_ahrs_bin -bl_ahrs_bino: bl_ahrs_bin - -bl_ahrs_%: - $(V1) mkdir -p $(BUILD_DIR)/bl_ahrs/dep - $(V1) cd $(ROOT_DIR)/flight/Bootloaders/AHRS && \ - $(MAKE) -r --no-print-directory \ - OUTDIR="$(BUILD_DIR)/bl_ahrs" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ - REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $* - -.PHONY: bl_ahrs_clean -bl_ahrs_clean: - $(V0) @echo " CLEAN $@" - $(V1) $(RM) -fr $(BUILD_DIR)/bl_ahrs - -.PHONY: blupd_ahrs -blupd_ahrs: blupd_ahrs_bin - -blupd_ahrs_%: bl_ahrs_bino bl_ahrs - $(V1) mkdir -p $(BUILD_DIR)/blupd_ahrs/dep - $(V1) cd $(ROOT_DIR)/flight/Bootloaders/BootloaderUpdater && \ - $(MAKE) -r --no-print-directory \ - OUTDIR="$(BUILD_DIR)/blupd_ahrs" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ - REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \ - BOARD=STM32103CB_AHRS MODEL=MD \ - BLOBJ=$(BUILD_DIR)/bl_ahrs/AHRS_BL.bin.o $* - -.PHONY: blupd_ahrs_clean -blupd_ahrs_clean: - $(V0) @echo " CLEAN $@" - $(V1) $(RM) -fr $(BUILD_DIR)/blupd_ahrs - -.PHONY: coptercontrol -coptercontrol: coptercontrol_bin - -coptercontrol_%: uavobjects_flight - $(V1) mkdir -p $(BUILD_DIR)/coptercontrol/dep - $(V1) cd $(ROOT_DIR)/flight/CopterControl && \ - $(MAKE) -r --no-print-directory \ - OUTDIR="$(BUILD_DIR)/coptercontrol" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ - REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $* - -.PHONY: coptercontrol_clean -coptercontrol_clean: - $(V0) @echo " CLEAN $@" - $(V1) $(RM) -fr $(BUILD_DIR)/coptercontrol - -.PHONY: bl_coptercontrol -bl_coptercontrol: bl_coptercontrol_bin -bl_coptercontrol_bino: bl_coptercontrol_bin - -bl_coptercontrol_%: - $(V1) mkdir -p $(BUILD_DIR)/bl_coptercontrol/dep - $(V1) cd $(ROOT_DIR)/flight/Bootloaders/CopterControl && \ - $(MAKE) -r --no-print-directory \ - OUTDIR="$(BUILD_DIR)/bl_coptercontrol" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ - REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $* - -.PHONY: bl_coptercontrol_clean -bl_coptercontrol_clean: - $(V0) @echo " CLEAN $@" - $(V1) $(RM) -fr $(BUILD_DIR)/bl_coptercontrol - -.PHONY: blupd_coptercontrol -blupd_coptercontrol: blupd_coptercontrol_bin - -blupd_coptercontrol_%: bl_coptercontrol_bino - $(V1) mkdir -p $(BUILD_DIR)/blupd_coptercontrol/dep - $(V1) cd $(ROOT_DIR)/flight/Bootloaders/BootloaderUpdater && \ - $(MAKE) -r --no-print-directory \ - OUTDIR="$(BUILD_DIR)/blupd_coptercontrol" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ - REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \ - BOARD=STM32103CB_CC_Rev1 MODEL=MD MODEL_SUFFIX=_CC \ - BLOBJ=$(BUILD_DIR)/bl_coptercontrol/CopterControl_BL.bin.o $* - -.PHONY: blupd_coptercontrol_clean -blupd_coptercontrol_clean: - $(V0) @echo " CLEAN $@" - $(V1) $(RM) -fr $(BUILD_DIR)/blupd_coptercontrol - -.PHONY: pipxtreme -pipxtreme: pipxtreme_bin - -pipxtreme_%: uavobjects_flight - $(V1) mkdir -p $(BUILD_DIR)/pipxtreme/dep - $(V1) cd $(ROOT_DIR)/flight/PipXtreme && \ - $(MAKE) -r --no-print-directory \ - OUTDIR="$(BUILD_DIR)/pipxtreme" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ - REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $* - -.PHONY: pipxtreme_clean -pipxtreme_clean: - $(V0) @echo " CLEAN $@" - $(V1) $(RM) -fr $(BUILD_DIR)/pipxtreme - -.PHONY: bl_pipxtreme -bl_pipxtreme: bl_pipxtreme_bin -bl_pipxtreme_bino: bl_pipxtreme_bin - -bl_pipxtreme_%: - $(V1) mkdir -p $(BUILD_DIR)/bl_pipxtreme/dep - $(V1) cd $(ROOT_DIR)/flight/Bootloaders/PipXtreme && \ - $(MAKE) -r --no-print-directory \ - OUTDIR="$(BUILD_DIR)/bl_pipxtreme" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ - REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $* - -.PHONY: bl_pipxtreme_clean -bl_pipxtreme_clean: - $(V0) @echo " CLEAN $@" - $(V1) $(RM) -fr $(BUILD_DIR)/bl_pipxtreme - -.PHONY: blupd_pipxtreme -blupd_pipxtreme: blupd_pipxtreme_bin - -blupd_pipxtreme_%: bl_pipxtreme_bino - $(V1) mkdir -p $(BUILD_DIR)/blupd_pipxtreme/dep - $(V1) cd $(ROOT_DIR)/flight/Bootloaders/BootloaderUpdater && \ - $(MAKE) -r --no-print-directory \ - OUTDIR="$(BUILD_DIR)/blupd_pipxtreme" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ - REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \ - BOARD=STM32103CB_PIPXTREME MODEL=MD MODEL_SUFFIX=_CC \ - BLOBJ=$(BUILD_DIR)/bl_pipxtreme/PipXtreme_BL.bin.o $* - -.PHONY: blupd_pipxtreme_clean -blupd_pipxtreme_clean: - $(V0) @echo " CLEAN $@" - $(V1) $(RM) -fr $(BUILD_DIR)/blupd_pipxtreme - - -.PHONY: ins -ins: ins_bin - -ins_%: uavobjects_flight - $(V1) mkdir -p $(BUILD_DIR)/ins/dep - $(V1) cd $(ROOT_DIR)/flight/INS && \ - $(MAKE) -r --no-print-directory \ - OUTDIR="$(BUILD_DIR)/ins" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ - REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $* - -.PHONY: ins_clean -ins_clean: - $(V0) @echo " CLEAN $@" - $(V1) $(RM) -fr $(BUILD_DIR)/ins - -.PHONY: bl_ins -bl_ins: bl_ins_elf - -bl_ins_%: - $(V1) mkdir -p $(BUILD_DIR)/bl_ins/dep - $(V1) cd $(ROOT_DIR)/flight/Bootloaders/INS && \ - $(MAKE) -r --no-print-directory \ - OUTDIR="$(BUILD_DIR)/bl_ins" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \ - REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $* - -.PHONY: bl_ins_clean -bl_ins_clean: - $(V0) @echo " CLEAN $@" - $(V1) $(RM) -fr $(BUILD_DIR)/bl_ins +# Expand the firmware rules +$(foreach board, $(ALL_BOARDS), $(eval $(call FW_TEMPLATE,$(board),$($(board)_friendly)))) +# Expand the bootloader rules +$(foreach board, $(ALL_BOARDS), $(eval $(call BL_TEMPLATE,$(board),$($(board)_friendly)))) .PHONY: sim_posix sim_posix: sim_posix_elf @@ -578,9 +457,9 @@ sim_win32_%: uavobjects_flight ############################## # -# Release packaging components +# Packaging components # ############################## -.PHONY: release -release: +.PHONY: package +package: $(V1) cd $@ && $(MAKE) --no-print-directory $@ diff --git a/artwork/Font/Copyright.txt b/artwork/Font/Copyright.txt index 52dfdf7de..92b0a4d87 100644 --- a/artwork/Font/Copyright.txt +++ b/artwork/Font/Copyright.txt @@ -16,5 +16,7 @@ Symbols: Capital A = OpenPilot Logo Capital B = CC-BY-SA +Capital B = CC-BY-NC-SA +Capital D = RoHS \ No newline at end of file diff --git a/artwork/Font/OpenPilot.ttf b/artwork/Font/OpenPilot.ttf index 60cada62a..852f8914a 100644 Binary files a/artwork/Font/OpenPilot.ttf and b/artwork/Font/OpenPilot.ttf differ diff --git a/artwork/GCS Icons/edit-delete.svg b/artwork/GCS Icons/edit-delete.svg new file mode 100644 index 000000000..8c6df9685 --- /dev/null +++ b/artwork/GCS Icons/edit-delete.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/artwork/GCS Icons/help-contents.svg b/artwork/GCS Icons/help-contents.svg new file mode 100644 index 000000000..620acb6ae --- /dev/null +++ b/artwork/GCS Icons/help-contents.svg @@ -0,0 +1,37 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/artwork/GCS Icons/help-hint.svg b/artwork/GCS Icons/help-hint.svg new file mode 100644 index 000000000..675b93dd6 --- /dev/null +++ b/artwork/GCS Icons/help-hint.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/artwork/GCS Icons/window-close.svg b/artwork/GCS Icons/window-close.svg new file mode 100644 index 000000000..f8e6a8d63 --- /dev/null +++ b/artwork/GCS Icons/window-close.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/artwork/Misc/multirotor-shapes.svg b/artwork/Misc/multirotor-shapes.svg index 2ff48cfdc..0d7a79c42 100644 --- a/artwork/Misc/multirotor-shapes.svg +++ b/artwork/Misc/multirotor-shapes.svg @@ -12,11 +12,11 @@ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" id="svg4183" version="1.1" - inkscape:version="0.48+devel r10146" + inkscape:version="0.48.1 r9760" width="4065.2493" height="1760.019" xml:space="preserve" - sodipodi:docname="quad-shapes.svg">image/svg+xml #include "pios.h" #include "ahrs_timer.h" #include "ahrs_spi_comm.h" @@ -1228,6 +1229,8 @@ void homelocation_callback(AhrsObjHandle obj) void firmwareiapobj_callback(AhrsObjHandle obj) { + const struct pios_board_info * bdinfo = &pios_board_info_blob; + FirmwareIAPObjData firmwareIAPObj; FirmwareIAPObjGet(&firmwareIAPObj); if(firmwareIAPObj.ArmReset==0) @@ -1235,7 +1238,7 @@ void firmwareiapobj_callback(AhrsObjHandle obj) if(firmwareIAPObj.ArmReset==1) { - if((firmwareIAPObj.BoardType==BOARD_TYPE) || (firmwareIAPObj.BoardType==0xFF)) + if((firmwareIAPObj.BoardType==bdinfo->board_type) || (firmwareIAPObj.BoardType==0xFF)) { ++reset_count; @@ -1247,11 +1250,11 @@ void firmwareiapobj_callback(AhrsObjHandle obj) } } } - else if(firmwareIAPObj.BoardType==BOARD_TYPE && firmwareIAPObj.crc!=PIOS_BL_HELPER_CRC_Memory_Calc()) + else if(firmwareIAPObj.BoardType==bdinfo->board_type && firmwareIAPObj.crc!=PIOS_BL_HELPER_CRC_Memory_Calc()) { - PIOS_BL_HELPER_FLASH_Read_Description(firmwareIAPObj.Description,SIZE_OF_DESCRIPTION); + PIOS_BL_HELPER_FLASH_Read_Description(firmwareIAPObj.Description,bdinfo->desc_size); firmwareIAPObj.crc=PIOS_BL_HELPER_CRC_Memory_Calc(); - firmwareIAPObj.BoardRevision=BOARD_REVISION; + firmwareIAPObj.BoardRevision=bdinfo->board_rev; FirmwareIAPObjSet(&firmwareIAPObj); } } diff --git a/flight/Bootloaders/AHRS/Makefile b/flight/Bootloaders/AHRS/Makefile index 4a43a6081..18bf8a269 100644 --- a/flight/Bootloaders/AHRS/Makefile +++ b/flight/Bootloaders/AHRS/Makefile @@ -25,6 +25,13 @@ WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST))) TOP := $(realpath $(WHEREAMI)/../../../) include $(TOP)/make/firmware-defs.mk +include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk + +# Target file name (without extension). +TARGET := bl_$(BOARD_NAME) + +# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) +OUTDIR := $(TOP)/build/$(TARGET) # Set developer code and compile options # Set to YES for debugging @@ -41,23 +48,6 @@ endif FLASH_TOOL = OPENOCD -# MCU name, submodel and board -# - MCU used for compiler-option (-mcpu) -# - MODEL used for linker-script name (-T) and passed as define -# - BOARD just passed as define (optional) -MCU = cortex-m3 -CHIP = STM32F103CBT -BOARD = STM32103CB_AHRS -MODEL = MD - - - -# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) -OUTDIR = $(TOP)/build/bl_ahrs - -# Target file name (without extension). -TARGET = AHRS_BL - # Paths AHRS_BL = ./ AHRS_BLINC = $(AHRS_BL)/inc @@ -149,7 +139,7 @@ CPPSRCARM = # Even though the DOS/Win* filesystem matches both .s and .S the same, # it will preserve the spelling of the filenames, and gcc itself does # care about how the name is spelled on its command-line. -ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL).S +ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S # List Assembler source files here which must be assembled in ARM-Mode.. ASRCARM = @@ -209,6 +199,15 @@ CDEFS = -DSTM32F10X_$(MODEL) CDEFS += -DUSE_STDPERIPH_DRIVER CDEFS += -DUSE_$(BOARD) +# Provide (only) the bootloader with board-specific defines +BLONLY_CDEFS += -DBOARD_TYPE=$(BOARD_TYPE) +BLONLY_CDEFS += -DBOARD_REVISION=$(BOARD_REVISION) +BLONLY_CDEFS += -DHW_TYPE=$(HW_TYPE) +BLONLY_CDEFS += -DBOOTLOADER_VERSION=$(BOOTLOADER_VERSION) +BLONLY_CDEFS += -DFW_BANK_BASE=$(FW_BANK_BASE) +BLONLY_CDEFS += -DFW_BANK_SIZE=$(FW_BANK_SIZE) +BLONLY_CDEFS += -DFW_DESC_SIZE=$(FW_DESC_SIZE) + # Place project-specific -D and/or -U options for # Assembler with preprocessor here. #ADEFS = -DUSE_IRQ_ASM_WRAPPER @@ -243,8 +242,9 @@ CFLAGS += -O$(OPT) ifeq ($(DEBUG),NO) CFLAGS += -fdata-sections -ffunction-sections endif -CFLAGS += -mcpu=$(MCU) -mthumb +CFLAGS += -mcpu=$(MCU) CFLAGS += $(CDEFS) +CFLAGS += $(BLONLY_CDEFS) CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) -I. CFLAGS += -mapcs-frame @@ -266,7 +266,7 @@ CONLYFLAGS += $(CSTANDARD) # Assembler flags. # -Wa,...: tell GCC to pass this to the assembler. # -ahlns: create listing -ASFLAGS = -mcpu=$(MCU) -mthumb -I. -x assembler-with-cpp +ASFLAGS = -mcpu=$(MCU) -I. -x assembler-with-cpp ASFLAGS += $(ADEFS) ASFLAGS += -Wa,-adhlns=$(addprefix $(OUTDIR)/, $(notdir $(addsuffix .lst, $(basename $<)))) ASFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) @@ -291,20 +291,8 @@ LDFLAGS += -lc -lgcc LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_BL_sections.ld -OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin -# Program -OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08000000 bin" -# Verify -OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08000000 bin" -# reset target -OOCD_CL+=-c "reset run" -# terminate OOCD after programming -OOCD_CL+=-c shutdown - # Define programs and commands. REMOVE = $(REMOVE_CMD) -f -###SHELL = sh -###COPY = cp # List of all source files. ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC) @@ -336,14 +324,6 @@ endif endif endif -# Program the device. -ifeq ($(FLASH_TOOL),OPENOCD) -# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script". -program: $(OUTDIR)/$(TARGET).bin - @echo "Programming with OPENOCD" - $(OOCD_EXE) $(OOCD_CL) -endif - # Link: create ELF output file from object files. $(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ))) @@ -373,6 +353,9 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM)) $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin +# Add jtag targets (program and wipe) +$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BL_BANK_BASE),$(BL_BANK_SIZE))) + .PHONY: elf lss sym hex bin bino elf: $(OUTDIR)/$(TARGET).elf lss: $(OUTDIR)/$(TARGET).lss @@ -383,8 +366,6 @@ bino: $(OUTDIR)/$(TARGET).bin.o # Display sizes of sections. $(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf)) -.PHONY: size -size: $(OUTDIR)/$(TARGET).elf_size # Generate Doxygen documents docs: @@ -437,4 +418,4 @@ else endif # Listing of phony targets. -.PHONY : all build clean clean_list program install +.PHONY : all build clean clean_list install diff --git a/flight/Bootloaders/AHRS/main.c b/flight/Bootloaders/AHRS/main.c index 30915cef0..b284e6365 100644 --- a/flight/Bootloaders/AHRS/main.c +++ b/flight/Bootloaders/AHRS/main.c @@ -33,6 +33,7 @@ /* OpenPilot Includes */ #include "ahrs_bl.h" +#include #include "pios_opahrs_proto.h" #include "bl_fsm.h" /* lfsm_state */ #include "stm32f10x_flash.h" @@ -108,6 +109,7 @@ static struct opahrs_msg_v0 link_rx_v0; static struct opahrs_msg_v0 user_tx_v0; static struct opahrs_msg_v0 user_rx_v0; void process_spi_request(void) { + const struct pios_board_info * bdinfo = &pios_board_info_blob; bool msg_to_process = FALSE; PIOS_IRQ_Disable(); @@ -166,15 +168,15 @@ void process_spi_request(void) { break; case OPAHRS_MSG_V0_REQ_MEM_MAP: opahrs_msg_v0_init_user_tx(&user_tx_v0, OPAHRS_MSG_V0_RSP_MEM_MAP); - user_tx_v0.payload.user.v.rsp.mem_map.density = HW_TYPE; + user_tx_v0.payload.user.v.rsp.mem_map.density = bdinfo->hw_type; user_tx_v0.payload.user.v.rsp.mem_map.rw_flags = (BOARD_READABLE - | (BOARD_WRITABLA << 1)); + | (BOARD_WRITABLE << 1)); user_tx_v0.payload.user.v.rsp.mem_map.size_of_code_memory - = SIZE_OF_CODE; + = bdinfo->fw_size; user_tx_v0.payload.user.v.rsp.mem_map.size_of_description - = SIZE_OF_DESCRIPTION; + = bdinfo->desc_size; user_tx_v0.payload.user.v.rsp.mem_map.start_of_user_code - = START_OF_USER_CODE; + = bdinfo->fw_base; lfsm_user_set_tx_v0(&user_tx_v0); break; case OPAHRS_MSG_V0_REQ_SERIAL: @@ -192,7 +194,7 @@ void process_spi_request(void) { PIOS_LED_On(LED1); opahrs_msg_v0_init_user_tx(&user_tx_v0, OPAHRS_MSG_V0_RSP_FWUP_STATUS); if (!(user_rx_v0.payload.user.v.req.fwup_data.adress - < START_OF_USER_CODE)) { + < bdinfo->fw_base)) { for (uint8_t x = 0; x < user_rx_v0.payload.user.v.req.fwup_data.size; ++x) { if (FLASH_ProgramWord( @@ -250,13 +252,10 @@ void process_spi_request(void) { return; } void jump_to_app() { - //while(TRUE) - //{ - // PIOS_LED_Toggle(LED1); - // PIOS_DELAY_WaitmS(1000); - //} + const struct pios_board_info * bdinfo = &pios_board_info_blob; + PIOS_LED_On(LED1); - if (((*(__IO uint32_t*) START_OF_USER_CODE) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */ + if (((*(__IO uint32_t*) bdinfo->fw_base) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */ FLASH_Lock(); RCC_APB2PeriphResetCmd(0xffffffff, ENABLE); RCC_APB1PeriphResetCmd(0xffffffff, ENABLE); @@ -265,10 +264,10 @@ void jump_to_app() { //_SetCNTR(0); // clear interrupt mask //_SetISTR(0); // clear all requests - JumpAddress = *(__IO uint32_t*) (START_OF_USER_CODE + 4); + JumpAddress = *(__IO uint32_t*) (bdinfo->fw_base + 4); Jump_To_Application = (pFunction) JumpAddress; /* Initialize user application's Stack Pointer */ - __set_MSP(*(__IO uint32_t*) START_OF_USER_CODE); + __set_MSP(*(__IO uint32_t*) bdinfo->fw_base); Jump_To_Application(); } else { boot_status = jump_failed; diff --git a/flight/Bootloaders/BootloaderUpdater/Makefile b/flight/Bootloaders/BootloaderUpdater/Makefile index 25de8140b..81aa163ec 100644 --- a/flight/Bootloaders/BootloaderUpdater/Makefile +++ b/flight/Bootloaders/BootloaderUpdater/Makefile @@ -25,6 +25,13 @@ WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST))) TOP := $(realpath $(WHEREAMI)/../../../) include $(TOP)/make/firmware-defs.mk +include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk + +# Target file name (without extension). +TARGET = bu_$(BOARD_NAME) + +# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) +OUTDIR := $(TOP)/build/$(TARGET) # Set developer code and compile options # Set to YES to compile for debugging @@ -51,21 +58,6 @@ endif FLASH_TOOL = OPENOCD -# MCU name, submodel and board -# - MCU used for compiler-option (-mcpu) -# - MODEL used for linker-script name (-T) and passed as define -# - BOARD just passed as define (optional) -MCU = cortex-m3 -CHIP = STM32F103CBT -BOARD ?= NULL -MODEL ?= NULL - -# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) -OUTDIR = ../../../build/bootloaders/BootloaderUpdater - -# Target file name (without extension). -TARGET = BL_Updater - # Paths OPSYSTEM = . OPSYSTEMINC = $(OPSYSTEM)/inc @@ -224,7 +216,6 @@ endif ifeq ($(ENABLE_AUX_UART), YES) CDEFS += -DPIOS_ENABLE_AUX_UART endif -CDEFS += -DUSE_BOOTLOADER # Place project-specific -D and/or -U options for # Assembler with preprocessor here. @@ -309,9 +300,9 @@ LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin # Program -OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08003000 bin" +OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) $(START_OF_FW_CODE) bin" # Verify -OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08003000 bin" +OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) $(START_OF_FW_CODE) bin" # reset target OOCD_CL+=-c "reset run" # terminate OOCD after programming @@ -364,6 +355,7 @@ program: $(OUTDIR)/$(TARGET).bin endif # Link: create ELF output file from object files. +BLOBJ := $(TOP)/build/bl_$(BOARD_NAME)/bl_$(BOARD_NAME).bin.o $(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ) $(BLOBJ))) # Assemble: create object files from assembler source files. @@ -392,14 +384,16 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM)) $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin -.PHONY: elf lss sym hex bin bino +$(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION))) + +.PHONY: elf lss sym hex bin bino opfw elf: $(OUTDIR)/$(TARGET).elf -elf.stripped: $(OUTDIR)/$(TARGET).elf.stripped lss: $(OUTDIR)/$(TARGET).lss sym: $(OUTDIR)/$(TARGET).sym hex: $(OUTDIR)/$(TARGET).hex bin: $(OUTDIR)/$(TARGET).bin bino: $(OUTDIR)/$(TARGET).bin.o +opfw: $(OUTDIR)/$(TARGET).opfw # Display sizes of sections. $(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf)) @@ -411,11 +405,11 @@ docs: doxygen $(DOXYGENDIR)/doxygen.cfg # Install: install binary file with prefix/suffix into install directory -install: $(OUTDIR)/$(TARGET).bin +install: $(OUTDIR)/$(TARGET).opfw ifneq ($(INSTALL_DIR),) @echo $(MSG_INSTALLING) $(call toprel, $<) $(V1) mkdir -p $(INSTALL_DIR) - $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin + $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opfw else $(error INSTALL_DIR must be specified for $@) endif diff --git a/flight/Bootloaders/CopterControl/Makefile b/flight/Bootloaders/CopterControl/Makefile index 08b97701c..4fc2f0f08 100644 --- a/flight/Bootloaders/CopterControl/Makefile +++ b/flight/Bootloaders/CopterControl/Makefile @@ -25,6 +25,13 @@ WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST))) TOP := $(realpath $(WHEREAMI)/../../../) include $(TOP)/make/firmware-defs.mk +include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk + +# Target file name (without extension). +TARGET := bl_$(BOARD_NAME) + +# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) +OUTDIR := $(TOP)/build/$(TARGET) # Set developer code and compile options # Set to YES to compile for debugging @@ -48,21 +55,6 @@ endif FLASH_TOOL = OPENOCD -# MCU name, submodel and board -# - MCU used for compiler-option (-mcpu) -# - MODEL used for linker-script name (-T) and passed as define -# - BOARD just passed as define (optional) -MCU = cortex-m3 -CHIP = STM32F103CBT -BOARD = STM32103CB_CC_Rev1 -MODEL = MD - -# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) -OUTDIR = $(TOP)/build/bl_coptercontrol - -# Target file name (without extension). -TARGET = CopterControl_BL - # Paths OPSYSTEM = . OPSYSTEMINC = $(OPSYSTEM)/inc @@ -181,7 +173,7 @@ CPPSRCARM = # Even though the DOS/Win* filesystem matches both .s and .S the same, # it will preserve the spelling of the filenames, and gcc itself does # care about how the name is spelled on its command-line. -ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL).S +ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S # List Assembler source files here which must be assembled in ARM-Mode.. ASRCARM = @@ -260,6 +252,15 @@ ifeq ($(ENABLE_AUX_UART), YES) CDEFS += -DPIOS_ENABLE_AUX_UART endif +# Provide (only) the bootloader with board-specific defines +BLONLY_CDEFS += -DBOARD_TYPE=$(BOARD_TYPE) +BLONLY_CDEFS += -DBOARD_REVISION=$(BOARD_REVISION) +BLONLY_CDEFS += -DHW_TYPE=$(HW_TYPE) +BLONLY_CDEFS += -DBOOTLOADER_VERSION=$(BOOTLOADER_VERSION) +BLONLY_CDEFS += -DFW_BANK_BASE=$(FW_BANK_BASE) +BLONLY_CDEFS += -DFW_BANK_SIZE=$(FW_BANK_SIZE) +BLONLY_CDEFS += -DFW_DESC_SIZE=$(FW_DESC_SIZE) + # Place project-specific -D and/or -U options for # Assembler with preprocessor here. #ADEFS = -DUSE_IRQ_ASM_WRAPPER @@ -295,8 +296,9 @@ ifeq ($(DEBUG),NO) CFLAGS += -ffunction-sections endif -CFLAGS += -mcpu=$(MCU) -mthumb +CFLAGS += -mcpu=$(MCU) CFLAGS += $(CDEFS) +CFLAGS += $(BLONLY_CDEFS) CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) -I. CFLAGS += -mapcs-frame @@ -316,7 +318,7 @@ CONLYFLAGS += $(CSTANDARD) # Assembler flags. # -Wa,...: tell GCC to pass this to the assembler. # -ahlns: create listing -ASFLAGS = -mcpu=$(MCU) -mthumb -I. -x assembler-with-cpp +ASFLAGS = -mcpu=$(MCU) -I. -x assembler-with-cpp ASFLAGS += $(ADEFS) ASFLAGS += -Wa,-adhlns=$(addprefix $(OUTDIR)/, $(notdir $(addsuffix .lst, $(basename $<)))) ASFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) @@ -341,20 +343,8 @@ LDFLAGS += -lc -lgcc LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_BL_sections.ld -OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin -# Program -OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08000000 bin" -# Verify -OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08000000 bin" -# reset target -OOCD_CL+=-c "reset run" -# terminate OOCD after programming -OOCD_CL+=-c shutdown - # Define programs and commands. REMOVE = $(REMOVE_CMD) -f -###SHELL = sh -###COPY = cp # List of all source files. ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC) @@ -394,14 +384,6 @@ ${OUTDIR}/InitMods.c: Makefile @echo ${quote}${foreach MOD, ${MODNAMES}, ${MOD}Initialize();}${quote} >> ${OUTDIR}/InitMods.c @echo ${quote}}${quote} >> ${OUTDIR}/InitMods.c -# Program the device. -ifeq ($(FLASH_TOOL),OPENOCD) -# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script". -program: $(OUTDIR)/$(TARGET).bin - @echo ${quote}Programming with OPENOCD${quote} - $(OOCD_EXE) $(OOCD_CL) -endif - # Link: create ELF output file from object files. $(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ))) @@ -431,6 +413,9 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM)) $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin +# Add jtag targets (program and wipe) +$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BL_BANK_BASE),$(BL_BANK_SIZE))) + .PHONY: elf lss sym hex bin bino elf: $(OUTDIR)/$(TARGET).elf lss: $(OUTDIR)/$(TARGET).lss @@ -441,8 +426,6 @@ bino: $(OUTDIR)/$(TARGET).bin.o # Display sizes of sections. $(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf)) -.PHONY: size -size: $(OUTDIR)/$(TARGET).elf_size # Generate Doxygen documents docs: @@ -495,4 +478,4 @@ else endif # Listing of phony targets. -.PHONY : all build clean clean_list program install +.PHONY : all build clean clean_list install diff --git a/flight/Bootloaders/CopterControl/main.c b/flight/Bootloaders/CopterControl/main.c index 23a8f16c1..67f6a4c32 100644 --- a/flight/Bootloaders/CopterControl/main.c +++ b/flight/Bootloaders/CopterControl/main.c @@ -27,6 +27,7 @@ */ /* Bootloader Includes */ #include +#include #include "stopwatch.h" #include "op_dfu.h" #include "usb_lib.h" @@ -163,7 +164,9 @@ int main() { } void jump_to_app() { - if (((*(__IO uint32_t*) START_OF_USER_CODE) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */ + const struct pios_board_info * bdinfo = &pios_board_info_blob; + + if (((*(__IO uint32_t*) bdinfo->fw_base) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */ FLASH_Lock(); RCC_APB2PeriphResetCmd(0xffffffff, ENABLE); RCC_APB1PeriphResetCmd(0xffffffff, ENABLE); @@ -171,10 +174,10 @@ void jump_to_app() { RCC_APB1PeriphResetCmd(0xffffffff, DISABLE); _SetCNTR(0); // clear interrupt mask _SetISTR(0); // clear all requests - JumpAddress = *(__IO uint32_t*) (START_OF_USER_CODE + 4); + JumpAddress = *(__IO uint32_t*) (bdinfo->fw_base + 4); Jump_To_Application = (pFunction) JumpAddress; /* Initialize user application's Stack Pointer */ - __set_MSP(*(__IO uint32_t*) START_OF_USER_CODE); + __set_MSP(*(__IO uint32_t*) bdinfo->fw_base); Jump_To_Application(); } else { DeviceState = failed_jump; diff --git a/flight/Bootloaders/CopterControl/op_dfu.c b/flight/Bootloaders/CopterControl/op_dfu.c index 854c7cb71..b45e1e798 100644 --- a/flight/Bootloaders/CopterControl/op_dfu.c +++ b/flight/Bootloaders/CopterControl/op_dfu.c @@ -30,6 +30,7 @@ #include "pios.h" #include "op_dfu.h" #include "pios_bl_helper.h" +#include //programmable devices Device devicesTable[10]; uint8_t numberOfDevices = 0; @@ -382,16 +383,18 @@ void processComand(uint8_t *xReceive_Buffer) { return; } void OPDfuIni(uint8_t discover) { + const struct pios_board_info * bdinfo = &pios_board_info_blob; Device dev; + dev.programmingType = Self_flash; - dev.readWriteFlags = (BOARD_READABLE | (BOARD_WRITABLA << 1)); - dev.startOfUserCode = START_OF_USER_CODE; - dev.sizeOfCode = SIZE_OF_CODE; - dev.sizeOfDescription = SIZE_OF_DESCRIPTION; - dev.BL_Version = BOOTLOADER_VERSION; + dev.readWriteFlags = (BOARD_READABLE | (BOARD_WRITABLE << 1)); + dev.startOfUserCode = bdinfo->fw_base; + dev.sizeOfCode = bdinfo->fw_size; + dev.sizeOfDescription = bdinfo->desc_size; + dev.BL_Version = bdinfo->bl_rev; dev.FW_Crc = CalcFirmCRC(); - dev.devID = (BOARD_TYPE << 8) | BOARD_REVISION; - dev.devType = HW_TYPE; + dev.devID = (bdinfo->board_type << 8) | (bdinfo->board_rev); + dev.devType = bdinfo->hw_type; numberOfDevices = 1; devicesTable[0] = dev; if (discover) { diff --git a/flight/Bootloaders/OpenPilot/Makefile b/flight/Bootloaders/OpenPilot/Makefile index 33a7f8705..e4285f7e0 100644 --- a/flight/Bootloaders/OpenPilot/Makefile +++ b/flight/Bootloaders/OpenPilot/Makefile @@ -25,6 +25,13 @@ WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST))) TOP := $(realpath $(WHEREAMI)/../../../) include $(TOP)/make/firmware-defs.mk +include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk + +# Target file name (without extension). +TARGET := bl_$(BOARD_NAME) + +# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) +OUTDIR := $(TOP)/build/$(TARGET) # Set developer code and compile options # Set to YES to compile for debugging @@ -48,21 +55,6 @@ endif FLASH_TOOL = OPENOCD -# MCU name, submodel and board -# - MCU used for compiler-option (-mcpu) -# - MODEL used for linker-script name (-T) and passed as define -# - BOARD just passed as define (optional) -MCU = cortex-m3 -CHIP = STM32F103RET -BOARD = STM3210E_OP -MODEL = HD - -# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) -OUTDIR = $(TOP)/build/bl_openpilot - -# Target file name (without extension). -TARGET = OpenPilot_BL - # Paths OPSYSTEM = . OPSYSTEMINC = $(OPSYSTEM)/inc @@ -184,7 +176,7 @@ CPPSRCARM = # Even though the DOS/Win* filesystem matches both .s and .S the same, # it will preserve the spelling of the filenames, and gcc itself does # care about how the name is spelled on its command-line. -ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)_OP.S +ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S # List Assembler source files here which must be assembled in ARM-Mode.. ASRCARM = @@ -263,6 +255,15 @@ ifeq ($(ENABLE_AUX_UART), YES) CDEFS += -DPIOS_ENABLE_AUX_UART endif +# Provide (only) the bootloader with board-specific defines +BLONLY_CDEFS += -DBOARD_TYPE=$(BOARD_TYPE) +BLONLY_CDEFS += -DBOARD_REVISION=$(BOARD_REVISION) +BLONLY_CDEFS += -DHW_TYPE=$(HW_TYPE) +BLONLY_CDEFS += -DBOOTLOADER_VERSION=$(BOOTLOADER_VERSION) +BLONLY_CDEFS += -DFW_BANK_BASE=$(FW_BANK_BASE) +BLONLY_CDEFS += -DFW_BANK_SIZE=$(FW_BANK_SIZE) +BLONLY_CDEFS += -DFW_DESC_SIZE=$(FW_DESC_SIZE) + # Place project-specific -D and/or -U options for # Assembler with preprocessor here. #ADEFS = -DUSE_IRQ_ASM_WRAPPER @@ -300,6 +301,7 @@ endif CFLAGS += -mcpu=$(MCU) CFLAGS += $(CDEFS) +CFLAGS += $(BLONLY_CDEFS) CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) -I. CFLAGS += -mapcs-frame @@ -344,20 +346,8 @@ LDFLAGS += -lc -lgcc LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_BL_sections.ld -OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin -# Program -OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08000000 bin" -# Verify -OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08000000 bin" -# reset target -OOCD_CL+=-c "reset run" -# terminate OOCD after programming -OOCD_CL+=-c shutdown - # Define programs and commands. REMOVE = $(REMOVE_CMD) -f -###SHELL = sh -###COPY = cp # List of all source files. ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC) @@ -397,14 +387,6 @@ ${OUTDIR}/InitMods.c: Makefile @echo ${quote}${foreach MOD, ${MODNAMES}, ${MOD}Initialize();}${quote} >> ${OUTDIR}/InitMods.c @echo ${quote}}${quote} >> ${OUTDIR}/InitMods.c -# Program the device. -ifeq ($(FLASH_TOOL),OPENOCD) -# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script". -program: $(OUTDIR)/$(TARGET).bin - @echo ${quote}Programming with OPENOCD${quote} - $(OOCD_EXE) $(OOCD_CL) -endif - # Link: create ELF output file from object files. $(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ))) @@ -434,6 +416,9 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM)) $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin +# Add jtag targets (program and wipe) +$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BL_BANK_BASE),$(BL_BANK_SIZE))) + .PHONY: elf lss sym hex bin bino elf: $(OUTDIR)/$(TARGET).elf lss: $(OUTDIR)/$(TARGET).lss @@ -444,8 +429,6 @@ bino: $(OUTDIR)/$(TARGET).bin.o # Display sizes of sections. $(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf)) -.PHONY: size -size: $(OUTDIR)/$(TARGET).elf_size # Generate Doxygen documents docs: @@ -498,4 +481,4 @@ else endif # Listing of phony targets. -.PHONY : all build clean clean_list program install +.PHONY : all build clean clean_list install diff --git a/flight/Bootloaders/OpenPilot/main.c b/flight/Bootloaders/OpenPilot/main.c index 4766caf41..3ed5a80aa 100644 --- a/flight/Bootloaders/OpenPilot/main.c +++ b/flight/Bootloaders/OpenPilot/main.c @@ -27,6 +27,7 @@ */ /* Bootloader Includes */ #include +#include #include "pios_opahrs.h" #include "stopwatch.h" #include "op_dfu.h" @@ -216,7 +217,9 @@ int main() { } void jump_to_app() { - if (((*(__IO uint32_t*) START_OF_USER_CODE) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */ + const struct pios_board_info * bdinfo = &pios_board_info_blob; + + if (((*(__IO uint32_t*) bdinfo->fw_base) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */ FLASH_Lock(); RCC_APB2PeriphResetCmd(0xffffffff, ENABLE); RCC_APB1PeriphResetCmd(0xffffffff, ENABLE); @@ -225,10 +228,10 @@ void jump_to_app() { _SetCNTR(0); // clear interrupt mask _SetISTR(0); // clear all requests - JumpAddress = *(__IO uint32_t*) (START_OF_USER_CODE + 4); + JumpAddress = *(__IO uint32_t*) (bdinfo->fw_base + 4); Jump_To_Application = (pFunction) JumpAddress; /* Initialize user application's Stack Pointer */ - __set_MSP(*(__IO uint32_t*) START_OF_USER_CODE); + __set_MSP(*(__IO uint32_t*) bdinfo->fw_base); Jump_To_Application(); } else { DeviceState = failed_jump; diff --git a/flight/Bootloaders/OpenPilot/op_dfu.c b/flight/Bootloaders/OpenPilot/op_dfu.c index 77b4c2c59..bc62fff6c 100644 --- a/flight/Bootloaders/OpenPilot/op_dfu.c +++ b/flight/Bootloaders/OpenPilot/op_dfu.c @@ -30,6 +30,7 @@ #include "pios.h" #include "op_dfu.h" #include "pios_bl_helper.h" +#include #include "pios_opahrs.h" #include "ssp.h" /* Private typedef -----------------------------------------------------------*/ @@ -447,16 +448,18 @@ void processComand(uint8_t *xReceive_Buffer) { return; } void OPDfuIni(uint8_t discover) { + const struct pios_board_info * bdinfo = &pios_board_info_blob; Device dev; + dev.programmingType = Self_flash; - dev.readWriteFlags = (BOARD_READABLE | (BOARD_WRITABLA << 1)); - dev.startOfUserCode = START_OF_USER_CODE; - dev.sizeOfCode = SIZE_OF_CODE; - dev.sizeOfDescription = SIZE_OF_DESCRIPTION; - dev.BL_Version = BOOTLOADER_VERSION; + dev.readWriteFlags = (BOARD_READABLE | (BOARD_WRITABLE << 1)); + dev.startOfUserCode = bdinfo->fw_base; + dev.sizeOfCode = bdinfo->fw_size; + dev.sizeOfDescription = bdinfo->desc_size; + dev.BL_Version = bdinfo->bl_rev; dev.FW_Crc = CalcFirmCRC(); - dev.devID = (BOARD_TYPE << 8) | BOARD_REVISION; - dev.devType = HW_TYPE; + dev.devID = (bdinfo->board_type << 8) | (bdinfo->board_rev); + dev.devType = bdinfo->hw_type; numberOfDevices = 1; devicesTable[0] = dev; if (discover) { diff --git a/flight/Bootloaders/PipXtreme/Makefile b/flight/Bootloaders/PipXtreme/Makefile index 00fa37f81..dbf537bab 100644 --- a/flight/Bootloaders/PipXtreme/Makefile +++ b/flight/Bootloaders/PipXtreme/Makefile @@ -25,6 +25,13 @@ WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST))) TOP := $(realpath $(WHEREAMI)/../../../) include $(TOP)/make/firmware-defs.mk +include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk + +# Target file name (without extension). +TARGET := bl_$(BOARD_NAME) + +# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) +OUTDIR := $(TOP)/build/$(TARGET) # Set developer code and compile options # Set to YES to compile for debugging @@ -48,21 +55,6 @@ endif FLASH_TOOL = OPENOCD -# MCU name, submodel and board -# - MCU used for compiler-option (-mcpu) -# - MODEL used for linker-script name (-T) and passed as define -# - BOARD just passed as define (optional) -MCU = cortex-m3 -CHIP = STM32F103CBT -BOARD = STM32103CB_PIPXTREME -MODEL = MD - -# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) -OUTDIR = $(TOP)/build/bl_pipxtreme - -# Target file name (without extension). -TARGET = PipXtreme_BL - # Paths OPSYSTEM = . OPSYSTEMINC = $(OPSYSTEM)/inc @@ -180,7 +172,7 @@ CPPSRCARM = # Even though the DOS/Win* filesystem matches both .s and .S the same, # it will preserve the spelling of the filenames, and gcc itself does # care about how the name is spelled on its command-line. -ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL).S +ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S # List Assembler source files here which must be assembled in ARM-Mode.. ASRCARM = @@ -259,6 +251,17 @@ ifeq ($(ENABLE_AUX_UART), YES) CDEFS += -DPIOS_ENABLE_AUX_UART endif +# Provide (only) the bootloader with board-specific defines +BLONLY_CDEFS += -DBOARD_TYPE=$(BOARD_TYPE) +BLONLY_CDEFS += -DBOARD_REVISION=$(BOARD_REVISION) +BLONLY_CDEFS += -DHW_TYPE=$(HW_TYPE) +BLONLY_CDEFS += -DBOOTLOADER_VERSION=$(BOOTLOADER_VERSION) +BLONLY_CDEFS += -DFW_BANK_BASE=$(FW_BANK_BASE) +BLONLY_CDEFS += -DFW_BANK_SIZE=$(FW_BANK_SIZE) +BLONLY_CDEFS += -DFW_DESC_SIZE=$(FW_DESC_SIZE) +BLONLY_CDEFS += -DEE_BANK_BASE=$(EE_BANK_BASE) +BLONLY_CDEFS += -DEE_BANK_SIZE=$(EE_BANK_SIZE) + # Place project-specific -D and/or -U options for # Assembler with preprocessor here. #ADEFS = -DUSE_IRQ_ASM_WRAPPER @@ -294,8 +297,9 @@ ifeq ($(DEBUG),NO) CFLAGS += -ffunction-sections endif -CFLAGS += -mcpu=$(MCU) -mthumb +CFLAGS += -mcpu=$(MCU) CFLAGS += $(CDEFS) +CFLAGS += $(BLONLY_CDEFS) CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) -I. CFLAGS += -mapcs-frame @@ -315,7 +319,7 @@ CONLYFLAGS += $(CSTANDARD) # Assembler flags. # -Wa,...: tell GCC to pass this to the assembler. # -ahlns: create listing -ASFLAGS = -mcpu=$(MCU) -mthumb -I. -x assembler-with-cpp +ASFLAGS = -mcpu=$(MCU) -I. -x assembler-with-cpp ASFLAGS += $(ADEFS) ASFLAGS += -Wa,-adhlns=$(addprefix $(OUTDIR)/, $(notdir $(addsuffix .lst, $(basename $<)))) ASFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) @@ -340,20 +344,8 @@ LDFLAGS += -lc -lgcc LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_BL_sections.ld -OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin -# Program -OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08000000 bin" -# Verify -OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08000000 bin" -# reset target -OOCD_CL+=-c "reset run" -# terminate OOCD after programming -OOCD_CL+=-c shutdown - # Define programs and commands. REMOVE = $(REMOVE_CMD) -f -###SHELL = sh -###COPY = cp # List of all source files. ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC) @@ -393,14 +385,6 @@ ${OUTDIR}/InitMods.c: Makefile @echo ${quote}${foreach MOD, ${MODNAMES}, ${MOD}Initialize();}${quote} >> ${OUTDIR}/InitMods.c @echo ${quote}}${quote} >> ${OUTDIR}/InitMods.c -# Program the device. -ifeq ($(FLASH_TOOL),OPENOCD) -# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script". -program: $(OUTDIR)/$(TARGET).bin - @echo ${quote}Programming with OPENOCD${quote} - $(OOCD_EXE) $(OOCD_CL) -endif - # Link: create ELF output file from object files. $(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ))) @@ -430,6 +414,9 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM)) $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin +# Add jtag targets (program and wipe) +$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BL_BANK_BASE),$(BL_BANK_SIZE))) + .PHONY: elf lss sym hex bin bino elf: $(OUTDIR)/$(TARGET).elf lss: $(OUTDIR)/$(TARGET).lss @@ -440,8 +427,6 @@ bino: $(OUTDIR)/$(TARGET).bin.o # Display sizes of sections. $(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf)) -.PHONY: size -size: $(OUTDIR)/$(TARGET).elf_size # Generate Doxygen documents docs: @@ -494,4 +479,4 @@ else endif # Listing of phony targets. -.PHONY : all build clean clean_list program install +.PHONY : all build clean clean_list install diff --git a/flight/Bootloaders/PipXtreme/main.c b/flight/Bootloaders/PipXtreme/main.c index a8eb5bcc6..d1568d163 100644 --- a/flight/Bootloaders/PipXtreme/main.c +++ b/flight/Bootloaders/PipXtreme/main.c @@ -27,6 +27,7 @@ */ /* Bootloader Includes */ #include +#include #include "stopwatch.h" #include "op_dfu.h" #include "usb_lib.h" @@ -170,7 +171,9 @@ int main() { } void jump_to_app() { - if (((*(__IO uint32_t*) START_OF_USER_CODE) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */ + const struct pios_board_info * bdinfo = &pios_board_info_blob; + + if (((*(__IO uint32_t*) bdinfo->fw_base) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */ FLASH_Lock(); RCC_APB2PeriphResetCmd(0xffffffff, ENABLE); RCC_APB1PeriphResetCmd(0xffffffff, ENABLE); @@ -179,10 +182,10 @@ void jump_to_app() { _SetCNTR(0); // clear interrupt mask _SetISTR(0); // clear all requests - JumpAddress = *(__IO uint32_t*) (START_OF_USER_CODE + 4); + JumpAddress = *(__IO uint32_t*) (bdinfo->fw_base + 4); Jump_To_Application = (pFunction) JumpAddress; /* Initialize user application's Stack Pointer */ - __set_MSP(*(__IO uint32_t*) START_OF_USER_CODE); + __set_MSP(*(__IO uint32_t*) bdinfo->fw_base); Jump_To_Application(); } else { DeviceState = failed_jump; diff --git a/flight/Bootloaders/PipXtreme/op_dfu.c b/flight/Bootloaders/PipXtreme/op_dfu.c index c413c31ba..770ce8237 100644 --- a/flight/Bootloaders/PipXtreme/op_dfu.c +++ b/flight/Bootloaders/PipXtreme/op_dfu.c @@ -30,6 +30,7 @@ #include "pios.h" #include "op_dfu.h" #include "pios_bl_helper.h" +#include /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ @@ -414,16 +415,18 @@ void processComand(uint8_t *xReceive_Buffer) { return; } void OPDfuIni(uint8_t discover) { + const struct pios_board_info * bdinfo = &pios_board_info_blob; Device dev; + dev.programmingType = Self_flash; - dev.readWriteFlags = (BOARD_READABLE | (BOARD_WRITABLA << 1)); - dev.startOfUserCode = START_OF_USER_CODE; - dev.sizeOfCode = SIZE_OF_CODE; - dev.sizeOfDescription = SIZE_OF_DESCRIPTION; - dev.BL_Version = BOOTLOADER_VERSION; + dev.readWriteFlags = (BOARD_READABLE | (BOARD_WRITABLE << 1)); + dev.startOfUserCode = bdinfo->fw_base; + dev.sizeOfCode = bdinfo->fw_size; + dev.sizeOfDescription = bdinfo->desc_size; + dev.BL_Version = bdinfo->bl_rev; dev.FW_Crc = CalcFirmCRC(); - dev.devID = (BOARD_TYPE << 8) | BOARD_REVISION; - dev.devType = HW_TYPE; + dev.devID = (bdinfo->board_type << 8) | (bdinfo->board_rev); + dev.devType = bdinfo->hw_type; numberOfDevices = 1; devicesTable[0] = dev; if (discover) { diff --git a/flight/CopterControl/Makefile b/flight/CopterControl/Makefile index 627882539..bdfa8e2b5 100644 --- a/flight/CopterControl/Makefile +++ b/flight/CopterControl/Makefile @@ -25,6 +25,13 @@ WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST))) TOP := $(realpath $(WHEREAMI)/../../) include $(TOP)/make/firmware-defs.mk +include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk + +# Target file name (without extension). +TARGET := fw_$(BOARD_NAME) + +# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) +OUTDIR := $(TOP)/build/$(TARGET) # Set developer code and compile options # Set to YES to compile for debugging @@ -57,21 +64,6 @@ FLASH_TOOL = OPENOCD # List of modules to include MODULES = Telemetry Attitude Stabilization Actuator ManualControl FirmwareIAP -# MCU name, submodel and board -# - MCU used for compiler-option (-mcpu) -# - MODEL used for linker-script name (-T) and passed as define -# - BOARD just passed as define (optional) -MCU = cortex-m3 -CHIP = STM32F103CBT -BOARD = STM32103CB_CC_Rev1 -MODEL = MD - -# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) -OUTDIR = $(TOP)/build/coptercontrol - -# Target file name (without extension). -TARGET = CopterControl - # Paths OPSYSTEM = ./System OPSYSTEMINC = $(OPSYSTEM)/inc @@ -195,6 +187,7 @@ SRC += $(PIOSSTM32F10X)/pios_spektrum.c SRC += $(PIOSSTM32F10X)/pios_debug.c SRC += $(PIOSSTM32F10X)/pios_gpio.c SRC += $(PIOSSTM32F10X)/pios_exti.c +SRC += $(PIOSSTM32F10X)/pios_rtc.c SRC += $(PIOSSTM32F10X)/pios_wdg.c @@ -299,7 +292,7 @@ CPPSRCARM = # Even though the DOS/Win* filesystem matches both .s and .S the same, # it will preserve the spelling of the filenames, and gcc itself does # care about how the name is spelled on its command-line. -ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)_CC.S +ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S # List Assembler source files here which must be assembled in ARM-Mode.. ASRCARM = @@ -381,7 +374,6 @@ endif ifeq ($(ENABLE_AUX_UART), YES) CDEFS += -DPIOS_ENABLE_AUX_UART endif -CDEFS += -DUSE_BOOTLOADER ifeq ($(ERASE_FLASH), YES) CDEFS += -DERASE_FLASH endif @@ -475,21 +467,9 @@ LDFLAGS += -lc -lgcc LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld -OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin -# Program -OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08003000 bin" -# Verify -OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08003000 bin" -# reset target -OOCD_CL+=-c "reset run" -# terminate OOCD after programming -OOCD_CL+=-c shutdown - # Define programs and commands. REMOVE = $(REMOVE_CMD) -f PYTHON = python -###SHELL = sh -###COPY = cp # List of all source files. ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC) @@ -540,13 +520,6 @@ ${OUTDIR}/InitMods.c: Makefile # @$(PYTHON) $(PYMITETOOLS)/pmGenPmFeatures.py $(PYMITEPLAT)/pmfeatures.py > $(OUTDIR)/pmfeatures.h # @$(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -f $(PYMITEPLAT)/pmfeatures.py -c -u -o $(OUTDIR)/pmlibusr_img.c --native-file=$(OUTDIR)/pmlibusr_nat.c $(FLIGHTPLANS)/test.py -ifeq ($(FLASH_TOOL),OPENOCD) -# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script". -program: $(OUTDIR)/$(TARGET).bin - @echo ${quote}Programming with OPENOCD${quote} - $(OOCD_EXE) $(OOCD_CL) -endif - # Link: create ELF output file from object files. $(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ))) @@ -576,29 +549,33 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM)) $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin -.PHONY: elf lss sym hex bin bino +$(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION))) + +# Add jtag targets (program and wipe) +$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE))) + +.PHONY: elf lss sym hex bin bino opfw elf: $(OUTDIR)/$(TARGET).elf lss: $(OUTDIR)/$(TARGET).lss sym: $(OUTDIR)/$(TARGET).sym hex: $(OUTDIR)/$(TARGET).hex bin: $(OUTDIR)/$(TARGET).bin bino: $(OUTDIR)/$(TARGET).bin.o +opfw: $(OUTDIR)/$(TARGET).opfw # Display sizes of sections. $(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf)) -.PHONY: size -size: $(OUTDIR)/$(TARGET).elf_size # Generate Doxygen documents docs: doxygen $(DOXYGENDIR)/doxygen.cfg # Install: install binary file with prefix/suffix into install directory -install: $(OUTDIR)/$(TARGET).bin +install: $(OUTDIR)/$(TARGET).opfw ifneq ($(INSTALL_DIR),) @echo $(MSG_INSTALLING) $(call toprel, $<) $(V1) mkdir -p $(INSTALL_DIR) - $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin + $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opfw else $(error INSTALL_DIR must be specified for $@) endif @@ -642,4 +619,4 @@ else endif # Listing of phony targets. -.PHONY : all build clean clean_list program gencode install +.PHONY : all build clean clean_list gencode install diff --git a/flight/CopterControl/System/inc/pios_config.h b/flight/CopterControl/System/inc/pios_config.h index af1b7d22d..98c900387 100644 --- a/flight/CopterControl/System/inc/pios_config.h +++ b/flight/CopterControl/System/inc/pios_config.h @@ -64,6 +64,7 @@ #define PIOS_INCLUDE_FREERTOS #define PIOS_INCLUDE_GPIO #define PIOS_INCLUDE_EXTI +#define PIOS_INCLUDE_RTC #define PIOS_INCLUDE_WDG #define PIOS_INCLUDE_BL_HELPER @@ -92,7 +93,7 @@ /* Task stack sizes */ #define PIOS_ACTUATOR_STACK_SIZE 1020 #define PIOS_MANUAL_STACK_SIZE 724 -#define PIOS_SYSTEM_STACK_SIZE 504 +#define PIOS_SYSTEM_STACK_SIZE 560 #define PIOS_STABILIZATION_STACK_SIZE 524 #define PIOS_TELEM_STACK_SIZE 500 diff --git a/flight/CopterControl/System/pios_board.c b/flight/CopterControl/System/pios_board.c index c5943ca3c..53dd5b505 100644 --- a/flight/CopterControl/System/pios_board.c +++ b/flight/CopterControl/System/pios_board.c @@ -348,39 +348,38 @@ void PIOS_USART_spektrum_irq_handler(void) } #include -void TIM2_IRQHandler(); -void TIM2_IRQHandler() __attribute__ ((alias ("PIOS_TIM2_irq_handler"))); +void RTC_IRQHandler(); +void RTC_IRQHandler() __attribute__ ((alias ("PIOS_SUPV_irq_handler"))); const struct pios_spektrum_cfg pios_spektrum_cfg = { .pios_usart_spektrum_cfg = &pios_usart_spektrum_cfg, - .tim_base_init = { - .TIM_Prescaler = (PIOS_MASTER_CLOCK / 1000000) - 1, /* For 1 uS accuracy */ - .TIM_ClockDivision = TIM_CKD_DIV1, - .TIM_CounterMode = TIM_CounterMode_Up, - .TIM_Period = ((1000000 / 120) - 1), //11ms-10*16b/115200bps atleast one interrupt between frames - .TIM_RepetitionCounter = 0x0000, - }, .gpio_init = { //used for bind feature .GPIO_Mode = GPIO_Mode_Out_PP, .GPIO_Speed = GPIO_Speed_2MHz, }, .remap = 0, .irq = { - .handler = TIM2_IRQHandler, + .handler = RTC_IRQHandler, .init = { .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID, .NVIC_IRQChannelSubPriority = 0, .NVIC_IRQChannelCmd = ENABLE, }, }, - .timer = TIM2, .port = GPIOB, - .ccr = TIM_IT_Update, .pin = GPIO_Pin_11, }; -void PIOS_TIM2_irq_handler() -{ - PIOS_SPEKTRUM_irq_handler(pios_usart_spektrum_id); +void PIOS_SUPV_irq_handler() { + if (RTC_GetITStatus(RTC_IT_SEC)) + { + /* Call the right handler */ + PIOS_SPEKTRUM_irq_handler(pios_usart_spektrum_id); + + /* Wait until last write operation on RTC registers has finished */ + RTC_WaitForLastTask(); + /* Clear the RTC Second interrupt */ + RTC_ClearITPendingBit(RTC_IT_SEC); + } } #endif /* PIOS_INCLUDE_SPEKTRUM */ @@ -441,14 +440,12 @@ const struct pios_servo_channel pios_servo_channels[] = { .channel = TIM_Channel_1, .pin = GPIO_Pin_4, }, -#ifndef PIOS_INCLUDE_SPEKTRUM { .timer = TIM2, .port = GPIOA, .channel = TIM_Channel_3, .pin = GPIO_Pin_2, }, -#endif }; const struct pios_servo_cfg pios_servo_cfg = { diff --git a/flight/INS/Makefile b/flight/INS/Makefile index 1b27d8cba..bd3bb52a9 100644 --- a/flight/INS/Makefile +++ b/flight/INS/Makefile @@ -25,11 +25,17 @@ WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST))) TOP := $(realpath $(WHEREAMI)/../../) include $(TOP)/make/firmware-defs.mk +include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk + +# Target file name (without extension). +TARGET := fw_$(BOARD_NAME) + +# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) +OUTDIR := $(TOP)/build/$(TARGET) # Set developer code and compile options # Set to YES for debugging DEBUG ?= YES -USE_BOOTLOADER ?= NO # Set to YES when using Code Sourcery toolchain CODE_SOURCERY ?= YES @@ -42,26 +48,6 @@ endif FLASH_TOOL = OPENOCD -# MCU name, submodel and board -# - MCU used for compiler-option (-mcpu) -# - MODEL used for linker-script name (-T) and passed as define -# - BOARD just passed as define (optional) -MCU = cortex-m3 -CHIP = STM32F103RET -BOARD = STM3210E_INS -MODEL = HD -ifeq ($(USE_BOOTLOADER), YES) -BOOT_MODEL = $(MODEL)_BL -else -BOOT_MODEL = $(MODEL)_NB -endif - -# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) -OUTDIR = $(TOP)/build/ins - -# Target file name (without extension). -TARGET = INS - # Paths INS = ./ INSINC = $(INS)/inc @@ -168,7 +154,7 @@ CPPSRCARM = # Even though the DOS/Win* filesystem matches both .s and .S the same, # it will preserve the spelling of the filenames, and gcc itself does # care about how the name is spelled on its command-line. -ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL).S +ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S # List Assembler source files here which must be assembled in ARM-Mode.. ASRCARM = @@ -231,9 +217,7 @@ CDEFS = -DSTM32F10X_$(MODEL) CDEFS += -DUSE_STDPERIPH_DRIVER CDEFS += -DUSE_$(BOARD) CDEFS += -DIN_INS -ifeq ($(USE_BOOTLOADER), YES) -CDEFS += -DUSE_BOOTLOADER -endif + # Place project-specific -D and/or -U options for # Assembler with preprocessor here. #ADEFS = -DUSE_IRQ_ASM_WRAPPER @@ -311,22 +295,11 @@ LDFLAGS += $(MATH_LIB) LDFLAGS += -lc -lgcc # Set linker-script name depending on selected submodel name -LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld - -OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf -# Program -OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)" -# Verify -OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)" -# reset target -OOCD_CL+=-c "reset run" -# # terminate OOCD after programming -OOCD_CL+=-c shutdown +LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld +LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld # Define programs and commands. REMOVE = $(REMOVE_CMD) -f -###SHELL = sh -###COPY = cp # List of all source files. ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC) @@ -358,21 +331,6 @@ endif endif endif -# Program the device. -ifeq ($(USE_BOOTLOADER), YES) -# Program the device with OP Upload Tool". -program: $(OUTDIR)/$(TARGET).bin - @echo ${quote}Programming with OP Upload Tool${quote} - ../../ground/src/experimental/upload-build-desktop/debug/OPUploadTool -d 1 -p $(OUTDIR)/$(TARGET).bin -else -ifeq ($(FLASH_TOOL),OPENOCD) -# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script". -program: $(OUTDIR)/$(TARGET).elf - @echo ${quote}Programming with OPENOCD${quote} - $(OOCD_EXE) $(OOCD_CL) -endif -endif - # Link: create ELF output file from object files. $(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ))) @@ -400,28 +358,35 @@ $(eval $(call PARTIAL_COMPILE_TEMPLATE, SRC)) # Compile: create assembler files from C source files. ARM only $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM)) -.PHONY: elf lss sym hex bin +$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin + +$(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION))) + +# Add jtag targets (program and wipe) +$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE))) + +.PHONY: elf lss sym hex bin bino opfw elf: $(OUTDIR)/$(TARGET).elf lss: $(OUTDIR)/$(TARGET).lss sym: $(OUTDIR)/$(TARGET).sym hex: $(OUTDIR)/$(TARGET).hex bin: $(OUTDIR)/$(TARGET).bin +bino: $(OUTDIR)/$(TARGET).bin.o +opfw: $(OUTDIR)/$(TARGET).opfw # Display sizes of sections. $(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf)) -.PHONY: size -size: $(OUTDIR)/$(TARGET).elf_size # Generate Doxygen documents docs: doxygen $(DOXYGENDIR)/doxygen.cfg # Install: install binary file with prefix/suffix into install directory -install: $(OUTDIR)/$(TARGET).bin +install: $(OUTDIR)/$(TARGET).opfw ifneq ($(INSTALL_DIR),) @echo $(MSG_INSTALLING) $(call toprel, $<) $(V1) mkdir -p $(INSTALL_DIR) - $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin + $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opfw else $(error INSTALL_DIR must be specified for $@) endif @@ -461,4 +426,4 @@ else endif # Listing of phony targets. -.PHONY : all build clean clean_list program install +.PHONY : all build clean clean_list install diff --git a/flight/Modules/FirmwareIAP/firmwareiap.c b/flight/Modules/FirmwareIAP/firmwareiap.c index 11e8721fd..395ed960f 100644 --- a/flight/Modules/FirmwareIAP/firmwareiap.c +++ b/flight/Modules/FirmwareIAP/firmwareiap.c @@ -27,6 +27,7 @@ #include #include "pios.h" +#include #include "openpilot.h" #include "firmwareiap.h" #include "firmwareiapobj.h" @@ -90,10 +91,12 @@ static void resetTask(UAVObjEvent *); int32_t FirmwareIAPInitialize() { - data.BoardType= BOARD_TYPE; + const struct pios_board_info * bdinfo = &pios_board_info_blob; + + data.BoardType= bdinfo->board_type; PIOS_BL_HELPER_FLASH_Read_Description(data.Description,FIRMWAREIAPOBJ_DESCRIPTION_NUMELEM); PIOS_SYS_SerialNumberGetBinary(data.CPUSerial); - data.BoardRevision= BOARD_REVISION; + data.BoardRevision= bdinfo->board_rev; data.ArmReset=0; data.crc = 0; FirmwareIAPObjSet( &data ); @@ -112,6 +115,7 @@ int32_t FirmwareIAPInitialize() static uint8_t iap_state = IAP_STATE_READY; static void FirmwareIAPCallback(UAVObjEvent* ev) { + const struct pios_board_info * bdinfo = &pios_board_info_blob; static uint32_t last_time = 0; uint32_t this_time; uint32_t delta; @@ -125,11 +129,11 @@ static void FirmwareIAPCallback(UAVObjEvent* ev) this_time = get_time(); delta = this_time - last_time; last_time = this_time; - if((data.BoardType==BOARD_TYPE)&&(data.crc != PIOS_BL_HELPER_CRC_Memory_Calc())) + if((data.BoardType==bdinfo->board_type)&&(data.crc != PIOS_BL_HELPER_CRC_Memory_Calc())) { PIOS_BL_HELPER_FLASH_Read_Description(data.Description,FIRMWAREIAPOBJ_DESCRIPTION_NUMELEM); PIOS_SYS_SerialNumberGetBinary(data.CPUSerial); - data.BoardRevision=BOARD_REVISION; + data.BoardRevision=bdinfo->board_rev; data.crc = PIOS_BL_HELPER_CRC_Memory_Calc(); FirmwareIAPObjSet( &data ); } diff --git a/flight/Modules/ManualControl/manualcontrol.c b/flight/Modules/ManualControl/manualcontrol.c index 0fccd9759..63543c67a 100644 --- a/flight/Modules/ManualControl/manualcontrol.c +++ b/flight/Modules/ManualControl/manualcontrol.c @@ -268,8 +268,8 @@ static void manualControlTask(void *parameters) // Set accessory channels cmd.Accessory1 = (settings.Accessory1 != MANUALCONTROLSETTINGS_ACCESSORY1_NONE) ? scaledChannel[settings.Accessory1] : 0; - cmd.Accessory2 = (settings.Accessory1 != MANUALCONTROLSETTINGS_ACCESSORY2_NONE) ? scaledChannel[settings.Accessory2] : 0; - cmd.Accessory3 = (settings.Accessory1 != MANUALCONTROLSETTINGS_ACCESSORY3_NONE) ? scaledChannel[settings.Accessory3] : 0; + cmd.Accessory2 = (settings.Accessory2 != MANUALCONTROLSETTINGS_ACCESSORY2_NONE) ? scaledChannel[settings.Accessory2] : 0; + cmd.Accessory3 = (settings.Accessory3 != MANUALCONTROLSETTINGS_ACCESSORY3_NONE) ? scaledChannel[settings.Accessory3] : 0; processFlightMode(&settings, flightMode); processArm(&cmd, &settings); diff --git a/flight/OpenPilot/Makefile b/flight/OpenPilot/Makefile index add129e41..a2a8e667b 100644 --- a/flight/OpenPilot/Makefile +++ b/flight/OpenPilot/Makefile @@ -25,6 +25,13 @@ WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST))) TOP := $(realpath $(WHEREAMI)/../../) include $(TOP)/make/firmware-defs.mk +include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk + +# Target file name (without extension). +TARGET := fw_$(BOARD_NAME) + +# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) +OUTDIR := $(TOP)/build/$(TARGET) # Set developer code and compile options # Set to YES to compile for debugging @@ -59,21 +66,6 @@ PYMODULES = FlightPlan #MODULES = Telemetry #MODULES += Osd/OsdEtStd -# MCU name, submodel and board -# - MCU used for compiler-option (-mcpu) -# - MODEL used for linker-script name (-T) and passed as define -# - BOARD just passed as define (optional) -MCU = cortex-m3 -CHIP = STM32F103RET -BOARD = STM3210E_OP -MODEL = HD - -# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) -OUTDIR = $(TOP)/build/openpilot - -# Target file name (without extension). -TARGET = OpenPilot - # Paths OPSYSTEM = ./System OPSYSTEMINC = $(OPSYSTEM)/inc @@ -287,7 +279,7 @@ CPPSRCARM = # Even though the DOS/Win* filesystem matches both .s and .S the same, # it will preserve the spelling of the filenames, and gcc itself does # care about how the name is spelled on its command-line. -ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)_OP.S +ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S # List Assembler source files here which must be assembled in ARM-Mode.. ASRCARM = @@ -369,7 +361,6 @@ endif ifeq ($(ENABLE_AUX_UART), YES) CDEFS += -DPIOS_ENABLE_AUX_UART endif -CDEFS += -DUSE_BOOTLOADER ifeq ($(USE_SPEKTRUM), YES) CDEFS += -DUSE_SPEKTRUM @@ -451,22 +442,9 @@ LDFLAGS += -lc -lgcc LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld -OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin -# Program -OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08005000 bin" -# Verify -OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08005000 bin" -# reset target -OOCD_CL+=-c "reset run" -# terminate OOCD after programming -OOCD_CL+=-c shutdown - - # Define programs and commands. REMOVE = $(REMOVE_CMD) -f PYTHON = python -###SHELL = sh -###COPY = cp # List of all source files. ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC) @@ -519,14 +497,6 @@ ${OUTDIR}/pmlib_img.c ${OUTDIR}/pmlib_nat.c ${OUTDIR}/pmlibusr_img.c ${OUTDIR}/p @$(PYTHON) $(PYMITETOOLS)/pmGenPmFeatures.py $(PYMITEPLAT)/pmfeatures.py > $(OUTDIR)/pmfeatures.h @$(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -f $(PYMITEPLAT)/pmfeatures.py -c -u -o $(OUTDIR)/pmlibusr_img.c --native-file=$(OUTDIR)/pmlibusr_nat.c $(FLIGHTPLANS)/test.py -# Program the device. -ifeq ($(FLASH_TOOL),OPENOCD) -# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script". -program: $(OUTDIR)/$(TARGET).bin - @echo ${quote}Programming with OPENOCD${quote} - $(OOCD_EXE) $(OOCD_CL) -endif - # Link: create ELF output file from object files. $(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ))) @@ -556,29 +526,33 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM)) $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin -.PHONY: elf lss sym hex bin bino +$(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION))) + +# Add jtag targets (program and wipe) +$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE))) + +.PHONY: elf lss sym hex bin bino opfw elf: $(OUTDIR)/$(TARGET).elf lss: $(OUTDIR)/$(TARGET).lss sym: $(OUTDIR)/$(TARGET).sym hex: $(OUTDIR)/$(TARGET).hex bin: $(OUTDIR)/$(TARGET).bin bino: $(OUTDIR)/$(TARGET).bin.o +opfw: $(OUTDIR)/$(TARGET).opfw # Display sizes of sections. $(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf)) -.PHONY: size -size: $(OUTDIR)/$(TARGET).elf_size # Generate Doxygen documents docs: doxygen $(DOXYGENDIR)/doxygen.cfg # Install: install binary file with prefix/suffix into install directory -install: $(OUTDIR)/$(TARGET).bin +install: $(OUTDIR)/$(TARGET).opfw ifneq ($(INSTALL_DIR),) @echo $(MSG_INSTALLING) $(call toprel, $<) $(V1) mkdir -p $(INSTALL_DIR) - $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin + $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opfw else $(error INSTALL_DIR must be specified for $@) endif @@ -622,4 +596,4 @@ else endif # Listing of phony targets. -.PHONY : all build clean clean_list program gencode install +.PHONY : all build clean clean_list gencode install diff --git a/flight/OpenPilot/System/inc/FreeRTOSConfig.h b/flight/OpenPilot/System/inc/FreeRTOSConfig.h index c2a07fa67..6336639a4 100644 --- a/flight/OpenPilot/System/inc/FreeRTOSConfig.h +++ b/flight/OpenPilot/System/inc/FreeRTOSConfig.h @@ -75,7 +75,7 @@ NVIC value of 255. */ #if defined(DEBUG) #define configGENERATE_RUN_TIME_STATS 1 #define INCLUDE_uxTaskGetRunTime 1 -#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() PIOS_RTC_Start() +#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() PIOS_RTC_Init() // Note: Using the tick count defeats the purpose here, need some timer on the scale of 10khz #define portGET_RUN_TIME_COUNTER_VALUE() PIOS_RTC_Counter() #endif diff --git a/flight/OpenPilot/System/pios_board.c b/flight/OpenPilot/System/pios_board.c index ccbf8fced..14be197e8 100644 --- a/flight/OpenPilot/System/pios_board.c +++ b/flight/OpenPilot/System/pios_board.c @@ -504,39 +504,38 @@ void PIOS_USART_spektrum_irq_handler(void) } #include -void TIM6_IRQHandler(); -void TIM6_IRQHandler() __attribute__ ((alias ("PIOS_TIM6_irq_handler"))); +void RTC_IRQHandler(); +void RTC_IRQHandler() __attribute__ ((alias ("PIOS_SUPV_irq_handler"))); const struct pios_spektrum_cfg pios_spektrum_cfg = { .pios_usart_spektrum_cfg = &pios_usart_spektrum_cfg, - .tim_base_init = { - .TIM_Prescaler = (PIOS_MASTER_CLOCK / 1000000) - 1, /* For 1 uS accuracy */ - .TIM_ClockDivision = TIM_CKD_DIV1, - .TIM_CounterMode = TIM_CounterMode_Up, - .TIM_Period = ((1000000 / 120) - 1), //11ms-10*16b/115200bps, atleast one interrupt between frames - .TIM_RepetitionCounter = 0x0000, - }, .gpio_init = { //used for bind feature .GPIO_Mode = GPIO_Mode_Out_PP, .GPIO_Speed = GPIO_Speed_2MHz, }, .remap = 0, .irq = { - .handler = TIM6_IRQHandler, + .handler = RTC_IRQHandler, .init = { .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID, .NVIC_IRQChannelSubPriority = 0, .NVIC_IRQChannelCmd = ENABLE, }, }, - .timer = TIM6, .port = GPIOA, - .ccr = TIM_IT_Update, .pin = GPIO_Pin_10, }; -void PIOS_TIM6_irq_handler() -{ - PIOS_SPEKTRUM_irq_handler(); +void PIOS_SUPV_irq_handler() { + if (RTC_GetITStatus(RTC_IT_SEC)) + { + /* Call the right handler */ + PIOS_SPEKTRUM_irq_handler(pios_usart_spektrum_id); + + /* Wait until last write operation on RTC registers has finished */ + RTC_WaitForLastTask(); + /* Clear the RTC Second interrupt */ + RTC_ClearITPendingBit(RTC_IT_SEC); + } } #endif /* PIOS_COM_SPEKTRUM */ @@ -1049,6 +1048,7 @@ void PIOS_Board_Init(void) { #if defined(PIOS_INCLUDE_SPEKTRUM) /* SPEKTRUM init must come before comms */ + PIOS_RTC_Init(); // Spektrum uses RTC to check for frame failures PIOS_SPEKTRUM_Init(); if (PIOS_USART_Init(&pios_usart_spektrum_id, &pios_usart_spektrum_cfg)) { diff --git a/flight/PiOS/Boards/STM32103CB_AHRS.h b/flight/PiOS/Boards/STM32103CB_AHRS.h index 8262f9730..b407c0f42 100644 --- a/flight/PiOS/Boards/STM32103CB_AHRS.h +++ b/flight/PiOS/Boards/STM32103CB_AHRS.h @@ -64,25 +64,8 @@ TIM8 | | | | //------------------------ // BOOTLOADER_SETTINGS //------------------------ -//#define FUNC_ID 2 -//#define HW_VERSION 69 - -#define BOOTLOADER_VERSION 0 -#define BOARD_TYPE 0x02 -#define BOARD_REVISION 0x01 -//#define HW_VERSION (BOARD_TYPE << 8) | BOARD_REVISION - -#define MEM_SIZE 0x20000 //128K -#define SIZE_OF_DESCRIPTION 100 -#define START_OF_USER_CODE (uint32_t)0x08002000 -#define SIZE_OF_CODE (uint32_t)(MEM_SIZE-(START_OF_USER_CODE-0x08000000)-SIZE_OF_DESCRIPTION) -#ifdef STM32F10X_HD - #define HW_TYPE 0 //0=high_density 1=medium_density; -#elif STM32F10X_MD - #define HW_TYPE 1 //0=high_density 1=medium_density; -#endif #define BOARD_READABLE TRUE -#define BOARD_WRITABLA TRUE +#define BOARD_WRITABLE TRUE #define MAX_DEL_RETRYS 3 //------------------------ @@ -107,11 +90,6 @@ TIM8 | | | | //------------------------- #define PIOS_MASTER_CLOCK 72000000 #define PIOS_PERIPHERAL_CLOCK (PIOS_MASTER_CLOCK / 2) -#if defined(USE_BOOTLOADER) -#define PIOS_NVIC_VECTTAB_FLASH (START_OF_USER_CODE) -#else -#define PIOS_NVIC_VECTTAB_FLASH ((uint32_t)0x08000000) -#endif //------------------------- // Interrupt Priorities diff --git a/flight/PiOS/Boards/STM32103CB_CC_Rev1.h b/flight/PiOS/Boards/STM32103CB_CC_Rev1.h index 09405bfa3..16e58b5c2 100644 --- a/flight/PiOS/Boards/STM32103CB_CC_Rev1.h +++ b/flight/PiOS/Boards/STM32103CB_CC_Rev1.h @@ -60,23 +60,8 @@ TIM4 | RC In 1 | Servo 3 | Servo 2 | Servo 1 //------------------------ // BOOTLOADER_SETTINGS //------------------------ -//#define FUNC_ID 2 -//#define HW_VERSION 69 - -#define BOOTLOADER_VERSION 0 -#define BOARD_TYPE 0x04 -#define BOARD_REVISION 0x01 -#define MEM_SIZE 0x20000 //128K -#define SIZE_OF_DESCRIPTION 100 -#define START_OF_USER_CODE (uint32_t)0x08003000 -#define SIZE_OF_CODE (uint32_t)(MEM_SIZE-(START_OF_USER_CODE-0x08000000)-SIZE_OF_DESCRIPTION) -#ifdef STM32F10X_HD - #define HW_TYPE 0 //0=high_density 1=medium_density; -#elif STM32F10X_MD - #define HW_TYPE 1 //0=high_density 1=medium_density; -#endif #define BOARD_READABLE TRUE -#define BOARD_WRITABLA TRUE +#define BOARD_WRITABLE TRUE #define MAX_DEL_RETRYS 3 @@ -117,11 +102,6 @@ TIM4 | RC In 1 | Servo 3 | Servo 2 | Servo 1 //------------------------- #define PIOS_MASTER_CLOCK 72000000 #define PIOS_PERIPHERAL_CLOCK (PIOS_MASTER_CLOCK / 2) -#if defined(USE_BOOTLOADER) -#define PIOS_NVIC_VECTTAB_FLASH (START_OF_USER_CODE) -#else -#define PIOS_NVIC_VECTTAB_FLASH ((uint32_t)0x08000000) -#endif //------------------------- // Interrupt Priorities diff --git a/flight/PiOS/Boards/STM32103CB_PIPXTREME_Rev1.h b/flight/PiOS/Boards/STM32103CB_PIPXTREME_Rev1.h index a4792a717..a8eead4bd 100644 --- a/flight/PiOS/Boards/STM32103CB_PIPXTREME_Rev1.h +++ b/flight/PiOS/Boards/STM32103CB_PIPXTREME_Rev1.h @@ -58,20 +58,8 @@ TIM4 | STOPWATCH | //------------------------ // BOOTLOADER_SETTINGS //------------------------ -#define BOOTLOADER_VERSION 0 -#define BOARD_TYPE 0x03 -#define BOARD_REVISION 0x01 -#define MEM_SIZE (0x20000 - 0x00400) // 128K - 1K (reserved for config data) -#define SIZE_OF_DESCRIPTION 100 -#define START_OF_USER_CODE (uint32_t)0x08003000 -#define SIZE_OF_CODE (uint32_t)(MEM_SIZE-(START_OF_USER_CODE-0x08000000)-SIZE_OF_DESCRIPTION) -#ifdef STM32F10X_HD - #define HW_TYPE 0 //0=high_density 1=medium_density; -#elif STM32F10X_MD - #define HW_TYPE 1 //0=high_density 1=medium_density; -#endif #define BOARD_READABLE TRUE -#define BOARD_WRITABLA TRUE +#define BOARD_WRITABLE TRUE #define MAX_DEL_RETRYS 3 @@ -81,12 +69,6 @@ TIM4 | STOPWATCH | #define PIOS_MASTER_CLOCK 72000000ul #define PIOS_PERIPHERAL_CLOCK (PIOS_MASTER_CLOCK / 2) -#if defined(USE_BOOTLOADER) - #define PIOS_NVIC_VECTTAB_FLASH (START_OF_USER_CODE) -#else - #define PIOS_NVIC_VECTTAB_FLASH ((uint32_t)0x08000000) -#endif - // ***************************************************************** // Interrupt Priorities diff --git a/flight/PiOS/Boards/STM3210E_INS.h b/flight/PiOS/Boards/STM3210E_INS.h index 22c94837b..d0c988b21 100644 --- a/flight/PiOS/Boards/STM3210E_INS.h +++ b/flight/PiOS/Boards/STM3210E_INS.h @@ -69,27 +69,8 @@ TIM8 | | | | //------------------------ // BOOTLOADER_SETTINGS //------------------------ - -//#define FUNC_ID 1 -//#define HW_VERSION 01 - -#define BOOTLOADER_VERSION 0 -#define BOARD_TYPE 0x05 // INS board -#define BOARD_REVISION 0x01 // Beta version -//#define HW_VERSION (BOARD_TYPE << 8) | BOARD_REVISION - -#define MEM_SIZE 524288 //512K -#define SIZE_OF_DESCRIPTION (uint8_t) 100 -#define START_OF_USER_CODE (uint32_t)0x08005000//REMEMBER SET ALSO IN link_stm32f10x_HD_BL.ld -#define SIZE_OF_CODE (uint32_t) (MEM_SIZE-(START_OF_USER_CODE-0x08000000)-SIZE_OF_DESCRIPTION) - -#ifdef STM32F10X_HD - #define HW_TYPE 0 //0=high_density 1=medium_density; -#elif STM32F10X_MD - #define HW_TYPE 1 //0=high_density 1=medium_density; -#endif #define BOARD_READABLE TRUE -#define BOARD_WRITABLA TRUE +#define BOARD_WRITABLE TRUE #define MAX_DEL_RETRYS 3 //------------------------ @@ -176,11 +157,6 @@ extern uint32_t pios_com_aux_id; //------------------------- #define PIOS_MASTER_CLOCK 72000000 #define PIOS_PERIPHERAL_CLOCK (PIOS_MASTER_CLOCK / 2) -#if defined(USE_BOOTLOADER) -#define PIOS_NVIC_VECTTAB_FLASH (START_OF_USER_CODE) -#else -#define PIOS_NVIC_VECTTAB_FLASH ((uint32_t)0x08000000) -#endif //------------------------- // Interrupt Priorities diff --git a/flight/PiOS/Boards/STM3210E_OP.h b/flight/PiOS/Boards/STM3210E_OP.h index 48653179c..c042184ea 100644 --- a/flight/PiOS/Boards/STM3210E_OP.h +++ b/flight/PiOS/Boards/STM3210E_OP.h @@ -68,27 +68,8 @@ TIM8 | Servo 5 | Servo 6 | Servo 7 | Servo 8 //------------------------ // BOOTLOADER_SETTINGS //------------------------ - -//#define FUNC_ID 1 -//#define HW_VERSION 01 - -#define BOOTLOADER_VERSION 0 -#define BOARD_TYPE 0x01 // OpenPilot board -#define BOARD_REVISION 0x01 // Beta version -//#define HW_VERSION (BOARD_TYPE << 8) | BOARD_REVISION - -#define MEM_SIZE 524288 //512K -#define SIZE_OF_DESCRIPTION (uint8_t) 100 -#define START_OF_USER_CODE (uint32_t)0x08005000//REMEMBER SET ALSO IN link_stm32f10x_HD_BL.ld -#define SIZE_OF_CODE (uint32_t) (MEM_SIZE-(START_OF_USER_CODE-0x08000000)-SIZE_OF_DESCRIPTION) - -#ifdef STM32F10X_HD - #define HW_TYPE 0 //0=high_density 1=medium_density; -#elif STM32F10X_MD - #define HW_TYPE 1 //0=high_density 1=medium_density; -#endif #define BOARD_READABLE TRUE -#define BOARD_WRITABLA TRUE +#define BOARD_WRITABLE TRUE #define MAX_DEL_RETRYS 3 //------------------------ @@ -203,11 +184,6 @@ extern uint32_t pios_com_spektrum_id; //------------------------- #define PIOS_MASTER_CLOCK 72000000 #define PIOS_PERIPHERAL_CLOCK (PIOS_MASTER_CLOCK / 2) -#if defined(USE_BOOTLOADER) -#define PIOS_NVIC_VECTTAB_FLASH (START_OF_USER_CODE) -#else -#define PIOS_NVIC_VECTTAB_FLASH ((uint32_t)0x08000000) -#endif //------------------------- // Interrupt Priorities diff --git a/flight/PiOS/Common/pios_bl_helper.c b/flight/PiOS/Common/pios_bl_helper.c index 545a008c6..967c3c7e6 100644 --- a/flight/PiOS/Common/pios_bl_helper.c +++ b/flight/PiOS/Common/pios_bl_helper.c @@ -31,6 +31,7 @@ /* Project Includes */ #include "pios.h" #if defined(PIOS_INCLUDE_BL_HELPER) +#include #include "stm32f10x_flash.h" uint8_t *PIOS_BL_HELPER_FLASH_If_Read(uint32_t SectorAddress) @@ -47,10 +48,10 @@ uint8_t PIOS_BL_HELPER_FLASH_Ini() uint8_t PIOS_BL_HELPER_FLASH_Start() { - uint32_t pageAdress; - pageAdress = START_OF_USER_CODE; + const struct pios_board_info * bdinfo = &pios_board_info_blob; + uint32_t pageAdress = bdinfo->fw_base; uint8_t fail = FALSE; - while ((pageAdress < START_OF_USER_CODE + SIZE_OF_CODE + SIZE_OF_DESCRIPTION) + while ((pageAdress < (bdinfo->fw_base + bdinfo->fw_size + bdinfo->desc_size)) || (fail == TRUE)) { for (int retry = 0; retry < MAX_DEL_RETRYS; ++retry) { if (FLASH_ErasePage(pageAdress) == FLASH_COMPLETE) { @@ -75,17 +76,20 @@ uint8_t PIOS_BL_HELPER_FLASH_Start() uint32_t PIOS_BL_HELPER_CRC_Memory_Calc() { + const struct pios_board_info * bdinfo = &pios_board_info_blob; + PIOS_BL_HELPER_CRC_Ini(); CRC_ResetDR(); - CRC_CalcBlockCRC((uint32_t *) START_OF_USER_CODE, (SIZE_OF_CODE) >> 2); + CRC_CalcBlockCRC((uint32_t *) bdinfo->fw_base, (bdinfo->fw_size) >> 2); return CRC_GetCRC(); } void PIOS_BL_HELPER_FLASH_Read_Description(uint8_t * array, uint8_t size) { + const struct pios_board_info * bdinfo = &pios_board_info_blob; uint8_t x = 0; - if (size>SIZE_OF_DESCRIPTION) size = SIZE_OF_DESCRIPTION; - for (uint32_t i = START_OF_USER_CODE + SIZE_OF_CODE; i < START_OF_USER_CODE + SIZE_OF_CODE + size; ++i) { + if (size > bdinfo->desc_size) size = bdinfo->desc_size; + for (uint32_t i = bdinfo->fw_base + bdinfo->fw_size; i < bdinfo->fw_base + bdinfo->fw_size + size; ++i) { array[x] = *PIOS_BL_HELPER_FLASH_If_Read(i); ++x; } diff --git a/flight/PiOS/Common/pios_board_info.c b/flight/PiOS/Common/pios_board_info.c index db9e72f9e..8905a5c08 100644 --- a/flight/PiOS/Common/pios_board_info.c +++ b/flight/PiOS/Common/pios_board_info.c @@ -9,8 +9,12 @@ const struct pios_board_info __attribute__((__used__)) __attribute__((__section_ .board_rev = BOARD_REVISION, .bl_rev = BOOTLOADER_VERSION, .hw_type = HW_TYPE, - .fw_base = START_OF_USER_CODE, - .fw_size = SIZE_OF_CODE, - .desc_base = START_OF_USER_CODE + SIZE_OF_CODE, - .desc_size = SIZE_OF_DESCRIPTION, + .fw_base = FW_BANK_BASE, + .fw_size = FW_BANK_SIZE - FW_DESC_SIZE, + .desc_base = FW_BANK_BASE + FW_BANK_SIZE - FW_DESC_SIZE, + .desc_size = FW_DESC_SIZE, +#ifdef EE_BANK_BASE + .ee_base = EE_BANK_BASE, + .ee_size = EE_BANK_SIZE, +#endif }; diff --git a/flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h b/flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h index 81839c07f..caee2a839 100755 --- a/flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h +++ b/flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h @@ -138,7 +138,7 @@ extern void vPortYieldFromISR( void ); extern void vPortEnterCritical( void ); extern void vPortExitCritical( void ); -void PIOS_RTC_Start(); +void PIOS_RTC_Init(); uint32_t PIOS_RTC_Counter(); #define portDISABLE_INTERRUPTS() portSET_INTERRUPT_MASK() diff --git a/flight/PiOS/STM32F10x/link_STM32103CB_AHRS_BL_sections.ld b/flight/PiOS/STM32F10x/link_STM32103CB_AHRS_BL_sections.ld index 4f3c77d4c..d411c3e4f 100644 --- a/flight/PiOS/STM32F10x/link_STM32103CB_AHRS_BL_sections.ld +++ b/flight/PiOS/STM32F10x/link_STM32103CB_AHRS_BL_sections.ld @@ -5,6 +5,7 @@ SECTIONS { .text : { + PROVIDE (pios_isr_vector_table_base = .); KEEP(*(.isr_vector .isr_vector.*)) *(.text .text.* .gnu.linkonce.t.*) *(.glue_7t) *(.glue_7) diff --git a/flight/PiOS/STM32F10x/link_STM32103CB_AHRS_sections.ld b/flight/PiOS/STM32F10x/link_STM32103CB_AHRS_sections.ld index 82a8ae7f4..dd814f561 100644 --- a/flight/PiOS/STM32F10x/link_STM32103CB_AHRS_sections.ld +++ b/flight/PiOS/STM32F10x/link_STM32103CB_AHRS_sections.ld @@ -1,16 +1,13 @@ +PROVIDE(pios_board_info_blob = ORIGIN(BD_INFO)); + _estack = 0x20004FF0; /* Section Definitions */ SECTIONS { - .boardinfo : - { - . = ALIGN(4); - PROVIDE(pios_board_info_blob = .); - } > BD_INFO - .text : { + PROVIDE (pios_isr_vector_table_base = .); KEEP(*(.isr_vector .isr_vector.*)) *(.text .text.* .gnu.linkonce.t.*) *(.glue_7t) *(.glue_7) diff --git a/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_BL_sections.ld b/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_BL_sections.ld index 13cd35df6..c16bd7af9 100644 --- a/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_BL_sections.ld +++ b/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_BL_sections.ld @@ -10,6 +10,7 @@ SECTIONS { .text : { + PROVIDE (pios_isr_vector_table_base = .); KEEP(*(.isr_vector .isr_vector.*)) *(.text .text.* .gnu.linkonce.t.*) *(.glue_7t) *(.glue_7) diff --git a/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_sections.ld b/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_sections.ld index 6e46c43c5..e1cb0bd0f 100644 --- a/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_sections.ld +++ b/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_sections.ld @@ -3,19 +3,16 @@ PROVIDE ( vPortSVCHandler = 0 ) ; PROVIDE ( xPortPendSVHandler = 0 ) ; PROVIDE ( xPortSysTickHandler = 0 ) ; +PROVIDE(pios_board_info_blob = ORIGIN(BD_INFO)); + _estack = 0x20004FF0; /* Section Definitions */ SECTIONS { - .boardinfo : - { - . = ALIGN(4); - PROVIDE(pios_board_info_blob = .); - } > BD_INFO - .text : { + PROVIDE (pios_isr_vector_table_base = .); KEEP(*(.isr_vector .isr_vector.*)) *(.text .text.* .gnu.linkonce.t.*) *(.glue_7t) *(.glue_7) diff --git a/flight/PiOS/STM32F10x/link_STM32103CB_PIPXTREME_BL_sections.ld b/flight/PiOS/STM32F10x/link_STM32103CB_PIPXTREME_BL_sections.ld index 4b35cd71b..69eaadb8c 100644 --- a/flight/PiOS/STM32F10x/link_STM32103CB_PIPXTREME_BL_sections.ld +++ b/flight/PiOS/STM32F10x/link_STM32103CB_PIPXTREME_BL_sections.ld @@ -10,6 +10,7 @@ SECTIONS { .text : { + PROVIDE (pios_isr_vector_table_base = .); KEEP(*(.isr_vector .isr_vector.*)) *(.text .text.* .gnu.linkonce.t.*) *(.glue_7t) *(.glue_7) diff --git a/flight/PiOS/STM32F10x/link_STM32103CB_PIPXTREME_memory.ld b/flight/PiOS/STM32F10x/link_STM32103CB_PIPXTREME_memory.ld index fd36c31ba..04aa69ccb 100644 --- a/flight/PiOS/STM32F10x/link_STM32103CB_PIPXTREME_memory.ld +++ b/flight/PiOS/STM32F10x/link_STM32103CB_PIPXTREME_memory.ld @@ -2,6 +2,7 @@ MEMORY { BL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 0x03000 - 0x00080 BD_INFO (r) : ORIGIN = 0x08003000 - 0x80, LENGTH = 0x00080 - FLASH (rx) : ORIGIN = 0x08003000, LENGTH = 0x20000 - 0x03000 + FLASH (rx) : ORIGIN = 0x08003000, LENGTH = 0x20000 - 0x03000 - 0x00400 + EE_FLASH (rw) : ORIGIN = 0x0801FC00, LENGTH = 0x00400 SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x05000 } diff --git a/flight/PiOS/STM32F10x/link_STM32103CB_PIPXTREME_sections.ld b/flight/PiOS/STM32F10x/link_STM32103CB_PIPXTREME_sections.ld index dc09e6f1c..badf5f986 100644 --- a/flight/PiOS/STM32F10x/link_STM32103CB_PIPXTREME_sections.ld +++ b/flight/PiOS/STM32F10x/link_STM32103CB_PIPXTREME_sections.ld @@ -3,19 +3,16 @@ PROVIDE ( vPortSVCHandler = 0 ) ; PROVIDE ( xPortPendSVHandler = 0 ) ; PROVIDE ( xPortSysTickHandler = 0 ) ; +PROVIDE(pios_board_info_blob = ORIGIN(BD_INFO)); + _estack = 0x20004FF0; /* Section Definitions */ SECTIONS { - .boardinfo : - { - . = ALIGN(4); - PROVIDE(pios_board_info_blob = .); - } > BD_INFO - .text : { + PROVIDE (pios_isr_vector_table_base = .); KEEP(*(.isr_vector .isr_vector.*)) *(.text .text.* .gnu.linkonce.t.*) *(.glue_7t) *(.glue_7) diff --git a/flight/PiOS/STM32F10x/link_STM3210E_INS_HD_BL.ld b/flight/PiOS/STM32F10x/link_STM3210E_INS_BL_sections.ld similarity index 92% rename from flight/PiOS/STM32F10x/link_STM3210E_INS_HD_BL.ld rename to flight/PiOS/STM32F10x/link_STM3210E_INS_BL_sections.ld index ab897621c..1b3c11e34 100644 --- a/flight/PiOS/STM32F10x/link_STM3210E_INS_HD_BL.ld +++ b/flight/PiOS/STM32F10x/link_STM3210E_INS_BL_sections.ld @@ -1,9 +1,9 @@ /** ****************************************************************************** * - * @file link_STM3210E_INS_HD_BL.ld + * @file link_STM3210E_INS_HD_NB.ld * @author David "Buzz" Carlson (buzz@chebuzz.com) - * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011. + * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011. * @brief PiOS linker for the OpenPilot INS board * @see The GNU Public License (GPL) Version 3 * @@ -24,26 +24,11 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* Memory Spaces Definitions */ -MEMORY -{ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08005000, LENGTH = 492K - FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0 - EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0 - EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0 - EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0 - EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0 -} - -_estack = 0x20004FF0; - /* This is the size of the stack for early init and for all FreeRTOS IRQs */ _irq_stack_size = 0x400; /* Check valid alignment for VTOR */ -ASSERT(ORIGIN(FLASH) == ALIGN(ORIGIN(FLASH), 0x80), "Start of memory region flash not aligned for startup vector table"); +ASSERT(ORIGIN(BL_FLASH) == ALIGN(ORIGIN(BL_FLASH), 0x80), "Start of memory region flash not aligned for startup vector table"); /* this sends all unreferenced IRQHandlers to reset @@ -208,9 +193,10 @@ SECTIONS /* for Cortex devices, the beginning of the startup code is stored in the .isr_vector section, which goes to FLASH */ .isr_vector : { + PROVIDE (pios_isr_vector_table_base = .); KEEP(*(.isr_vector)) /* Startup code */ . = ALIGN(4); - } >FLASH + } > BL_FLASH /* for some STRx devices, the beginning of the startup code is stored in the .flashtext section, which goes to FLASH */ .flashtext : @@ -218,7 +204,7 @@ SECTIONS . = ALIGN(4); *(.flashtext) /* Startup code */ . = ALIGN(4); - } >FLASH + } > BL_FLASH /* init sections */ @@ -229,7 +215,7 @@ SECTIONS KEEP(*(.initcalluavobj.init)) . = ALIGN(4); __uavobj_initcall_end = .; - } >FLASH + } > BL_FLASH /* the program code is stored in the .text section, which goes to Flash */ .text : @@ -247,7 +233,7 @@ SECTIONS _etext = .; /* This is used by the startup in order to initialize the .data secion */ _sidata = _etext; - } >FLASH + } > BL_FLASH /* @@ -354,6 +340,13 @@ SECTIONS __exidx_start = .; __exidx_end = .; + .boardinfo : + { + . = ALIGN(4); + KEEP(*(.boardinfo)) + . = ALIGN(4); + } > BD_INFO + /* after that it's only debugging information. */ /* remove the debugging information from the standard libraries */ diff --git a/flight/PiOS/STM32F10x/link_STM3210E_INS_memory.ld b/flight/PiOS/STM32F10x/link_STM3210E_INS_memory.ld new file mode 100644 index 000000000..7ecb0f65d --- /dev/null +++ b/flight/PiOS/STM32F10x/link_STM3210E_INS_memory.ld @@ -0,0 +1,13 @@ +/* Memory Spaces Definitions */ +MEMORY +{ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x10000 + BL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 0x05000 - 0x00080 + BD_INFO (r) : ORIGIN = 0x08005000 - 0x80, LENGTH = 0x00080 + FLASH (rx) : ORIGIN = 0x08005000, LENGTH = 0x80000 - 0x05000 + FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0 + EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0 + EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0 + EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0 + EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0 +} diff --git a/flight/PiOS/STM32F10x/link_STM3210E_INS_HD_NB.ld b/flight/PiOS/STM32F10x/link_STM3210E_INS_sections.ld similarity index 93% rename from flight/PiOS/STM32F10x/link_STM3210E_INS_HD_NB.ld rename to flight/PiOS/STM32F10x/link_STM3210E_INS_sections.ld index 99a82b1e4..31e35b305 100644 --- a/flight/PiOS/STM32F10x/link_STM3210E_INS_HD_NB.ld +++ b/flight/PiOS/STM32F10x/link_STM3210E_INS_sections.ld @@ -24,21 +24,6 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* Memory Spaces Definitions */ -MEMORY -{ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K - FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0 - EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0 - EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0 - EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0 - EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0 -} - -_estack = 0x20004FF0; - /* This is the size of the stack for early init and for all FreeRTOS IRQs */ _irq_stack_size = 0x400; @@ -62,10 +47,10 @@ PROVIDE ( HardFault_Handler = 0 ) ; PROVIDE ( MemManage_Handler = 0 ) ; PROVIDE ( BusFault_Handler = 0 ) ; PROVIDE ( UsageFault_Handler = 0 ) ; -PROVIDE ( SVC_Handler = 0 ) ; +PROVIDE ( vPortSVCHandler = 0 ) ; PROVIDE ( DebugMon_Handler = 0 ) ; -PROVIDE ( PendSV_Handler = 0 ) ; -PROVIDE ( SysTick_Handler = 0 ) ; +PROVIDE ( xPortPendSVHandler = 0 ) ; +PROVIDE ( xPortSysTickHandler = 0 ) ; PROVIDE ( WWDG_IRQHandler = 0 ) ; PROVIDE ( PVD_IRQHandler = 0 ) ; @@ -199,18 +184,19 @@ PROVIDE ( SysTick = (SCS_BASE + 0x0010) ) ; PROVIDE ( NVIC = (SCS_BASE + 0x0100) ) ; PROVIDE ( SCB = (SCS_BASE + 0x0D00) ) ; +PROVIDE(pios_board_info_blob = ORIGIN(BD_INFO)); /* Sections Definitions */ SECTIONS { - /* for Cortex devices, the beginning of the startup code is stored in the .isr_vector section, which goes to FLASH */ .isr_vector : { + PROVIDE (pios_isr_vector_table_base = .); KEEP(*(.isr_vector)) /* Startup code */ . = ALIGN(4); - } >FLASH + } > FLASH /* for some STRx devices, the beginning of the startup code is stored in the .flashtext section, which goes to FLASH */ .flashtext : @@ -218,7 +204,7 @@ SECTIONS . = ALIGN(4); *(.flashtext) /* Startup code */ . = ALIGN(4); - } >FLASH + } > FLASH /* init sections */ @@ -229,7 +215,7 @@ SECTIONS KEEP(*(.initcalluavobj.init)) . = ALIGN(4); __uavobj_initcall_end = .; - } >FLASH + } > FLASH /* the program code is stored in the .text section, which goes to Flash */ .text : @@ -247,7 +233,7 @@ SECTIONS _etext = .; /* This is used by the startup in order to initialize the .data secion */ _sidata = _etext; - } >FLASH + } > FLASH /* diff --git a/flight/PiOS/STM32F10x/link_STM3210E_OP_BL_sections.ld b/flight/PiOS/STM32F10x/link_STM3210E_OP_BL_sections.ld index 3add614d6..fa01b6c41 100644 --- a/flight/PiOS/STM32F10x/link_STM3210E_OP_BL_sections.ld +++ b/flight/PiOS/STM32F10x/link_STM3210E_OP_BL_sections.ld @@ -2,7 +2,7 @@ _irq_stack_size = 0x400; /* Check valid alignment for VTOR */ -ASSERT(ORIGIN(FLASH) == ALIGN(ORIGIN(FLASH), 0x80), "Start of memory region flash not aligned for startup vector table"); +ASSERT(ORIGIN(BL_FLASH) == ALIGN(ORIGIN(BL_FLASH), 0x80), "Start of memory region flash not aligned for startup vector table"); /* this sends all unreferenced IRQHandlers to reset @@ -166,6 +166,7 @@ SECTIONS /* for Cortex devices, the beginning of the startup code is stored in the .isr_vector section, which goes to FLASH */ .isr_vector : { + PROVIDE (pios_isr_vector_table_base = .); KEEP(*(.isr_vector)) /* Startup code */ . = ALIGN(4); } > BL_FLASH diff --git a/flight/PiOS/STM32F10x/link_STM3210E_OP_sections.ld b/flight/PiOS/STM32F10x/link_STM3210E_OP_sections.ld index 2292a40e2..94aafbd78 100644 --- a/flight/PiOS/STM32F10x/link_STM3210E_OP_sections.ld +++ b/flight/PiOS/STM32F10x/link_STM3210E_OP_sections.ld @@ -158,20 +158,16 @@ PROVIDE ( SysTick = (SCS_BASE + 0x0010) ) ; PROVIDE ( NVIC = (SCS_BASE + 0x0100) ) ; PROVIDE ( SCB = (SCS_BASE + 0x0D00) ) ; +PROVIDE(pios_board_info_blob = ORIGIN(BD_INFO)); /* Sections Definitions */ SECTIONS { - .boardinfo : - { - . = ALIGN(4); - PROVIDE(pios_board_info_blob = .); - } > BD_INFO - /* for Cortex devices, the beginning of the startup code is stored in the .isr_vector section, which goes to FLASH */ .isr_vector : { + PROVIDE (pios_isr_vector_table_base = .); KEEP(*(.isr_vector)) /* Startup code */ . = ALIGN(4); } >FLASH diff --git a/flight/PiOS/STM32F10x/pios_delay.c b/flight/PiOS/STM32F10x/pios_delay.c index 933fb8e7e..56c556555 100644 --- a/flight/PiOS/STM32F10x/pios_delay.c +++ b/flight/PiOS/STM32F10x/pios_delay.c @@ -104,6 +104,28 @@ int32_t PIOS_DELAY_WaitmS(uint16_t mS) return 0; } +/** + * @brief Query the Delay timer for the current uS + * @return A microsecond value + */ +uint16_t PIOS_DELAY_GetuS() +{ + return PIOS_DELAY_TIMER->CNT; +} + +/** + * @brief Compute the difference between now and a reference time + * @param[in] the reference time to compare now to + * @return The number of uS since the delay + * + * @note the user is responsible for worrying about rollover on the 16 bit uS counter + */ +int32_t PIOS_DELAY_DiffuS(uint16_t ref) +{ + int32_t ret_t = ref; + return (int16_t) (PIOS_DELAY_GetuS() - ret_t); +} + #endif /** diff --git a/flight/PiOS/STM32F10x/pios_rtc.c b/flight/PiOS/STM32F10x/pios_rtc.c index 0a950e913..98d3160c1 100644 --- a/flight/PiOS/STM32F10x/pios_rtc.c +++ b/flight/PiOS/STM32F10x/pios_rtc.c @@ -33,7 +33,11 @@ #if defined(PIOS_INCLUDE_RTC) -void PIOS_RTC_Start() +#ifndef PIOS_RTC_PRESCALAR +#define PIOS_RTC_PRESCALAR 100 +#endif + +void PIOS_RTC_Init() { RCC_APB1PeriphClockCmd(RCC_APB1Periph_BKP | RCC_APB1Periph_PWR, ENABLE); @@ -44,7 +48,14 @@ void PIOS_RTC_Start() RTC_WaitForLastTask(); RTC_WaitForSynchro(); RTC_WaitForLastTask(); - RTC_SetPrescaler(0); // counting at 8e6 / 128 + +#if defined(PIOS_INCLUDE_SPEKTRUM) + /* Enable the RTC Second interrupt */ + RTC_ITConfig( RTC_IT_SEC, ENABLE ); + /* Wait until last write operation on RTC registers has finished */ + RTC_WaitForLastTask(); +#endif + RTC_SetPrescaler(PIOS_RTC_PRESCALAR); // counting at 8e6 / 128 RTC_WaitForLastTask(); RTC_SetCounter(0); RTC_WaitForLastTask(); @@ -55,6 +66,15 @@ uint32_t PIOS_RTC_Counter() return RTC_GetCounter(); } +float PIOS_RTC_Rate() +{ + return (float) (8e6 / 128) / (1 + PIOS_RTC_PRESCALAR); +} + +float PIOS_RTC_MsPerTick() +{ + return 1000.0f / PIOS_RTC_Rate(); +} #endif diff --git a/flight/PiOS/STM32F10x/pios_spektrum.c b/flight/PiOS/STM32F10x/pios_spektrum.c index 16b9b9883..0eabe36a2 100644 --- a/flight/PiOS/STM32F10x/pios_spektrum.c +++ b/flight/PiOS/STM32F10x/pios_spektrum.c @@ -41,16 +41,24 @@ #error "AUX com cannot be used with SPEKTRUM" #endif +/** + * @Note Framesyncing: + * The code resets the watchdog timer whenever a single byte is received, so what watchdog code + * is never called if regularly getting bytes. + * RTC timer is running @625Hz, supervisor timer has divider 5 so frame sync comes every 1/125Hz=8ms. + * Good for both 11ms and 22ms framecycles + */ + /* Global Variables */ -/* Local Variables, use pios_usart */ +/* Local Variables */ static uint16_t CaptureValue[12],CaptureValueTemp[12]; static uint8_t prev_byte = 0xFF, sync = 0, bytecount = 0, datalength=0, frame_error=0, byte_array[20] = { 0 }; - uint8_t sync_of = 0; +uint16_t supv_timer=0; /** -* Initialise the onboard USARTs +* Bind and Initialise Spektrum satellite receiver */ void PIOS_SPEKTRUM_Init(void) { @@ -59,62 +67,15 @@ void PIOS_SPEKTRUM_Init(void) PIOS_SPEKTRUM_Bind(); } - NVIC_InitTypeDef NVIC_InitStructure = pios_spektrum_cfg.irq.init; - TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure = pios_spektrum_cfg.tim_base_init; - - - /* Enable appropriate clock to timer module */ - switch((int32_t) pios_spektrum_cfg.timer) { - case (int32_t)TIM1: - NVIC_InitStructure.NVIC_IRQChannel = TIM1_CC_IRQn; - RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); - break; - case (int32_t)TIM2: - NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQn; - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE); - break; - case (int32_t)TIM3: - NVIC_InitStructure.NVIC_IRQChannel = TIM3_IRQn; - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE); - break; - case (int32_t)TIM4: - NVIC_InitStructure.NVIC_IRQChannel = TIM4_IRQn; - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4, ENABLE); - break; -#ifdef STM32F10X_HD - - case (int32_t)TIM5: - NVIC_InitStructure.NVIC_IRQChannel = TIM5_IRQn; - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM5, ENABLE); - break; - case (int32_t)TIM6: - NVIC_InitStructure.NVIC_IRQChannel = TIM6_IRQn; - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM6, ENABLE); - break; - case (int32_t)TIM7: - NVIC_InitStructure.NVIC_IRQChannel = TIM7_IRQn; - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM7, ENABLE); - break; - case (int32_t)TIM8: - NVIC_InitStructure.NVIC_IRQChannel = TIM8_CC_IRQn; - RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM8, ENABLE); - break; -#endif - } + /* Init RTC supervisor timer interrupt */ + NVIC_InitTypeDef NVIC_InitStructure; + NVIC_InitStructure.NVIC_IRQChannel = RTC_IRQn; + NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID; + NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; + NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); - - /* Configure timer clocks */ - TIM_InternalClockConfig(pios_spektrum_cfg.timer); - TIM_TimeBaseInit(pios_spektrum_cfg.timer, &TIM_TimeBaseStructure); - - /* Enable the Capture Compare Interrupt Request */ - TIM_ITConfig(pios_spektrum_cfg.timer, pios_spektrum_cfg.ccr, ENABLE); - - /* Clear update pending flag */ - TIM_ClearFlag(pios_spektrum_cfg.timer, TIM_FLAG_Update); - - /* Enable timers */ - TIM_Cmd(pios_spektrum_cfg.timer, ENABLE); + /* Init RTC clock */ + PIOS_RTC_Init(); } /** @@ -263,8 +224,7 @@ int32_t PIOS_SPEKTRUM_Decode(uint8_t b) } /* Interrupt handler for USART */ -void SPEKTRUM_IRQHandler(uint32_t usart_id) -{ +void SPEKTRUM_IRQHandler(uint32_t usart_id) { /* by always reading DR after SR make sure to clear any error interrupts */ volatile uint16_t sr = pios_spektrum_cfg.pios_usart_spektrum_cfg->regs->SR; volatile uint8_t b = pios_spektrum_cfg.pios_usart_spektrum_cfg->regs->DR; @@ -280,33 +240,34 @@ void SPEKTRUM_IRQHandler(uint32_t usart_id) /* Disable TXE interrupt (TXEIE=0) */ USART_ITConfig(pios_spektrum_cfg.pios_usart_spektrum_cfg->regs, USART_IT_TXE, DISABLE); } - /* clear "watchdog" timer */ - TIM_SetCounter(pios_spektrum_cfg.timer, 0); + /* byte arrived so clear "watchdog" timer */ + supv_timer=0; } /** -* This function handles TIM6 global interrupt request. -*/ + *@brief This function is called between frames and when a spektrum word hasnt been decoded for too long + *@brief clears the channel values + */ void PIOS_SPEKTRUM_irq_handler() { -//PIOS_SPEKTRUM_SUPV_IRQ_FUNC { - /* Clear timer interrupt pending bit */ - TIM_ClearITPendingBit(pios_spektrum_cfg.timer, TIM_IT_Update); - - /* sync between frames */ - sync = 0; - bytecount = 0; - prev_byte = 0xFF; - frame_error=0; - sync_of++; - /* watchdog activated */ - if (sync_of > 12) { - /* signal lost */ - sync_of = 0; - for (int i = 0; i < 12; i++) - { - CaptureValue[i] = 0; - CaptureValueTemp[i] = 0; + /* 125hz */ + supv_timer++; + if(supv_timer > 5) { + /* sync between frames */ + sync = 0; + bytecount = 0; + prev_byte = 0xFF; + frame_error = 0; + sync_of++; + /* watchdog activated after 100ms silence */ + if (sync_of > 12) { + /* signal lost */ + sync_of = 0; + for (int i = 0; i < 12; i++) { + CaptureValue[i] = 0; + CaptureValueTemp[i] = 0; + } } + supv_timer = 0; } } diff --git a/flight/PiOS/STM32F10x/pios_sys.c b/flight/PiOS/STM32F10x/pios_sys.c index 2170c7811..26e748171 100644 --- a/flight/PiOS/STM32F10x/pios_sys.c +++ b/flight/PiOS/STM32F10x/pios_sys.c @@ -186,7 +186,8 @@ int32_t PIOS_SYS_SerialNumberGet(char *str) void NVIC_Configuration(void) { /* Set the Vector Table base address as specified in .ld file */ - NVIC_SetVectorTable(PIOS_NVIC_VECTTAB_FLASH, 0x0); + extern void pios_isr_vector_table_base; + NVIC_SetVectorTable((uint32_t)&pios_isr_vector_table_base, 0x0); /* 4 bits for Interrupt priorities so no sub priorities */ NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4); diff --git a/flight/PiOS/inc/pios_board_info.h b/flight/PiOS/inc/pios_board_info.h index 579a3ec2b..f2ff58fb4 100644 --- a/flight/PiOS/inc/pios_board_info.h +++ b/flight/PiOS/inc/pios_board_info.h @@ -10,6 +10,8 @@ struct pios_board_info { uint32_t fw_size; uint32_t desc_base; uint32_t desc_size; + uint32_t ee_base; + uint32_t ee_size; } __attribute__((packed)); extern const struct pios_board_info pios_board_info_blob; diff --git a/flight/PiOS/inc/pios_delay.h b/flight/PiOS/inc/pios_delay.h index 51a8755a2..647e9f553 100644 --- a/flight/PiOS/inc/pios_delay.h +++ b/flight/PiOS/inc/pios_delay.h @@ -36,6 +36,8 @@ extern int32_t PIOS_DELAY_Init(void); extern int32_t PIOS_DELAY_WaituS(uint16_t uS); extern int32_t PIOS_DELAY_WaitmS(uint16_t mS); +extern uint16_t PIOS_DELAY_GetuS(); +extern int32_t PIOS_DELAY_DiffuS(uint16_t ref); #endif /* PIOS_DELAY_H */ diff --git a/flight/PiOS/inc/pios_rtc.h b/flight/PiOS/inc/pios_rtc.h index c9ad5661f..f68b54af8 100644 --- a/flight/PiOS/inc/pios_rtc.h +++ b/flight/PiOS/inc/pios_rtc.h @@ -27,12 +27,14 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef PIOS_SERVO_H -#define PIOS_SERVO_H +#ifndef PIOS_RTC_H +#define PIOS_RTC_H /* Public Functions */ -extern void PIOS_RTC_Start(); +extern void PIOS_RTC_Init(); extern uint32_t PIOS_RTC_Counter(); +extern float PIOS_RTC_Rate(); +extern float PIOS_RTC_MsPerTick(); #endif /* PIOS_SERVO_H */ diff --git a/flight/PiOS/inc/pios_spektrum_priv.h b/flight/PiOS/inc/pios_spektrum_priv.h index 19a1db20b..b5dd384d1 100644 --- a/flight/PiOS/inc/pios_spektrum_priv.h +++ b/flight/PiOS/inc/pios_spektrum_priv.h @@ -37,13 +37,10 @@ struct pios_spektrum_cfg { const struct pios_usart_cfg * pios_usart_spektrum_cfg; - TIM_TimeBaseInitTypeDef tim_base_init; GPIO_InitTypeDef gpio_init; uint32_t remap; /* GPIO_Remap_* */ struct stm32_irq irq; - TIM_TypeDef * timer; GPIO_TypeDef * port; - uint16_t ccr; uint16_t pin; }; diff --git a/flight/PiOS/pios.h b/flight/PiOS/pios.h index 0fdb03570..8362a3af4 100644 --- a/flight/PiOS/pios.h +++ b/flight/PiOS/pios.h @@ -73,6 +73,7 @@ #include #include #include +#include #include #include #include diff --git a/flight/PipXtreme/Makefile b/flight/PipXtreme/Makefile index 3955d1929..9a70ac417 100644 --- a/flight/PipXtreme/Makefile +++ b/flight/PipXtreme/Makefile @@ -25,6 +25,13 @@ WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST))) TOP := $(realpath $(WHEREAMI)/../../) include $(TOP)/make/firmware-defs.mk +include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk + +# Target file name (without extension). +TARGET := fw_$(BOARD_NAME) + +# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) +OUTDIR := $(TOP)/build/$(TARGET) # Debugging (YES/NO) ? DEBUG ?= NO @@ -43,23 +50,6 @@ FLASH_TOOL = OPENOCD # Include the USB files (YES/NO) ? USE_USB = YES -# MCU name, submodel and board -# - MCU used for compiler-option (-mcpu) -# - MODEL used for linker-script name (-T) and passed as define -# - BOARD just passed as define (optional) -MCU = cortex-m3 -CHIP = STM32F103CBT -BOARD = STM32103CB_PIPXTREME -#CHIP = STM32F103C8T -#BOARD = STM32103C8_PIPXTREME -MODEL = MD - -# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.) -OUTDIR = $(TOP)/build/pipxtreme - -# Target file name (without extension). -TARGET = PipXtreme - # Paths HOME_DIR = ./ HOME_DIR_INC = $(HOME_DIR)/inc @@ -192,7 +182,7 @@ CPPSRCARM = # Even though the DOS/Win* filesystem matches both .s and .S the same, # it will preserve the spelling of the filenames, and gcc itself does # care about how the name is spelled on its command-line. -ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL).S +ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S # List Assembler source files here which must be assembled in ARM-Mode.. ASRCARM = @@ -257,7 +247,6 @@ DEBUGF = dwarf-2 CDEFS = -DSTM32F10X_$(MODEL) CDEFS += -DUSE_STDPERIPH_DRIVER CDEFS += -DUSE_$(BOARD) -CDEFS += -DUSE_BOOTLOADER # Place project-specific -D and/or -U options for # Assembler with preprocessor here. @@ -340,20 +329,8 @@ LDFLAGS += -lc -lgcc LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld -OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin -# Program -OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08003000 bin" -# Verify -OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08003000 bin" -# reset target -OOCD_CL+=-c "reset run" -# terminate OOCD after programming -OOCD_CL+=-c shutdown - # Define programs and commands. REMOVE = $(REMOVE_CMD) -f -###SHELL = sh -###COPY = cp # List of all source files. ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC) @@ -385,14 +362,6 @@ endif endif endif -# Program the device. -ifeq ($(FLASH_TOOL),OPENOCD) -# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script". -program: $(OUTDIR)/$(TARGET).bin - @echo ${quote}Programming with OPENOCD${quote} - $(OOCD_EXE) $(OOCD_CL) -endif - # Link: create ELF output file from object files. $(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ))) @@ -422,29 +391,33 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM)) $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin -.PHONY: elf lss sym hex bin bino +$(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION))) + +# Add jtag targets (program and wipe) +$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE))) + +.PHONY: elf lss sym hex bin bino opfw elf: $(OUTDIR)/$(TARGET).elf lss: $(OUTDIR)/$(TARGET).lss sym: $(OUTDIR)/$(TARGET).sym hex: $(OUTDIR)/$(TARGET).hex bin: $(OUTDIR)/$(TARGET).bin bino: $(OUTDIR)/$(TARGET).bin.o +opfw: $(OUTDIR)/$(TARGET).opfw # Display sizes of sections. $(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf)) -.PHONY: size -size: $(OUTDIR)/$(TARGET).elf_size # Generate Doxygen documents docs: doxygen $(DOXYGENDIR)/doxygen.cfg # Install: install binary file with prefix/suffix into install directory -install: $(OUTDIR)/$(TARGET).bin +install: $(OUTDIR)/$(TARGET).opfw ifneq ($(INSTALL_DIR),) @echo $(MSG_INSTALLING) $(call toprel, $<) $(V1) mkdir -p $(INSTALL_DIR) - $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin + $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opfw else $(error INSTALL_DIR must be specified for $@) endif @@ -486,4 +459,4 @@ else endif # Listing of phony targets. -.PHONY : all build clean clean_list program install +.PHONY : all build clean clean_list install diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index c50ad9330..a963e4673 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -52,11 +52,21 @@ equals(copydata, 1) { data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_PLUGINS]/sqldrivers/$$dll\") $$targetPath(\"$$GCS_APP_PATH/sqldrivers/$$dll\") $$addNewline() } - # copy SDL (if available) - Simple DirectMedia Layer (www.libsdl.org) + # copy SDL - Simple DirectMedia Layer (www.libsdl.org) + # Check the wiki for SDL installation, it should be copied first + # (make sure that the Qt installation path below is correct) + # + # - For qt-sdk-win-opensource-2010.05.exe: + # xcopy /s /e \bin\SDL.dll C:\Qt\2010.05\mingw\bin\SDL.dll + # xcopy /s /e \include\SDL\* C:\Qt\2010.05\mingw\include\SDL + # xcopy /s /e \lib\* C:\Qt\2010.05\mingw\lib + # + # - For Qt_SDK_Win_offline_v1_1_1_en.exe: + # xcopy /s /e \bin\SDL.dll C:\QtSDK\Desktop\Qt\4.7.3\mingw\bin\SDL.dll + # xcopy /s /e \include\SDL\* C:\QtSDK\Desktop\Qt\4.7.3\mingw\include\SDL + # xcopy /s /e \lib\* C:\QtSDK\Desktop\Qt\4.7.3\mingw\lib SDL_DLL = SDL.dll - exists($$targetPath(\"$$[QT_INSTALL_BINS]/../../mingw/bin/$$SDL_DLL\")) { - data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_BINS]/../../mingw/bin/$$SDL_DLL\") $$targetPath(\"$$GCS_APP_PATH/$$SDL_DLL\") $$addNewline() - } + data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_BINS]/../../mingw/bin/$$SDL_DLL\") $$targetPath(\"$$GCS_APP_PATH/$$SDL_DLL\") $$addNewline() data_copy.target = FORCE QMAKE_EXTRA_TARGETS += data_copy diff --git a/ground/openpilotgcs/src/app/app.pro b/ground/openpilotgcs/src/app/app.pro index 4170c0c13..4b1534ad9 100644 --- a/ground/openpilotgcs/src/app/app.pro +++ b/ground/openpilotgcs/src/app/app.pro @@ -4,10 +4,12 @@ include(../shared/qtsingleapplication/qtsingleapplication.pri) TEMPLATE = app TARGET = $$GCS_APP_TARGET DESTDIR = $$GCS_APP_PATH +QT += xml SOURCES += main.cpp include(../rpath.pri) +include(../libs/utils/utils.pri) win32 { CONFIG(debug, debug|release):LIBS *= -lExtensionSystemd -lAggregationd -lQExtSerialPortd diff --git a/ground/openpilotgcs/src/app/main.cpp b/ground/openpilotgcs/src/app/main.cpp index 55f7d5312..29111836c 100644 --- a/ground/openpilotgcs/src/app/main.cpp +++ b/ground/openpilotgcs/src/app/main.cpp @@ -27,6 +27,7 @@ */ #include "qtsingleapplication.h" +#include "utils/xmlconfig.h" #include #include @@ -243,10 +244,10 @@ int main(int argc, char **argv) QString locale = QLocale::system().name(); // Must be done before any QSettings class is created - QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope, + QSettings::setPath(XmlConfig::XmlSettingsFormat, QSettings::SystemScope, QCoreApplication::applicationDirPath()+QLatin1String(SHARE_PATH)); // keep this in sync with the MainWindow ctor in coreplugin/mainwindow.cpp - QSettings settings(QSettings::IniFormat, QSettings::UserScope, + QSettings settings(XmlConfig::XmlSettingsFormat, QSettings::UserScope, QLatin1String("OpenPilot"), QLatin1String("OpenPilotGCS")); overrideSettings(settings, argc, argv); diff --git a/ground/openpilotgcs/src/libs/utils/pathutils.cpp b/ground/openpilotgcs/src/libs/utils/pathutils.cpp index 9b42dfdf5..0ecdd3c85 100644 --- a/ground/openpilotgcs/src/libs/utils/pathutils.cpp +++ b/ground/openpilotgcs/src/libs/utils/pathutils.cpp @@ -26,6 +26,7 @@ */ #include "pathutils.h" +#include "xmlconfig.h" #include #include @@ -97,7 +98,7 @@ QString PathUtils::GetStoragePath() { // This routine works with "/" as the standard: // Work out where the settings are stored on the machine - QSettings set(QSettings::IniFormat, QSettings::UserScope,QLatin1String("OpenPilot"), QLatin1String("OpenPilotGCS")); + QSettings set(XmlConfig::XmlSettingsFormat, QSettings::UserScope,QLatin1String("OpenPilot"), QLatin1String("OpenPilotGCS")); QFileInfo f(set.fileName()); QDir dir(f.absoluteDir()); diff --git a/ground/openpilotgcs/src/libs/utils/utils.pro b/ground/openpilotgcs/src/libs/utils/utils.pro index 570b274f7..7b923a567 100644 --- a/ground/openpilotgcs/src/libs/utils/utils.pro +++ b/ground/openpilotgcs/src/libs/utils/utils.pro @@ -2,7 +2,8 @@ TEMPLATE = lib TARGET = Utils QT += gui \ - network + network \ + xml DEFINES += QTCREATOR_UTILS_LIB @@ -45,6 +46,7 @@ SOURCES += reloadpromptutils.cpp \ pathutils.cpp \ worldmagmodel.cpp \ homelocationutil.cpp +SOURCES += xmlconfig.cpp win32 { SOURCES += abstractprocess_win.cpp \ @@ -95,6 +97,7 @@ HEADERS += utils_global.h \ pathutils.h \ worldmagmodel.h \ homelocationutil.h +HEADERS += xmlconfig.h FORMS += filewizardpage.ui \ projectintropage.ui \ diff --git a/ground/openpilotgcs/src/plugins/importexport/xmlconfig.cpp b/ground/openpilotgcs/src/libs/utils/xmlconfig.cpp similarity index 93% rename from ground/openpilotgcs/src/plugins/importexport/xmlconfig.cpp rename to ground/openpilotgcs/src/libs/utils/xmlconfig.cpp index 79774d696..7b4cc9d5a 100644 --- a/ground/openpilotgcs/src/plugins/importexport/xmlconfig.cpp +++ b/ground/openpilotgcs/src/libs/utils/xmlconfig.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #define NUM_PREFIX "arr_" @@ -84,6 +85,10 @@ void XmlConfig::handleNode(QDomElement* node, QSettings::SettingsMap &map, QStri if ( nodeName.startsWith(NUM_PREFIX) ){ nodeName.replace(NUM_PREFIX, ""); } + // Xml tags are restrictive with allowed characters, + // so we urlencode and replace % with __PCT__ on file + nodeName = nodeName.replace("__PCT__", "%"); + nodeName = QUrl::fromPercentEncoding(nodeName.toAscii()); if ( nodeName == XmlConfig::rootName ) ; @@ -99,7 +104,7 @@ void XmlConfig::handleNode(QDomElement* node, QSettings::SettingsMap &map, QStri handleNode( static_cast(&child), map, path); } else if ( child.isText() ){ - qDebug() << "Key: " << path << " Value:" << node->text(); +// qDebug() << "Key: " << path << " Value:" << node->text(); map.insert(path, stringToVariant(node->text())); } else{ @@ -123,6 +128,10 @@ bool XmlConfig::writeXmlFile(QIODevice &device, const QSettings::SettingsMap &ma if ( elem == "" ){ continue; } + // Xml tags are restrictive with allowed characters, + // so we urlencode and replace % with __PCT__ on file + elem = QString(QUrl::toPercentEncoding(elem)); + elem = elem.replace("%", "__PCT__"); // For arrays, QT will use simple numbers as keys, which is not a valid element in XML. // Therefore we prefixed these. if ( elem.startsWith(NUM_PREFIX) ){ @@ -236,8 +245,9 @@ QString XmlConfig::variantToString(const QVariant &v) result = QLatin1String("@Variant("); result += QString::fromLatin1(a.toBase64().constData()); result += QLatin1Char(')'); - qDebug() << "Variant Type: " << v.type(); - qDebug()<< "Variant: " << result; + // These were being much too noisy!! + //qDebug() << "Variant Type: " << v.type(); + //qDebug()<< "Variant: " << result; #else Q_ASSERT(!"QSettings: Cannot save custom types without QDataStream support"); #endif diff --git a/ground/openpilotgcs/src/plugins/importexport/xmlconfig.h b/ground/openpilotgcs/src/libs/utils/xmlconfig.h similarity index 90% rename from ground/openpilotgcs/src/plugins/importexport/xmlconfig.h rename to ground/openpilotgcs/src/libs/utils/xmlconfig.h index 91cba38d1..447b2b6d4 100644 --- a/ground/openpilotgcs/src/plugins/importexport/xmlconfig.h +++ b/ground/openpilotgcs/src/libs/utils/xmlconfig.h @@ -26,13 +26,18 @@ #ifndef XMLCONFIG_H #define XMLCONFIG_H -#include "importexport_global.h" +#if defined(QTCREATOR_UTILS_LIB) +# define XMLCONFIG_EXPORT Q_DECL_EXPORT +#else +# define XMLCONFIG_EXPORT Q_DECL_IMPORT +#endif +#include #include #include #include -class IMPORTEXPORT_EXPORT XmlConfig : QObject +class XMLCONFIG_EXPORT XmlConfig : QObject { public: diff --git a/ground/openpilotgcs/src/plugins/config/ahrs.ui b/ground/openpilotgcs/src/plugins/config/ahrs.ui index f4cc5a453..de39ad079 100644 --- a/ground/openpilotgcs/src/plugins/config/ahrs.ui +++ b/ground/openpilotgcs/src/plugins/config/ahrs.ui @@ -7,7 +7,7 @@ 0 0 720 - 509 + 537 @@ -17,7 +17,7 @@ - 1 + 0 @@ -42,29 +42,6 @@ - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -152,29 +129,6 @@ - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -278,23 +232,6 @@ Hint: run this with engines at cruising speed. - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -368,23 +305,6 @@ Hint: run this with engines at cruising speed. - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -580,29 +500,6 @@ p, li { white-space: pre-wrap; } - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -638,29 +535,6 @@ p, li { white-space: pre-wrap; } - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -757,7 +631,7 @@ new home location unless it is in indoor mode. - + 0 @@ -766,16 +640,36 @@ new home location unless it is in indoor mode. - 20 - 20 + 32 + 32 + + + true + + - - :/configgadget/images/help2.png:/configgadget/images/help2.png + + :/core/images/helpicon.svg:/core/images/helpicon.svg + + + + 32 + 32 + + + + Ctrl+S + + + false + + + true @@ -820,7 +714,7 @@ specific calibration button on top of the screen. - + diff --git a/ground/openpilotgcs/src/plugins/config/airframe.ui b/ground/openpilotgcs/src/plugins/config/airframe.ui index 44d65930a..50403ab93 100644 --- a/ground/openpilotgcs/src/plugins/config/airframe.ui +++ b/ground/openpilotgcs/src/plugins/config/airframe.ui @@ -29,29 +29,6 @@ - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -102,7 +79,7 @@ - 0 + 1 @@ -116,23 +93,6 @@ - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -172,23 +132,6 @@ - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -451,23 +394,6 @@ - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -586,29 +512,6 @@ - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -650,29 +553,6 @@ - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -885,29 +765,6 @@ Typical value is 50% for + or X configuration on quads. - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -985,7 +842,7 @@ Typical value is 50% for + or X configuration on quads. - + 10 @@ -993,29 +850,6 @@ Typical value is 50% for + or X configuration on quads. - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -1085,46 +919,6 @@ Typical value is 50% for + or X configuration on quads. - - - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - @@ -2137,19 +1931,34 @@ p, li { white-space: pre-wrap; } - + + + + 0 + 0 + + - 20 - 20 + 32 + 32 - - :/configgadget/images/help2.png:/configgadget/images/help2.png + + :/core/images/helpicon.svg:/core/images/helpicon.svg + + + + 32 + 32 + + + + true @@ -2196,29 +2005,6 @@ p, li { white-space: pre-wrap; } - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -2530,29 +2316,6 @@ p, li { white-space: pre-wrap; } - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -2608,7 +2371,7 @@ p, li { white-space: pre-wrap; } - + diff --git a/ground/openpilotgcs/src/plugins/config/ccattitude.ui b/ground/openpilotgcs/src/plugins/config/ccattitude.ui index 58d9ad2bc..2497983f5 100644 --- a/ground/openpilotgcs/src/plugins/config/ccattitude.ui +++ b/ground/openpilotgcs/src/plugins/config/ccattitude.ui @@ -6,8 +6,8 @@ 0 0 - 331 - 324 + 455 + 428 @@ -18,29 +18,6 @@ - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -158,29 +135,6 @@ - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -284,29 +238,6 @@ - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -363,7 +294,7 @@ arming it in that case! - + 0 @@ -372,16 +303,25 @@ arming it in that case! - 20 - 20 + 32 + 32 - - :/configgadget/images/help2.png:/configgadget/images/help2.png + + :/core/images/helpicon.svg:/core/images/helpicon.svg + + + + 32 + 32 + + + + true @@ -411,23 +351,10 @@ arming it in that case! - - - - Qt::Vertical - - - - 20 - 40 - - - - - + diff --git a/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp b/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp index f4fbb345c..9d81392e4 100644 --- a/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp @@ -37,7 +37,8 @@ #include #include #include -#include +#include +#include #include "assertions.h" #include "calibration.h" @@ -228,25 +229,8 @@ ConfigAHRSWidget::ConfigAHRSWidget(QWidget *parent) : ConfigTaskWidget(parent) connect(m_ahrs->startDriftCalib, SIGNAL(clicked()),this, SLOT(launchGyroDriftCalibration())); connect(parent, SIGNAL(autopilotConnected()),this, SLOT(ahrsSettingsRequest())); - // Connect all the help buttons to signal mapper that passes button name to SLOT function - QSignalMapper* signalMapper = new QSignalMapper(this); - connect( m_ahrs->multiPointHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_ahrs->multiPointHelp, m_ahrs->multiPointHelp->objectName()); - connect( m_ahrs->sensorNoiseHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_ahrs->sensorNoiseHelp, m_ahrs->sensorNoiseHelp->objectName()); - connect( m_ahrs->accelBiasHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_ahrs->accelBiasHelp, m_ahrs->accelBiasHelp->objectName()); - connect( m_ahrs->gyroDriftHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_ahrs->gyroDriftHelp, m_ahrs->gyroDriftHelp->objectName()); - connect( m_ahrs->commandHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_ahrs->commandHelp, QString("commandHelp")); - connect( m_ahrs->insAlgorithmHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_ahrs->insAlgorithmHelp, m_ahrs->insAlgorithmHelp->objectName()); - connect( m_ahrs->homeLocationHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_ahrs->homeLocationHelp, m_ahrs->homeLocationHelp->objectName()); - - connect(signalMapper, SIGNAL(mapped(const QString &)), parent, SLOT(showHelp(const QString &))); - + // Connect the help button + connect(m_ahrs->ahrsHelp, SIGNAL(clicked()), this, SLOT(openHelp())); } ConfigAHRSWidget::~ConfigAHRSWidget() @@ -1222,6 +1206,11 @@ void ConfigAHRSWidget::ahrsSettingsSaveSD() } +void ConfigAHRSWidget::openHelp() +{ + + QDesktopServices::openUrl( QUrl("http://wiki.openpilot.org/display/Doc/INS+Configuration", QUrl::StrictMode) ); +} /** @} diff --git a/ground/openpilotgcs/src/plugins/config/configahrswidget.h b/ground/openpilotgcs/src/plugins/config/configahrswidget.h index 8cfaf041e..81344226e 100644 --- a/ground/openpilotgcs/src/plugins/config/configahrswidget.h +++ b/ground/openpilotgcs/src/plugins/config/configahrswidget.h @@ -126,6 +126,7 @@ private slots: void enableHomeLocSave(UAVObject *obj); void launchAHRSCalibration(); void saveAHRSCalibration(); + void openHelp(); void launchAccelBiasCalibration(); void calibPhase2(); void incrementProgress(); diff --git a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp index 27696457c..da6dc6afb 100644 --- a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp @@ -34,7 +34,8 @@ #include #include #include -#include +#include +#include /** Helper delegate for the custom mixer editor table. @@ -193,32 +194,8 @@ ConfigAirframeWidget::ConfigAirframeWidget(QWidget *parent) : ConfigTaskWidget(p connect(parent, SIGNAL(autopilotConnected()),this, SLOT(requestAircraftUpdate())); - // Connect all the help buttons to signal mapper that passes button name to SLOT function - QSignalMapper* signalMapper = new QSignalMapper(this); - connect( m_aircraft->acftTypeHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_aircraft->acftTypeHelp, m_aircraft->acftTypeHelp->objectName()); - connect( m_aircraft->airplaneTypeHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_aircraft->airplaneTypeHelp, m_aircraft->airplaneTypeHelp->objectName()); - connect( m_aircraft->channelAssignmentHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_aircraft->channelAssignmentHelp, m_aircraft->channelAssignmentHelp->objectName()); - connect( m_aircraft->commandHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_aircraft->commandHelp, QString("commandHelp")); - connect( m_aircraft->throttleCurveHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_aircraft->throttleCurveHelp, QString("throttleCurveHelp")); - connect( m_aircraft->multiFrameTypeHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_aircraft->multiFrameTypeHelp, m_aircraft->multiFrameTypeHelp->objectName()); - connect( m_aircraft->throttleCurveHelp_2, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_aircraft->throttleCurveHelp_2, QString("throttleCurveHelp")); - connect( m_aircraft->tricopterYawHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_aircraft->tricopterYawHelp, m_aircraft->tricopterYawHelp->objectName()); - connect( m_aircraft->motorOutputChanHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_aircraft->motorOutputChanHelp, m_aircraft->motorOutputChanHelp->objectName()); - connect( m_aircraft->feedForwardHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_aircraft->feedForwardHelp, m_aircraft->feedForwardHelp->objectName()); - connect( m_aircraft->commandHelp_2, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_aircraft->commandHelp_2, QString("commandHelp")); - - connect(signalMapper, SIGNAL(mapped(const QString &)), parent, SLOT(showHelp(const QString &))); + // Connect the help button + connect(m_aircraft->airframeHelp, SIGNAL(clicked()), this, SLOT(openHelp())); } ConfigAirframeWidget::~ConfigAirframeWidget() @@ -2161,3 +2138,9 @@ void ConfigAirframeWidget::saveAircraftUpdate() } +void ConfigAirframeWidget::openHelp() +{ + + QDesktopServices::openUrl( QUrl("http://wiki.openpilot.org/display/Doc/Airframe+configuration", QUrl::StrictMode) ); +} + diff --git a/ground/openpilotgcs/src/plugins/config/configairframewidget.h b/ground/openpilotgcs/src/plugins/config/configairframewidget.h index cbc8b1fc8..37f6ef877 100644 --- a/ground/openpilotgcs/src/plugins/config/configairframewidget.h +++ b/ground/openpilotgcs/src/plugins/config/configairframewidget.h @@ -89,6 +89,7 @@ private slots: void updateCustomThrottle1CurveValue(QList list, double value); void updateCustomThrottle2CurveValue(QList list, double value); void enableFFTest(); + void openHelp(); protected: void showEvent(QShowEvent *event); diff --git a/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp b/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp index beb4fa2fc..2a15bf0cf 100644 --- a/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp @@ -30,7 +30,8 @@ #include #include #include -#include +#include +#include ConfigCCAttitudeWidget::ConfigCCAttitudeWidget(QWidget *parent) : ConfigTaskWidget(parent), @@ -46,18 +47,8 @@ ConfigCCAttitudeWidget::ConfigCCAttitudeWidget(QWidget *parent) : connect(parent, SIGNAL(autopilotConnected()),this, SLOT(getCurrentAttitudeSettings())); getCurrentAttitudeSettings(); // The 1st time this panel is instanciated, the autopilot is already connected. - // Connect all the help buttons to signal mapper that passes button name to SLOT function - QSignalMapper* signalMapper = new QSignalMapper(this); - connect( ui->attitudeRotationHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(ui->attitudeRotationHelp, ui->attitudeRotationHelp->objectName()); - connect( ui->attitudeCalibHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(ui->attitudeCalibHelp, ui->attitudeCalibHelp->objectName()); - connect( ui->zeroOnArmHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(ui->zeroOnArmHelp, ui->zeroOnArmHelp->objectName()); - connect( ui->commandHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(ui->commandHelp, QString("commandHelp")); - - connect(signalMapper, SIGNAL(mapped(const QString &)), parent, SLOT(showHelp(const QString &))); + // Connect the help button + connect(ui->ccAttitudeHelp, SIGNAL(clicked()), this, SLOT(openHelp())); } ConfigCCAttitudeWidget::~ConfigCCAttitudeWidget() @@ -183,3 +174,10 @@ void ConfigCCAttitudeWidget::saveAttitudeSettings() { UAVDataObject * obj = dynamic_cast(getObjectManager()->getObject(QString("AttitudeSettings"))); saveObjectToSD(obj); } + +void ConfigCCAttitudeWidget::openHelp() +{ + + QDesktopServices::openUrl( QUrl("http://wiki.openpilot.org/display/Doc/CopterControl+Attitude+Configuration", QUrl::StrictMode) ); +} + diff --git a/ground/openpilotgcs/src/plugins/config/configccattitudewidget.h b/ground/openpilotgcs/src/plugins/config/configccattitudewidget.h index a70c552ba..1a2627c84 100644 --- a/ground/openpilotgcs/src/plugins/config/configccattitudewidget.h +++ b/ground/openpilotgcs/src/plugins/config/configccattitudewidget.h @@ -53,6 +53,7 @@ private slots: void saveAttitudeSettings(); void applyAttitudeSettings(); void getCurrentAttitudeSettings(); + void openHelp(); private: QMutex startStop; diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp index 7d7824a24..b49ccf1df 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp @@ -140,43 +140,5 @@ void ConfigGadgetWidget::onAutopilotConnect() { emit autopilotConnected(); } -void ConfigGadgetWidget::showHelp(const QString &helpName) -{ - // Close any previous help windows still open - if(help != 0) { - help->close(); - } - - // Make help windows with given filename and resize to config gadget width - help = new QTextBrowser(this); - help->setSource(QUrl::fromLocalFile( QString(Utils::PathUtils().InsertDataPath("%%DATAPATH%%help/")) + - helpName + QString(".html") )); - QSize size = help->sizeHint(); - size.setWidth(this->width()); - help->resize(size); - - // Now catch closing events, show the window and give it focus - help->installEventFilter(this); - help->show(); - help->setFocus(); -} - -bool ConfigGadgetWidget::eventFilter(QObject *obj, QEvent *event) -{ - // If help is open and we get a close event, close the help window - // Close events currently are any key press and the mouse leaving the help window - - //printf("event type: %d\n",event->type()); - if(help != 0) { - if (event->type() == QEvent::Leave || event->type() == QEvent::KeyPress) { - help->close(); - help=0; - return true; - } - } - - // standard event processing - return QObject::eventFilter(obj, event); -} diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.h b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.h index 185321fe3..2520458eb 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.h @@ -52,10 +52,6 @@ public: public slots: void onAutopilotConnect(); - void showHelp(const QString &helpName); - -private slots: - bool eventFilter(QObject *obj, QEvent *event); signals: void autopilotConnected(); diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 034cef519..9ee8f6bb7 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -35,7 +35,8 @@ #include #include #include -#include +#include +#include ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) { @@ -156,16 +157,6 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) connect(m_config->saveRCInputToRAM, SIGNAL(clicked()), this, SLOT(sendRCInputUpdate())); connect(m_config->getRCInputCurrent, SIGNAL(clicked()), this, SLOT(requestRCInputUpdate())); - // Flightmode panel is connected to the same as rcinput because - // the underlying object is the same! - connect(m_config->saveFmsToSD, SIGNAL(clicked()), this, SLOT(saveRCInputObject())); - connect(m_config->saveFmsToRAM, SIGNAL(clicked()), this, SLOT(sendRCInputUpdate())); - connect(m_config->getFmsCurrent, SIGNAL(clicked()), this, SLOT(requestRCInputUpdate())); - - connect(m_config->saveArmToSD, SIGNAL(clicked()), this, SLOT(saveRCInputObject())); - connect(m_config->saveArmToRAM, SIGNAL(clicked()), this, SLOT(sendRCInputUpdate())); - connect(m_config->getArmCurrent, SIGNAL(clicked()), this, SLOT(requestRCInputUpdate())); - connect(parent, SIGNAL(autopilotConnected()),this, SLOT(requestRCInputUpdate())); connect(m_config->inSlider0, SIGNAL(valueChanged(int)),this, SLOT(onInSliderValueChanged0(int))); @@ -201,29 +192,8 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) } } - // Connect all the help buttons to signal mapper that passes button name to SLOT function - QSignalMapper* signalMapper = new QSignalMapper(this); - connect( m_config->receiverTypeHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_config->receiverTypeHelp, m_config->receiverTypeHelp->objectName()); - connect( m_config->runCalibrationHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_config->runCalibrationHelp, m_config->runCalibrationHelp->objectName()); - connect( m_config->commandHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_config->commandHelp, QString("commandHelp")); - connect( m_config->flightModeSwPosHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_config->flightModeSwPosHelp, m_config->flightModeSwPosHelp->objectName()); - connect( m_config->stabilizationModePerAxis, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_config->stabilizationModePerAxis, m_config->stabilizationModePerAxis->objectName()); - connect( m_config->commandHelp_2, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_config->commandHelp_2, QString("commandHelp")); - connect( m_config->armPositionHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_config->armPositionHelp, m_config->armPositionHelp->objectName()); - connect( m_config->armingTimeoutHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_config->armingTimeoutHelp, m_config->armingTimeoutHelp->objectName()); - connect( m_config->commandHelp_3, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_config->commandHelp_2, QString("commandHelp")); - - connect(signalMapper, SIGNAL(mapped(const QString &)), parent, SLOT(showHelp(const QString &))); - + // Connect the help button + connect(m_config->inputHelp, SIGNAL(clicked()), this, SLOT(openHelp())); } ConfigInputWidget::~ConfigInputWidget() @@ -322,15 +292,6 @@ void ConfigInputWidget::enableControls(bool enable) m_config->saveRCInputToRAM->setEnabled(enable); m_config->saveRCInputToSD->setEnabled(enable); - m_config->saveFmsToSD->setEnabled(enable); - m_config->saveFmsToRAM->setEnabled(enable); - m_config->getFmsCurrent->setEnabled(enable); - - m_config->saveArmToSD->setEnabled(enable); - m_config->saveArmToRAM->setEnabled(enable); - m_config->getArmCurrent->setEnabled(enable); - - m_config->doRCInputCalibration->setEnabled(enable); m_config->ch0Assign->setEnabled(enable); @@ -719,3 +680,10 @@ void ConfigInputWidget::updateChannelInSlider(QSlider *slider, QLabel *min, QLab slider->setValue(value); } } + +void ConfigInputWidget::openHelp() +{ + + QDesktopServices::openUrl( QUrl("http://wiki.openpilot.org/display/Doc/Input+Configuration", QUrl::StrictMode) ); +} + diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.h b/ground/openpilotgcs/src/plugins/config/configinputwidget.h index 4f0fa0182..5747ee35d 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.h @@ -90,6 +90,7 @@ private slots: void sendRCInputUpdate(); void saveRCInputObject(); void reverseCheckboxClicked(bool state); + void openHelp(); }; #endif diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index 0879de42a..27858e111 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -36,7 +36,8 @@ #include #include #include -#include +#include +#include ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(parent) { @@ -154,20 +155,8 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren } } - // Connect all the help buttons to signal mapper that passes button name to SLOT function - QSignalMapper* signalMapper = new QSignalMapper(this); - connect( m_config->channelRateHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_config->channelRateHelp, m_config->channelRateHelp->objectName()); - connect( m_config->channelValuesHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_config->channelValuesHelp, m_config->channelValuesHelp->objectName()); - connect( m_config->spinningArmedlHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_config->spinningArmedlHelp, m_config->spinningArmedlHelp->objectName()); - connect( m_config->testOutputsHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_config->testOutputsHelp, m_config->testOutputsHelp->objectName()); - connect( m_config->commandHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_config->commandHelp, QString("commandHelp")); - - connect(signalMapper, SIGNAL(mapped(const QString &)), parent, SLOT(showHelp(const QString &))); + // Connect the help button + connect(m_config->outputHelp, SIGNAL(clicked()), this, SLOT(openHelp())); } ConfigOutputWidget::~ConfigOutputWidget() @@ -627,5 +616,10 @@ void ConfigOutputWidget::reverseChannel(bool state) } +void ConfigOutputWidget::openHelp() +{ + + QDesktopServices::openUrl( QUrl("http://wiki.openpilot.org/display/Doc/Output+Configuration", QUrl::StrictMode) ); +} diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.h b/ground/openpilotgcs/src/plugins/config/configoutputwidget.h index f3083e725..bb18312f7 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.h @@ -87,6 +87,7 @@ private slots: void reverseChannel(bool state); void linkToggled(bool state); void setSpinningArmed(bool val); + void openHelp(); }; #endif diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp index 6d829b756..dd172a599 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp @@ -32,8 +32,8 @@ #include #include #include -#include - +#include +#include ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTaskWidget(parent) { @@ -74,20 +74,8 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa connect(m_stabilization->pitchKi, SIGNAL(valueChanged(double)), this, SLOT(updatePitchKI(double))); connect(m_stabilization->pitchILimit, SIGNAL(valueChanged(double)), this, SLOT(updatePitchILimit(double))); - // Connect all the help buttons to signal mapper that passes button name to SLOT function - QSignalMapper* signalMapper = new QSignalMapper(this); - connect( m_stabilization->rateStabiHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_stabilization->rateStabiHelp, m_stabilization->rateStabiHelp->objectName()); - connect( m_stabilization->attitudeStabiHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_stabilization->attitudeStabiHelp, m_stabilization->attitudeStabiHelp->objectName()); - connect( m_stabilization->angleLimitsHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_stabilization->angleLimitsHelp, m_stabilization->angleLimitsHelp->objectName()); - connect( m_stabilization->updateRealTimeHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_stabilization->updateRealTimeHelp, m_stabilization->updateRealTimeHelp->objectName()); - connect( m_stabilization->commandHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_stabilization->commandHelp, m_stabilization->commandHelp->objectName()); - - connect(signalMapper, SIGNAL(mapped(const QString &)), parent, SLOT(showHelp(const QString &))); + // Connect the help button + connect(m_stabilization->stabilizationHelp, SIGNAL(clicked()), this, SLOT(openHelp())); } ConfigStabilizationWidget::~ConfigStabilizationWidget() @@ -290,3 +278,9 @@ void ConfigStabilizationWidget::realtimeUpdateToggle(bool state) updateTimer.stop(); } +void ConfigStabilizationWidget::openHelp() +{ + + QDesktopServices::openUrl( QUrl("http://wiki.openpilot.org/display/Doc/Stabilization+panel", QUrl::StrictMode) ); +} + diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h index 00cbbc977..5af92ae65 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h @@ -55,6 +55,7 @@ private slots: void sendStabilizationUpdate(); void saveStabilizationUpdate(); void realtimeUpdateToggle(bool); + void openHelp(); void updateRateRollKP(double); void updateRateRollKI(double); diff --git a/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp b/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp index a307da966..843f94ffb 100644 --- a/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp @@ -32,7 +32,6 @@ #include #include #include -#include ConfigTelemetryWidget::ConfigTelemetryWidget(QWidget *parent) : ConfigTaskWidget(parent) @@ -54,15 +53,6 @@ ConfigTelemetryWidget::ConfigTelemetryWidget(QWidget *parent) : ConfigTaskWidget connect(m_telemetry->getTelemetryCurrent, SIGNAL(clicked()), this, SLOT(requestTelemetryUpdate())); connect(parent, SIGNAL(autopilotConnected()),this, SLOT(requestTelemetryUpdate())); - - // Connect all the help buttons to signal mapper that passes button name to SLOT function - QSignalMapper* signalMapper = new QSignalMapper(this); - connect( m_telemetry->telemetryHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_telemetry->telemetryHelp, m_telemetry->telemetryHelp->objectName()); - connect( m_telemetry->commandHelp, SIGNAL(clicked()), signalMapper, SLOT(map()) ); - signalMapper->setMapping(m_telemetry->commandHelp, QString("commandHelp")); - - connect(signalMapper, SIGNAL(mapped(const QString &)), parent, SLOT(showHelp(const QString &))); } ConfigTelemetryWidget::~ConfigTelemetryWidget() diff --git a/ground/openpilotgcs/src/plugins/config/images/quad-shapes.svg b/ground/openpilotgcs/src/plugins/config/images/quad-shapes.svg index 8452bfd11..1fccbd6ce 100644 --- a/ground/openpilotgcs/src/plugins/config/images/quad-shapes.svg +++ b/ground/openpilotgcs/src/plugins/config/images/quad-shapes.svg @@ -16,7 +16,7 @@ width="4065.2493" height="1760.019" xml:space="preserve" - sodipodi:docname="quad-shapes.svg">image/svg+xml \ No newline at end of file + inkscape:connector-curvature="0" /> diff --git a/ground/openpilotgcs/src/plugins/config/input.ui b/ground/openpilotgcs/src/plugins/config/input.ui index c198639db..d3260e150 100644 --- a/ground/openpilotgcs/src/plugins/config/input.ui +++ b/ground/openpilotgcs/src/plugins/config/input.ui @@ -6,8 +6,8 @@ 0 0 - 617 - 395 + 557 + 462 @@ -17,1489 +17,980 @@ - 2 + 0 - + RC Input - - - - 530 - 40 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Maximum channel pulse width</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 2000 - - - - - - 150 - 40 - 51 - 17 - - - - - FreeSans - 10 - 75 - true - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + + + + MS Shell Dlg 2 + 8 + + + + + + + + + FreeSans + 10 + 75 + true + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - - - 1000 - - - - - - 205 - 70 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + 1000 + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Minimum channel pulse width</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 1000 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 205 - 220 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Minimum channel pulse width</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 1000 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 150 - 250 - 51 - 17 - - - - - FreeSans - 10 - 75 - true - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - - - 1000 - - - - - - 530 - 160 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + 1000 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + 1000 + + + 2000 + + + 1500 + + + Qt::Horizontal + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Maximum channel pulse width</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 2000 - - - - - - 205 - 250 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + 2000 + + + + + + + Check this to reverse the channel. +(Useful for transmitters without channel +reversal capabilities). + + + + + + + + + + + MS Shell Dlg 2 + 8 + + + + + + + + + FreeSans + 10 + 75 + true + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> + + + 1000 + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Minimum channel pulse width</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 1000 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 260 - 280 - 93 - 27 - - - - Retrieve settings from OpenPilot - - - Get Current - - - - - - 205 - 100 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + 1000 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + 1000 + + + 2000 + + + 1500 + + + Qt::Horizontal + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Maximum channel pulse width</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> + + + 2000 + + + + + + + Check this to reverse the channel. +(Useful for transmitters without channel +reversal capabilities). + + + + + + + + + + + MS Shell Dlg 2 + 8 + + + + + + + + + FreeSans + 10 + 75 + true + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> + + + 1000 + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Minimum channel pulse width</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 1000 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 530 - 220 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + 1000 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + 1000 + + + 2000 + + + 1500 + + + Qt::Horizontal + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Maximum channel pulse width</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 2000 - - - - - - 530 - 190 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Maximum channel pulse width</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 2000 - - - - - - 530 - 130 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Maximum channel pulse width</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 2000 - - - - - - 460 - 280 - 93 - 27 - - - - Be sure to set the Neutral position on all sliders before sending! -Applies and Saves all settings to SD - - - Save - - - - - - 150 - 160 - 51 - 17 - - - - - FreeSans - 10 - 75 - true - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + 2000 + + + + + + + Check this to reverse the channel. +(Useful for transmitters without channel +reversal capabilities). + + + + + + + + + + + MS Shell Dlg 2 + 8 + + + + + + + + + FreeSans + 10 + 75 + true + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - - - 1000 - - - - - - 205 - 160 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + 1000 + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Minimum channel pulse width</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 1000 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 360 - 280 - 93 - 27 - - - - Send to OpenPilot but don't write in SD. -Be sure to set the Neutral position on all sliders before sending! - - - Apply - - - - - - 20 - 40 - 121 - 21 - - - - - MS Shell Dlg 2 - 8 - - - - - 16 - 16 - - - - true - - - - - - 205 - 130 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Minimum channel pulse width</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 1000 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 530 - 250 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + 1000 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + 1000 + + + 2000 + + + 1500 + + + Qt::Horizontal + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Maximum channel pulse width</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 2000 - - - - - - 150 - 100 - 51 - 17 - - - - - FreeSans - 10 - 75 - true - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + 2000 + + + + + + + Check this to reverse the channel. +(Useful for transmitters without channel +reversal capabilities). + + + + + + + + + + + MS Shell Dlg 2 + 8 + + + + + + + + + FreeSans + 10 + 75 + true + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - - - 1000 - - - - - - 150 - 190 - 51 - 17 - - - - - FreeSans - 10 - 75 - true - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - - - 1000 - - - - - - 205 - 190 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + 1000 + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Minimum channel pulse width</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 1000 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 150 - 70 - 51 - 17 - - - - - FreeSans - 10 - 75 - true - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - - - 1000 - - - - - - 150 - 220 - 51 - 17 - - - - - FreeSans - 10 - 75 - true - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - - - 1000 - - - - - - 150 - 130 - 51 - 17 - - - - - FreeSans - 10 - 75 - true - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - - - 1000 - - - - - - 530 - 100 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + 1000 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + 1000 + + + 2000 + + + 1500 + + + Qt::Horizontal + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Maximum channel pulse width</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 2000 - - - - - - 530 - 70 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + 2000 + + + + + + + Check this to reverse the channel. +(Useful for transmitters without channel +reversal capabilities). + + + + + + + + + + + MS Shell Dlg 2 + 8 + + + + + + + + + FreeSans + 10 + 75 + true + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Maximum channel pulse width</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 2000 - - - - - - 205 - 40 - 36 - 17 - - - - - FreeSans - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +</style></head><body style=" font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> + + + 1000 + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Minimum channel pulse width</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 1000 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 20 - 70 - 121 - 21 - - - - - MS Shell Dlg 2 - 8 - - - - - - - 20 - 100 - 121 - 21 - - - - - MS Shell Dlg 2 - 8 - - - - - - - 20 - 130 - 121 - 21 - - - - - MS Shell Dlg 2 - 8 - - - - - - - 20 - 160 - 121 - 21 - - - - - MS Shell Dlg 2 - 8 - - - - - - - 20 - 190 - 121 - 21 - - - - - MS Shell Dlg 2 - 8 - - - - - - - 20 - 220 - 121 - 21 - - - - - MS Shell Dlg 2 - 8 - - - - - - - 20 - 250 - 121 - 21 - - - - - MS Shell Dlg 2 - 8 - - - - - - - 40 - 283 - 181 - 22 - - - - - 75 - true - - - - Start calibrating the RC Inputs. + + + 1000 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + 1000 + + + 2000 + + + 1500 + + + Qt::Horizontal + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Maximum channel pulse width</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> + + + 2000 + + + + + + + Check this to reverse the channel. +(Useful for transmitters without channel +reversal capabilities). + + + + + + + + + + + MS Shell Dlg 2 + 8 + + + + + + + + + FreeSans + 10 + 75 + true + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> + + + 1000 + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Minimum channel pulse width</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> + + + 1000 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + 1000 + + + 2000 + + + 1500 + + + Qt::Horizontal + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Maximum channel pulse width</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> + + + 2000 + + + + + + + Check this to reverse the channel. +(Useful for transmitters without channel +reversal capabilities). + + + + + + + + + + + 75 + true + + + + Start calibrating the RC Inputs. Uncheck/Check to restart calibration. During calibration: move your RC controls over their whole range, then leave them on Neutral, uncheck calibration and save. Neutral should be put at the bottom of the slider for the throttle. - - - Run Calibration - - - - - - 260 - 0 - 291 - 41 - - - - - 11 - 75 - true - - - - Indicates whether OpenPilot is getting a signal from the RC receiver. - - - RC Receiver not connected or invalid input configuration (missing channels) - - - true - - - - - - 140 - 10 - 91 - 21 - - - - Select the receiver type here: + + + Run Calibration + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:10pt; font-weight:600; color:#ff0000;">BEWARE: make sure your engines are not connected when running calibration!</span></p></body></html> + + + + + + + Rev. + + + + + + + Check this to reverse the channel. +(Useful for transmitters without channel +reversal capabilities). + + + + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Maximum channel pulse width</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> + + + 2000 + + + + + + + true + + + 1000 + + + 2000 + + + 1500 + + + Qt::Horizontal + + + + + + + + FreeSans + 8 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'FreeSans'; font-size:8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Minimum channel pulse width</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> + + + 1000 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + FreeSans + 10 + 75 + true + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'FreeSans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> + + + 1000 + + + + + + + + MS Shell Dlg 2 + 8 + + + + + 16 + 16 + + + + true + + + + + + + + 11 + 75 + true + + + + Indicates whether OpenPilot is getting a signal from the RC receiver. + + + RC Receiver not connected or invalid input configuration (missing channels) + + + true + + + + + + + Select the receiver type here: - PWM is the most usual type - PPM is connected to input XXX - Spektrum is used with Spektrum 'satellite' receivers - - - - - - 20 - 10 - 111 - 17 - - - - - 75 - true - - - - Receiver Type: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 20 - 310 - 561 - 21 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt; font-weight:600; color:#ff0000;">BEWARE: make sure your engines are not connected when running calibration!</span></p></body></html> - - - - - - 250 - 40 - 271 - 21 - - - - true - - - 1000 - - - 2000 - - - 1500 - - - Qt::Horizontal - - - - - - 250 - 70 - 271 - 21 - - - - true - - - 1000 - - - 2000 - - - 1500 - - - Qt::Horizontal - - - - - - 250 - 100 - 271 - 21 - - - - true - - - 1000 - - - 2000 - - - 1500 - - - Qt::Horizontal - - - - - - 250 - 130 - 271 - 21 - - - - true - - - 1000 - - - 2000 - - - 1500 - - - Qt::Horizontal - - - - - - 250 - 160 - 271 - 21 - - - - true - - - 1000 - - - 2000 - - - 1500 - - - Qt::Horizontal - - - - - - 250 - 190 - 271 - 21 - - - - true - - - 1000 - - - 2000 - - - 1500 - - - Qt::Horizontal - - - - - - 250 - 220 - 271 - 21 - - - - true - - - 1000 - - - 2000 - - - 1500 - - - Qt::Horizontal - - - - - - 250 - 250 - 271 - 21 - - - - true - - - 1000 - - - 2000 - - - 1500 - - - Qt::Horizontal - - - - - - 560 - 40 - 21 - 22 - - - - Check this to reverse the channel. -(Useful for transmitters without channel -reversal capabilities). - - - - - - - - - 560 - 20 - 31 - 20 - - - - Rev. - - - - - - 560 - 70 - 21 - 22 - - - - Check this to reverse the channel. -(Useful for transmitters without channel -reversal capabilities). - - - - - - - - - 560 - 100 - 21 - 22 - - - - Check this to reverse the channel. -(Useful for transmitters without channel -reversal capabilities). - - - - - - - - - 560 - 130 - 21 - 22 - - - - Check this to reverse the channel. -(Useful for transmitters without channel -reversal capabilities). - - - - - - - - - 560 - 160 - 21 - 22 - - - - Check this to reverse the channel. -(Useful for transmitters without channel -reversal capabilities). - - - - - - - - - 560 - 190 - 21 - 22 - - - - Check this to reverse the channel. -(Useful for transmitters without channel -reversal capabilities). - - - - - - - - - 560 - 220 - 21 - 22 - - - - Check this to reverse the channel. -(Useful for transmitters without channel -reversal capabilities). - - - - - - - - - 560 - 250 - 21 - 22 - - - - Check this to reverse the channel. -(Useful for transmitters without channel -reversal capabilities). - - - - - - - - - 230 - 284 - 20 - 20 - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - - - - 10 - 284 - 20 - 20 - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - - - - 10 - 10 - 20 - 20 - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - + + + + + + + + 75 + true + + + + Receiver Type: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + Flight Mode Switch Settings - - - - 270 - 310 - 93 - 27 - - - - Retrieve settings from OpenPilot - - - Get Current - - - - - - 380 - 310 - 93 - 27 - - - - Send to OpenPilot but don't write in SD. -Be sure to set the Neutral position on all sliders before sending! - - - Apply - - - - - - 490 - 310 - 93 - 27 - - - - Be sure to set the Neutral position on all sliders before sending! -Applies and Saves all settings to SD - - - Save - - - 390 + 310 10 201 17 @@ -1518,7 +1009,7 @@ Applies and Saves all settings to SD - 390 + 310 30 201 17 @@ -1760,87 +1251,6 @@ if you have not done so already. - - - - 5 - 0 - 20 - 20 - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - - - - 5 - 130 - 20 - 20 - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - - - - 240 - 314 - 20 - 20 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - @@ -1849,29 +1259,6 @@ if you have not done so already. - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -1909,29 +1296,6 @@ if you have not done so already. - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -1971,6 +1335,13 @@ if you have not done so already. + + + + Airframe disarm is done by throttle off and opposite of above combination. + + + @@ -1984,71 +1355,91 @@ if you have not done so already. - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - - - - - Get Current - - - - - - - Apply - - - - - - - Save - - - - - + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 32 + 32 + + + + + + + + :/core/images/helpicon.svg:/core/images/helpicon.svg + + + + 32 + 32 + + + + true + + + + + + + Retrieve settings from OpenPilot + + + Get Current + + + + + + + Send to OpenPilot but don't write in SD. +Be sure to set the Neutral position on all sliders before sending! + + + Apply + + + + + + + Be sure to set the Neutral position on all sliders before sending! +Applies and Saves all settings to SD + + + Save + + + + + @@ -2062,9 +1453,6 @@ if you have not done so already. ch7Assign receiverType doRCInputCalibration - getRCInputCurrent - saveRCInputToRAM - saveRCInputToSD fmsSlider fmsModePos3 fmsSsPos3Roll @@ -2078,12 +1466,9 @@ if you have not done so already. fmsSsPos1Roll fmsSsPos1Pitch fmsSsPos1Yaw - getFmsCurrent - saveFmsToRAM - saveFmsToSD - + diff --git a/ground/openpilotgcs/src/plugins/config/output.ui b/ground/openpilotgcs/src/plugins/config/output.ui index 95d977cf7..4d292204b 100644 --- a/ground/openpilotgcs/src/plugins/config/output.ui +++ b/ground/openpilotgcs/src/plugins/config/output.ui @@ -136,29 +136,6 @@ Leave at 50Hz for fixed wing. - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -1052,29 +1029,6 @@ p, li { white-space: pre-wrap; } - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -1092,29 +1046,6 @@ p, li { white-space: pre-wrap; } - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -1152,29 +1083,6 @@ p, li { white-space: pre-wrap; } - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -1204,7 +1112,7 @@ p, li { white-space: pre-wrap; } - + 0 @@ -1213,16 +1121,25 @@ p, li { white-space: pre-wrap; } - 20 - 20 + 32 + 32 - - :/configgadget/images/help2.png:/configgadget/images/help2.png + + :/core/images/helpicon.svg:/core/images/helpicon.svg + + + + 32 + 32 + + + + true @@ -1313,7 +1230,7 @@ Applies and Saves all settings to SD saveRCOutputToSD - + diff --git a/ground/openpilotgcs/src/plugins/config/stabilization.ui b/ground/openpilotgcs/src/plugins/config/stabilization.ui index 5b41db44f..e4ccf1b89 100644 --- a/ground/openpilotgcs/src/plugins/config/stabilization.ui +++ b/ground/openpilotgcs/src/plugins/config/stabilization.ui @@ -7,7 +7,7 @@ 0 0 639 - 657 + 461 @@ -21,29 +21,6 @@ - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -272,29 +249,6 @@ value as YawRate Kp. - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -527,29 +481,6 @@ flying style. - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -651,29 +582,6 @@ flying style. - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - @@ -699,7 +607,7 @@ automatically every 300ms, which will help for fast tuning. - + 0 @@ -708,16 +616,25 @@ automatically every 300ms, which will help for fast tuning. - 20 - 20 + 32 + 32 - - :/configgadget/images/help2.png:/configgadget/images/help2.png + + :/core/images/helpicon.svg:/core/images/helpicon.svg + + + + 32 + 32 + + + + true @@ -747,7 +664,7 @@ automatically every 300ms, which will help for fast tuning. - + diff --git a/ground/openpilotgcs/src/plugins/config/telemetry.ui b/ground/openpilotgcs/src/plugins/config/telemetry.ui index 2423a6e1a..905e2fdb2 100644 --- a/ground/openpilotgcs/src/plugins/config/telemetry.ui +++ b/ground/openpilotgcs/src/plugins/config/telemetry.ui @@ -6,192 +6,128 @@ 0 0 - 720 - 480 + 505 + 389 Form - - - - 10 - 10 - 411 - 321 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - 10 - 10 - 361 - 151 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 10 + 10 + 361 + 151 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">Set the serial speed of your onboard telemetry modem here. It is the speed between the OpenPilot board and the onboard modem, and could be different from the radio link speed.</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">Beware of not locking yourself out! You should only modify this setting when the OpenPilot board is connected through the USB port.</span></p></body></html> - - - - - - 70 - 200 - 131 - 17 - - - - - 11 - 75 - true - - - - Telemetry speed: - - - - - - 200 - 190 - 141 - 31 - - - - Select the speed here. - - - - - - 190 - 280 - 93 - 27 - - - - Send to OpenPilot but don't write in SD. + + + + + + 70 + 200 + 131 + 17 + + + + + 11 + 75 + true + + + + Telemetry speed: + + + + + + 200 + 190 + 141 + 31 + + + + Select the speed here. + + + + + + 190 + 280 + 93 + 27 + + + + Send to OpenPilot but don't write in SD. Beware of not locking yourself out! - - - Apply - - - - - - 80 - 280 - 93 - 27 - - - - Retrieve settings from OpenPilot - - - Get Current - - - - - - 300 - 280 - 93 - 27 - - - - Applies and Saves all settings to SD. + + + Apply + + + + + + 80 + 280 + 93 + 27 + + + + Retrieve settings from OpenPilot + + + Get Current + + + + + + 300 + 280 + 93 + 27 + + + + Applies and Saves all settings to SD. Beware of not locking yourself out! - - - Save - - - - - - 45 - 198 - 20 - 20 - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - - - - 45 - 284 - 20 - 20 - - - - - 0 - 0 - - - - - 20 - 20 - - - - - - - - :/configgadget/images/help2.png:/configgadget/images/help2.png - - - + + + Save + + + + + - - - + diff --git a/ground/openpilotgcs/src/plugins/coreplugin/OpenPilotGCS.xml b/ground/openpilotgcs/src/plugins/coreplugin/OpenPilotGCS.xml new file mode 100644 index 000000000..d46f83424 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/coreplugin/OpenPilotGCS.xml @@ -0,0 +1,2832 @@ + + + en_AU + true + + + 0 + + + #666666 + false + true + + + + + false + 1.0.0 + + + + + + + 0 + + + + + + + + + 0 + + 1 + + false + + 0 + + + + + + + + + false + 0.0.0 + + + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/default/attitude.svg + foreground + needle + needle + needle3 + Ubuntu,11,-1,5,50,0,0,0,0,0 + AttitudeActual + -1 + 360 + 0 + Rotate + Roll + AttitudeActual + 75 + 20 + 0 + Vertical + Pitch + AttitudeActual + -1 + 360 + 0 + Rotate + Roll + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/default/altimeter.svg + foreground + needle + needle2 + needle3 + Ubuntu,11,-1,5,50,0,0,0,0,0 + BaroAltitude + 1 + 10 + 0 + Rotate + Altitude + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/default/barometer.svg + + needle + + + Ubuntu,11,-1,5,50,0,0,0,0,0 + BaroAltitude + 10 + 1120 + 1000 + Rotate + Pressure + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/default/vsi.svg + + needle + + + Ubuntu,11,-1,5,50,0,0,0,0,0 + VelocityActual + 0.01 + 12 + -12 + Rotate + Down + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/default/compass.svg + foreground + needle + + + Ubuntu,11,-1,5,50,0,0,0,0,0 + AttitudeActual + -1 + 360 + 0 + Rotate + Yaw + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/deluxe/attitude.svg + foreground + needle + needle + needle3 + Ubuntu,11,-1,5,50,0,0,0,0,0 + AttitudeActual + -1 + 360 + 0 + Rotate + Roll + AttitudeActual + 75 + 20 + 0 + Vertical + Pitch + AttitudeActual + -1 + 360 + 0 + Rotate + Roll + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/deluxe/altimeter.svg + foreground + needle + needle2 + needle3 + Ubuntu,11,-1,5,50,0,0,0,0,0 + BaroAltitude + 1 + 10 + 0 + Rotate + Altitude + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/deluxe/barometer.svg + foreground + needle + + + Ubuntu,11,-1,5,50,0,0,0,0,0 + BaroAltitude + 10 + 1120 + 1000 + Rotate + Pressure + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/deluxe/vsi.svg + foreground + needle + + + Ubuntu,11,-1,5,50,0,0,0,0,0 + VelocityActual + 0.01 + 11.2 + -11.2 + Rotate + Down + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/deluxe/compass.svg + foreground + needle + + + Ubuntu,11,-1,5,50,0,0,0,0,0 + AttitudeActual + -1 + 360 + 0 + Rotate + Yaw + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/deluxe/speed.svg + foreground + needle + + + Ubuntu,11,-1,5,50,0,0,0,0,0 + GPSPosition + 3.6 + 120 + 0 + Rotate + Groundspeed + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/deluxe/thermometer.svg + foreground + needle + needle2 + needle3 + Ubuntu,11,-1,5,50,0,0,0,0,0 + BaroAltitude + 1 + 120 + 0 + Rotate + Temperature + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + /home/lafargue/OP/OpenPilot/trunk/artwork/Dials/deluxe/turncoordinator.svg + foreground + needle + needle2 + needle2 + Ubuntu,11,-1,5,50,0,0,0,0,0 + AttitudeActual + -1 + 360 + 0 + Rotate + Roll + AttitudeRaw + 1 + 20 + -20 + Horizontal + accels-X + AttitudeRaw + -1 + 360 + 0 + Rotate + accels-X + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/default/speed.svg + + needle + + + Ubuntu,11,-1,5,50,0,0,0,0,0 + GPSPosition + 3.6 + 120 + 0 + Rotate + Groundspeed + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/hi-contrast/attitude.svg + foreground + needle + needle + needle3 + Ubuntu,11,-1,5,50,0,0,0,0,0 + AttitudeActual + -1 + 360 + 0 + Rotate + Roll + AttitudeActual + 75 + 20 + 0 + Vertical + Pitch + AttitudeActual + -1 + 360 + 0 + Rotate + Roll + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/hi-contrast/altimeter.svg + foreground + needle + needle2 + needle3 + Ubuntu,11,-1,5,50,0,0,0,0,0 + BaroAltitude + 1 + 10 + 0 + Rotate + Altitude + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/hi-contrast/barometer.svg + + needle + + + Ubuntu,11,-1,5,50,0,0,0,0,0 + BaroAltitude + 10 + 1120 + 1000 + Rotate + Pressure + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/hi-contrast/vsi.svg + + needle + + + Ubuntu,11,-1,5,50,0,0,0,0,0 + VelocityActual + 0.01 + 12 + -12 + Rotate + Down + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/hi-contrast/compass.svg + foreground + needle + + + Ubuntu,11,-1,5,50,0,0,0,0,0 + AttitudeActual + -1 + 360 + 0 + Rotate + Yaw + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/hi-contrast/speed.svg + + needle + + + Ubuntu,11,-1,5,50,0,0,0,0,0 + GPSPosition + 3.6 + 120 + 0 + Rotate + Groundspeed + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/hi-contrast/thermometer.svg + + needle + needle2 + needle3 + Ubuntu,11,-1,5,50,0,0,0,0,0 + BaroAltitude + 1 + 120 + 0 + Rotate + Temperature + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/default/thermometer.svg + + needle + needle2 + needle3 + Ubuntu,11,-1,5,50,0,0,0,0,0 + ManualControlCommand + 1 + 2000 + 1000 + Rotate + Channel-3 + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + false + 0.0.0 + + + false + background + %%DATAPATH%%dials/default/thermometer.svg + + needle + needle2 + needle3 + Ubuntu,11,-1,5,50,0,0,0,0,0 + BaroAltitude + 1 + 120 + 0 + Rotate + Temperature + BaroAltitude + 1 + 100 + 0 + Rotate + Altitude + BaroAltitude + 1 + 1000 + 0 + Rotate + Altitude + false + + + + + + + false + 0.0.0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0.1 + 3 + 0 + 0.1 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + false + false + true + false + false + false + false + false + 2 + 1 + 0 + 2 + 3 + + + + + + + false + 0.0.0 + + + Telemetry + 3 + 0 + 0 + Serial port 0 + 11 + 0 + + + + + false + 0.0.0 + + + Serial + 3 + 0 + 0 + Serial port 0 + 17 + 0 + + + + + + + false + 0.0.0 + + + \usr\games\fgfs + \usr\share\games\FlightGear + 127.0.0.1 + 9009 + + + false + 9010 + 127.0.0.1 + FG + true + + + + + false + 0.0.0 + + + \home\lafargue\X-Plane 9\X-Plane-i686 + \usr\share\games\FlightGear + 127.0.0.3 + 6756 + + + false + 49000 + 127.0.0.1 + X-Plane + false + + + + + + + false + 1.0.1 + + + gcs.ini + + + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/lineardial-vertical.svg + 0 + 1 + Andale Mono,12,-1,5,75,0,0,0,0,0 + 50 + 0 + 100 + 0 + 100 + 80 + AhrsStatus + CPULoad + false + 80 + 50 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/lineardial-horizontal.svg + 2 + 1 + Andale Mono,8,-1,5,50,0,0,0,0,0 + -9 + -10 + 11 + -11 + 11 + -11 + AttitudeRaw + accels-X + false + -5 + -11 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/lineardial-horizontal.svg + 2 + 1 + Andale Mono,6,-1,5,50,0,0,0,0,0 + -9 + -10 + 11 + -11 + 11 + -11 + AttitudeRaw + accels-Y + false + -5 + -11 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/lineardial-horizontal.svg + 2 + 1 + Andale Mono,8,-1,5,50,0,0,0,0,0 + -9 + -10 + 11 + -11 + 11 + -11 + AttitudeRaw + accels-Z + false + -5 + -11 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/arm-status.svg + 0 + 1 + ,12,-1,5,50,0,0,0,0,0 + 100 + 66 + 100 + 0 + 33 + 0 + FlightStatus + Armed + false + 66 + 33 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/textonly.svg + 0 + 0.001 + ,12,-1,5,50,0,0,0,0,0 + 100 + 66 + 100 + 0 + 33 + 0 + SystemStats + FlightTime + false + 66 + 33 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/flightmode-status.svg + 0 + 1 + ,12,-1,5,50,0,0,0,0,0 + 100 + 66 + 100 + 0 + 33 + 0 + FlightStatus + FlightMode + false + 66 + 33 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/gps-signal.svg + 0 + 1 + ,12,-1,5,50,0,0,0,0,0 + 0 + 0 + 12 + 0 + 0 + 0 + GPSPosition + Satellites + false + 0 + 0 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/gps-status.svg + 0 + 1 + ,12,-1,5,50,0,0,0,0,0 + 100 + 66 + 100 + 0 + 33 + 0 + GPSPosition + Status + false + 66 + 33 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/lineardial-vertical.svg + 0 + 1 + Andale Mono,12,-1,5,75,0,0,0,0,0 + 50 + 0 + 100 + 0 + 100 + 80 + SystemStats + CPULoad + false + 80 + 50 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/lineardial-vertical.svg + 2 + 1 + Andale Mono,12,-1,5,75,0,0,0,0,0 + 0.5 + -0.5 + 1 + -1 + 1 + -1 + ActuatorDesired + Pitch + false + 0.8 + -0.8 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/lineardial-vertical.svg + 2 + 1 + Andale Mono,12,-1,5,75,0,0,0,0,0 + 0.5 + -0.5 + 1 + -1 + 1 + -1 + ManualControlCommand + Pitch + false + 0.8 + -0.8 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/lineardial-vertical.svg + 2 + 1 + Andale Mono,12,-1,5,75,0,0,0,0,0 + 0.8 + 0.3 + 90 + -90 + 1 + 0 + AttitudeActual + Pitch + false + 0.9 + 0.1 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/lineardial-vertical.svg + 2 + 1 + Andale Mono,12,-1,5,75,0,0,0,0,0 + 0.5 + -0.5 + 1 + -1 + 1 + -1 + ActuatorDesired + Roll + false + 0.8 + -0.8 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/lineardial-vertical.svg + 2 + 1 + Andale Mono,12,-1,5,75,0,0,0,0,0 + 0.5 + -0.5 + 1 + -1 + 1 + -1 + ManualControlCommand + Roll + false + 0.8 + -0.8 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/lineardial-horizontal.svg + 0 + 1 + Andale Mono,12,-1,5,75,0,0,0,0,0 + 650 + 0 + 1200 + 0 + 1200 + 900 + GCSTelemetryStats + RxDataRate + false + 900 + 650 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/lineardial-horizontal.svg + 0 + 1 + Andale Mono,12,-1,5,75,0,0,0,0,0 + 650 + 0 + 1200 + 0 + 1200 + 900 + GCSTelemetryStats + TxDataRate + false + 900 + 650 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/lineardial-vertical.svg + 2 + 1 + Andale Mono,12,-1,5,75,0,0,0,0,0 + 0.5 + 0 + 1 + 0 + 1 + 0.75 + ManualControlCommand + Throttle + false + 0.75 + 0.5 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/lineardial-vertical.svg + 2 + 1 + Andale Mono,12,-1,5,75,0,0,0,0,0 + 0.5 + -0.5 + 1 + -1 + 1 + -1 + ActuatorDesired + Yaw + false + 0.8 + -0.8 + + + + + false + 0.0.0 + + + %%DATAPATH%%dials/default/lineardial-vertical.svg + 2 + 1 + Andale Mono,12,-1,5,75,0,0,0,0,0 + 0.5 + -0.5 + 1 + -1 + 1 + -1 + ManualControlCommand + Yaw + false + 0.8 + -0.8 + + + + + + + false + 0.0.0 + + + %%DATAPATH%%models/multi/aeroquad/aeroquad_+.3ds + %%DATAPATH%%models/backgrounds/default_background.png + false + + + + + false + 0.0.0 + + + %%DATAPATH%%models/multi/easy_quad/easy_quad_X.3ds + %%DATAPATH%%models/backgrounds/default_background.png + false + + + + + false + 0.0.0 + + + %%DATAPATH%%models/planes/Easystar/easystar.3ds + %%DATAPATH%%models/backgrounds/default_background.png + false + + + + + false + 0.0.0 + + + %%DATAPATH%%models/planes/firecracker/firecracker.3ds + %%DATAPATH%%models/backgrounds/default_background.png + false + + + + + false + 0.0.0 + + + %%DATAPATH%%models/planes/funjet/funjet.3ds + %%DATAPATH%%models/backgrounds/default_background.png + false + + + + + false + 0.0.0 + + + %%DATAPATH%%models/multi/gaui_330x/gaui_330x.3ds + %%DATAPATH%%models/backgrounds/default_background.png + false + + + + + false + 0.0.0 + + + %%DATAPATH%%models/helis/t-rex/t-rex_450_xl.3ds + %%DATAPATH%%models/backgrounds/default_background.png + false + + + + + false + 0.0.0 + + + %%DATAPATH%%models/multi/mikrokopter/MK_Hexa.3ds + %%DATAPATH%%models/backgrounds/default_background.png + false + + + + + false + 0.0.0 + + + %%DATAPATH%%models/multi/mikrokopter/MK_L4-ME.3ds + %%DATAPATH%%models/backgrounds/default_background.png + false + + + + + false + 0.0.0 + + + %%DATAPATH%%models/multi/scorpion_tricopter/scorpion_tricopter.3ds + %%DATAPATH%%models/backgrounds/default_background.png + false + + + + + false + 0.0.0 + + + %%DATAPATH%%models/multi/test_quad/test_quad_+.3ds + %%DATAPATH%%models/backgrounds/default_background.png + false + + + + + false + 0.0.0 + + + %%DATAPATH%%models/multi/test_quad/test_quad_X.3ds + %%DATAPATH%%models/backgrounds/default_background.png + false + + + + + + + false + 0.0.0 + + + ServerAndCache + %%STOREPATH%%mapscache/ + 0 + 0 + 2 + GoogleSatellite + 2000 + false + mapquad.png + true + false + + + + + false + 0.0.0 + + + CacheOnly + %%STOREPATH%%mapscache/ + 0 + 0 + 2 + GoogleMap + 2000 + false + airplanepip.png + true + false + + + + + false + 0.0.0 + + + ServerAndCache + %%STOREPATH%%mapscache/ + 0 + 0 + 2 + GoogleMap + 2000 + false + mapquad.png + true + false + + + + + + + false + 0.0.0 + + + false + %%DATAPATH%%pfd/default/pfd.svg + false + false + + + + + false + 0.0.0 + + + true + %%DATAPATH%%pfd/default/pfd.svg + false + false + + + + + + + false + 0.0.0 + + + + + + + false + 0.0.0 + + + false + false + + 1000 + 60 + + 4294901760 + accels-X + AttitudeRaw + 0 + 0 + 0 + + + 4283782655 + accels-Y + AttitudeRaw + 0 + 0 + 0 + + + 4283804160 + accels-Z + AttitudeRaw + 0 + 0 + 0 + + 3 + 1 + 100 + + + + + false + 0.0.0 + + + false + false + + 1000 + 20 + + 4294901760 + Channel-4 + ActuatorCommand + 0 + 0 + 0 + + + 4294901760 + Channel-5 + ActuatorCommand + 0 + 0 + 0 + + + 4289374847 + Channel-6 + ActuatorCommand + 0 + 0 + 0 + + + 4289374847 + Channel-7 + ActuatorCommand + 0 + 0 + 0 + + 4 + 1 + 100 + + + + + false + 0.0.0 + + + false + false + + 1000 + 60 + + 4283760895 + Roll + AttitudeActual + 0 + 0 + 0 + + + 4278233600 + Yaw + AttitudeActual + 0 + 0 + 0 + + + 4294901760 + Pitch + AttitudeActual + 0 + 0 + 0 + + 3 + 1 + 100 + + + + + false + 0.0.0 + + + false + false + + 1000 + 60 + + 4278190080 + Pressure + BaroAltitude + 0 + 0 + 0 + + 1 + 1 + 1000 + + + + + false + 0.0.0 + + + false + false + + 1000 + 40 + + 4278190207 + Channel-1 + ManualControlCommand + 0 + 0 + 0 + + + 4294901760 + Channel-4 + ManualControlCommand + 0 + 0 + 0 + + + 4294901760 + Channel-5 + ManualControlCommand + 0 + 0 + 0 + + + 4294901760 + Channel-6 + ManualControlCommand + 0 + 0 + 0 + + + 4294901760 + Channel-7 + ManualControlCommand + 0 + 0 + 0 + + + 4283825920 + Channel-2 + ManualControlCommand + 0 + 0 + 0 + + + 4294923520 + Channel-3 + ManualControlCommand + 0 + 0 + 0 + + + 4294967040 + Channel-0 + ManualControlCommand + 0 + 0 + 0 + + 8 + 1 + 200 + + + + + false + 0.0.0 + + + false + false + + 1000 + 60 + + 4294901760 + accels-X + AttitudeRaw + 0 + 0 + 0 + + + 4283782655 + accels-Y + AttitudeRaw + 0 + 0 + 0 + + + 4283804160 + accels-Z + AttitudeRaw + 0 + 0 + 0 + + 3 + 1 + 500 + + + + + false + 0.0.0 + + + false + false + + 1000 + 60 + + 4283804160 + gyros-Z + AttitudeRaw + 0 + 0 + 0 + + + 4283782655 + gyros-Y + AttitudeRaw + 0 + 0 + 0 + + + 4294901760 + gyros-X + AttitudeRaw + 0 + 0 + 0 + + 3 + 1 + 500 + + + + + false + 0.0.0 + + + false + false + + 1000 + 60 + + 4294901760 + magnetometers-X + AttitudeRaw + 0 + 0 + 0 + + + 4283782655 + magnetometers-Y + AttitudeRaw + 0 + 0 + 0 + + + 4283804160 + magnetometers-Z + AttitudeRaw + 0 + 0 + 0 + + 3 + 1 + 500 + + + + + false + 0.0.0 + + + false + false + + 1000 + 240 + + 4294945280 + StackRemaining-System + TaskInfo + 0 + 0 + 0 + + + 4294945280 + StackRemaining-Actuator + TaskInfo + 0 + 0 + 0 + + + 4294945280 + StackRemaining-Guidance + TaskInfo + 0 + 0 + 0 + + + 4294945280 + StackRemaining-Watchdog + TaskInfo + 0 + 0 + 0 + + + 4294945280 + StackRemaining-TelemetryTx + TaskInfo + 0 + 0 + 0 + + + 4294945280 + StackRemaining-TelemetryTxPri + TaskInfo + 0 + 0 + 0 + + + 4294945280 + StackRemaining-TelemetryRx + TaskInfo + 0 + 0 + 0 + + + 4294945280 + StackRemaining-GPS + TaskInfo + 0 + 0 + 0 + + + 4294945280 + StackRemaining-ManualControl + TaskInfo + 0 + 0 + 0 + + + 4294945280 + StackRemaining-Altitude + TaskInfo + 0 + 0 + 0 + + + 4294945280 + StackRemaining-AHRSComms + TaskInfo + 0 + 0 + 0 + + + 4294945280 + StackRemaining-Stabilization + TaskInfo + 0 + 0 + 0 + + 12 + 1 + 1000 + + + + + false + 0.0.0 + + + false + false + + 1000 + 20 + + 4289374847 + TxFailures + GCSTelemetryStats + 0 + 0 + 0 + + + 4283782655 + RxFailures + GCSTelemetryStats + 0 + 0 + 0 + + + 4294901760 + TxRetries + GCSTelemetryStats + 0 + 0 + 0 + + 3 + 1 + 100 + + + + + false + 0.0.0 + + + false + false + + 1000 + 240 + + 4289374847 + RunningTime + AhrsStatus + 0 + 0 + 0 + + + 4294945407 + FlightTime + SystemStats + 0 + 0 + 0 + + 2 + 1 + 800 + + + + + + + false + 0.0.0 + + + %%DATAPATH%%diagrams/default/system-health.svg + + + + + + + false + 0.0.0 + + + #5baa56 + #ff7957 + 500 + + + + + + + false + 0.0.0 + + + 3 + 0 + 0 + /dev/ttyS0 + 14 + 0 + + + + + false + 1.2.0 + + + + + false + + + + + + + LineardialGadget + + Flight Time + + uavGadget + + + LineardialGadget + + GPS Sats + + uavGadget + + 2 + @Variant(AAAACQAAAAA=) + splitter + + + + LineardialGadget + + Flight mode + + uavGadget + + + LineardialGadget + + Arm Status + + uavGadget + + 2 + @Variant(AAAACQAAAAA=) + splitter + + 2 + @Variant(AAAACQAAAAIAAAACAAAA1wAAAAIAAADt) + splitter + + + PFDGadget + + raw + + uavGadget + + 1 + @Variant(AAAACQAAAAIAAAACAAAAkAAAAAIAAAJg) + splitter + + + + ModelViewGadget + + Test Quad X + + uavGadget + + + + + SystemHealthGadget + + default + + uavGadget + + + + LineardialGadget + + Mainboard CPU + + uavGadget + + + LineardialGadget + + AHRS CPU + + uavGadget + + 1 + @Variant(AAAACQAAAAIAAAACAAAAQAAAAAIAAABA) + splitter + + 1 + @Variant(AAAACQAAAAIAAAACAAABIwAAAAIAAACN) + splitter + + + + LineardialGadget + + Telemetry RX Rate Horizontal + + uavGadget + + + LineardialGadget + + Telemetry TX Rate Horizontal + + uavGadget + + 1 + @Variant(AAAACQAAAAA=) + splitter + + 2 + @Variant(AAAACQAAAAIAAAACAAABJQAAAAIAAABA) + splitter + + 1 + @Variant(AAAACQAAAAIAAAACAAABMAAAAAIAAAGx) + splitter + + 2 + @Variant(AAAACQAAAAIAAAACAAABxQAAAAIAAAFH) + splitter + + + + OPMapGadget + + Google Sat + + uavGadget + + + + + + + DialGadget + + Deluxe Groundspeed kph + + uavGadget + + + DialGadget + + Deluxe Barometer + + uavGadget + + 2 + @Variant(AAAACQAAAAA=) + splitter + + + + DialGadget + + Deluxe Attitude + + uavGadget + + + DialGadget + + Deluxe Compass + + uavGadget + + 2 + @Variant(AAAACQAAAAA=) + splitter + + 1 + @Variant(AAAACQAAAAIAAAACAAAAgwAAAAIAAACK) + splitter + + + + DialGadget + + Deluxe Baro Altimeter + + uavGadget + + + DialGadget + + Deluxe Climbrate + + uavGadget + + 2 + @Variant(AAAACQAAAAA=) + splitter + + 1 + @Variant(AAAACQAAAAIAAAACAAABFQAAAAIAAACH) + splitter + + + + LineardialGadget + + Throttle + + uavGadget + + + + LineardialGadget + + Roll Desired + + uavGadget + + + + LineardialGadget + + Pitch Desired + + uavGadget + + + LineardialGadget + + Yaw Desired + + uavGadget + + 1 + @Variant(AAAACQAAAAIAAAACAAAAQAAAAAIAAAE3) + splitter + + 1 + @Variant(AAAACQAAAAIAAAACAAAAQAAAAAIAAAF4) + splitter + + 1 + @Variant(AAAACQAAAAIAAAACAAAAQAAAAAIAAAG5) + splitter + + 1 + @Variant(AAAACQAAAAIAAAACAAABuQAAAAIAAAED) + splitter + + 2 + @Variant(AAAACQAAAAIAAAACAAAB7AAAAAIAAAEg) + splitter + + 1 + @Variant(AAAACQAAAAIAAAACAAAC4gAAAAIAAAK9) + splitter + + UAVGadgetManagerV1 + + + false + + + + ConfigGadget + + default + + uavGadget + + + + LineardialGadget + + Telemetry RX Rate Horizontal + + uavGadget + + + LineardialGadget + + Telemetry TX Rate Horizontal + + uavGadget + + 1 + @Variant(AAAACQAAAAA=) + splitter + + 2 + @Variant(AAAACQAAAAIAAAACAAACNQAAAAIAAABC) + splitter + + + + UAVObjectBrowser + + default + + uavGadget + + + GCSControlGadget + + MS Sidewinder + + uavGadget + + 2 + @Variant(AAAACQAAAAIAAAACAAABqgAAAAIAAAFi) + splitter + + 1 + @Variant(AAAACQAAAAIAAAACAAAC3gAAAAIAAAJ3) + splitter + + UAVGadgetManagerV1 + + + false + + + OPMapGadget + + default + + uavGadget + + + + ModelViewGadget + + Test Quad X + + uavGadget + + + + DialGadget + + Attitude + + uavGadget + + + DialGadget + + Compass + + uavGadget + + 1 + @Variant(AAAACQAAAAA=) + splitter + + 2 + @Variant(AAAACQAAAAIAAAACAAABiwAAAAIAAADs) + splitter + + 1 + @Variant(AAAACQAAAAIAAAACAAAD1AAAAAIAAAGB) + splitter + + UAVGadgetManagerV1 + + + false + + + + ScopeGadget + + Accel + + uavGadget + + + ScopeGadget + + Raw Gyros + + uavGadget + + 2 + @Variant(AAAACQAAAAA=) + splitter + + + + + ScopeGadget + + Attitude + + uavGadget + + + ScopeGadget + + Uptimes + + uavGadget + + 2 + @Variant(AAAACQAAAAIAAAACAAABhgAAAAIAAAEO) + splitter + + + LoggingGadget + uavGadget + + 2 + @Variant(AAAACQAAAAIAAAACAAAClQAAAAIAAAB3) + splitter + + 1 + @Variant(AAAACQAAAAIAAAACAAACjQAAAAIAAAKU) + splitter + + UAVGadgetManagerV1 + + + false + + + + HITL + + XPlane HITL + + uavGadget + + + + GCSControlGadget + + MS Sidewinder + + uavGadget + + + + + LineardialGadget + + Pitch Desired + + uavGadget + + + LineardialGadget + + PitchActual + + uavGadget + + 1 + @Variant(AAAACQAAAAA=) + splitter + + + LineardialGadget + + Pitch + + uavGadget + + 1 + @Variant(AAAACQAAAAIAAAACAAABFAAAAAIAAABA) + splitter + + 1 + @Variant(AAAACQAAAAIAAAACAAAB6AAAAAIAAADC) + splitter + + 2 + @Variant(AAAACQAAAAIAAAACAAABaQAAAAIAAAEO) + splitter + + + UAVObjectBrowser + + default + + uavGadget + + 1 + @Variant(AAAACQAAAAIAAAACAAADDAAAAAIAAAJJ) + splitter + + UAVGadgetManagerV1 + + + false + + + Uploader + + default + + uavGadget + + + + + SystemHealthGadget + + default + + uavGadget + + + PFDGadget + + raw + + uavGadget + + 1 + @Variant(AAAACQAAAAIAAAACAAABQgAAAAIAAAGM) + splitter + + + ScopeGadget + + Uptimes + + uavGadget + + 2 + @Variant(AAAACQAAAAIAAAACAAABEgAAAAIAAAH6) + splitter + + 1 + @Variant(AAAACQAAAAA=) + splitter + + UAVGadgetManagerV1 + + + @ByteArray(AAAA/wAAAAD9AAAAAAAABQAAAALCAAAABAAAAAQAAAABAAAACPwAAAAA) + + :/core/images/ah.png + :/core/images/openpilot_logo_64.png + :/core/images/config.png + :/core/images/world.png + :/core/images/scopes.png + :/core/images/joystick.png + :/core/images/cog.png + :/core/images/openpilot_logo_64.png + :/core/images/openpilot_logo_64.png + :/core/images/openpilot_logo_64.png + 6 + Flight data + Workspace10 + Configuration + Flight Planner + Scopes + HITL + Firmware + Workspace7 + Workspace8 + Workspace9 + + diff --git a/ground/openpilotgcs/src/plugins/coreplugin/core.qrc b/ground/openpilotgcs/src/plugins/coreplugin/core.qrc index 917018476..c1b0f8e36 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/core.qrc +++ b/ground/openpilotgcs/src/plugins/coreplugin/core.qrc @@ -50,7 +50,6 @@ images/optionsicon.png images/helpicon.png images/openpiloticon.png - OpenPilotGCS.ini CREDITS.html images/ah.png images/config.png @@ -60,5 +59,7 @@ images/scopes.png images/world.png images/cog.png + OpenPilotGCS.xml + images/helpicon.svg diff --git a/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro b/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro index 8112438ed..70ac509e8 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro +++ b/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro @@ -141,3 +141,5 @@ unix:!macx { INSTALLS += images } OTHER_FILES += Core.pluginspec + +include(gcsversioninfo.pri) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/dialogs/ioptionspage.h b/ground/openpilotgcs/src/plugins/coreplugin/dialogs/ioptionspage.h index 1f470b97c..21a299508 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/dialogs/ioptionspage.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/dialogs/ioptionspage.h @@ -32,6 +32,7 @@ #include #include +#include QT_BEGIN_NAMESPACE class QWidget; @@ -43,9 +44,14 @@ class CORE_EXPORT IOptionsPage : public QObject { Q_OBJECT public: - IOptionsPage(QObject *parent = 0) : QObject(parent) {} + IOptionsPage(QObject *parent = 0) : + QObject(parent), + m_icon(QIcon()) {} virtual ~IOptionsPage() {} + void setIcon(QIcon icon) { m_icon = icon; } + QIcon icon() { return m_icon; } + /* gadget options pages can leave these 4 functions as is, since they are decorated by UAVGadgetOptionsPageDecorator, all other options pages must override these */ @@ -57,6 +63,8 @@ public: virtual QWidget *createPage(QWidget *parent) = 0; virtual void apply() = 0; virtual void finish() = 0; +private: + QIcon m_icon; }; } // namespace Core diff --git a/ground/openpilotgcs/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/ground/openpilotgcs/src/plugins/coreplugin/dialogs/settingsdialog.cpp index e32f013f7..413cdb63b 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -59,10 +59,13 @@ bool optionsPageLessThan(const IOptionsPage *p1, const IOptionsPage *p2) const UAVGadgetOptionsPageDecorator *gp2 = qobject_cast(p2); if (gp1 && (gp2 == NULL)) return false; + if (gp2 && (gp1 == NULL)) return true; + if (const int cc = QString::localeAwareCompare(p1->trCategory(), p2->trCategory())) return cc < 0; + return QString::localeAwareCompare(p1->trName(), p2->trName()) < 0; } @@ -97,6 +100,7 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &categoryId, } if (m_windowWidth > 0 && m_windowHeight > 0) resize(m_windowWidth, m_windowHeight); + buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); connect(buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply())); @@ -105,10 +109,12 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &categoryId, connect(this, SIGNAL(settingsDialogShown(Core::Internal::SettingsDialog*)), m_instanceManager, SLOT(settingsDialogShown(Core::Internal::SettingsDialog*))); connect(this, SIGNAL(settingsDialogRemoved()), m_instanceManager, SLOT(settingsDialogRemoved())); + connect(this, SIGNAL(categoryItemSelected()), this, SLOT(categoryItemSelectedShowChildInstead()), Qt::QueuedConnection); splitter->setCollapsible(0, false); splitter->setCollapsible(1, false); pageTree->header()->setVisible(false); +// pageTree->setIconSize(QSize(24, 24)); connect(pageTree, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(pageSelected())); @@ -129,44 +135,34 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &categoryId, item->setText(0, page->trName()); item->setData(0, Qt::UserRole, qVariantFromValue(pageData)); - QStringList categoriesId = page->category().split(QLatin1Char('|')); - QStringList trCategories = page->trCategory().split(QLatin1Char('|')); - QString currentCategory = categoriesId.at(0); + QString trCategories = page->trCategory(); + QString currentCategory = page->category(); - QTreeWidgetItem *treeitem; + QTreeWidgetItem *categoryItem; if (!categories.contains(currentCategory)) { - if (!firstUavGadgetOptionsPageFound) - { + // Above the first gadget option we insert a separator + if (!firstUavGadgetOptionsPageFound) { UAVGadgetOptionsPageDecorator *pd = qobject_cast(page); - if (pd) - { + if (pd) { firstUavGadgetOptionsPageFound = true; QTreeWidgetItem *separator = new QTreeWidgetItem(pageTree); - separator->setFlags(item->flags() & ~Qt::ItemIsSelectable & ~Qt::ItemIsEnabled); + separator->setFlags(separator->flags() & ~Qt::ItemIsSelectable & ~Qt::ItemIsEnabled); separator->setText(0, QString(30, 0xB7)); } } - treeitem = new QTreeWidgetItem(pageTree); - treeitem->setText(0, trCategories.at(0)); - treeitem->setData(0, Qt::UserRole, qVariantFromValue(pageData)); - categories.insert(currentCategory, treeitem); + categoryItem = new QTreeWidgetItem(pageTree); + categoryItem->setIcon(0, page->icon()); + categoryItem->setText(0, trCategories); + categoryItem->setData(0, Qt::UserRole, qVariantFromValue(pageData)); + categories.insert(currentCategory, categoryItem); } - int catCount = 1; - while (catCount < categoriesId.count()) { - if (!categories.contains(currentCategory + QLatin1Char('|') + categoriesId.at(catCount))) { - treeitem = new QTreeWidgetItem(categories.value(currentCategory)); - currentCategory += QLatin1Char('|') + categoriesId.at(catCount); - treeitem->setText(0, trCategories.at(catCount)); - treeitem->setData(0, Qt::UserRole, qVariantFromValue(pageData)); - categories.insert(currentCategory, treeitem); - } else { - currentCategory += QLatin1Char('|') + categoriesId.at(catCount); - } - ++catCount; + QList *categoryItemList = m_categoryItemsMap.value(currentCategory); + if (!categoryItemList) { + categoryItemList = new QList(); + m_categoryItemsMap.insert(currentCategory, categoryItemList); } - - categories.value(currentCategory)->addChild(item); + categoryItemList->append(item); m_pages.append(page); stackedPages->addWidget(page->createPage(stackedPages)); @@ -179,6 +175,16 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &categoryId, index++; } + foreach(QString category, m_categoryItemsMap.keys()) { + QList *categoryItemList = m_categoryItemsMap.value(category); + if (categoryItemList->size() > 1) { + foreach (QTreeWidgetItem *item, *categoryItemList) { + QTreeWidgetItem *categoryItem = categories.value(category); + categoryItem->addChild(item); + } + } + } + QList sizes; sizes << 150 << 300; splitter->setSizes(sizes); @@ -189,22 +195,49 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &categoryId, SettingsDialog::~SettingsDialog() { + foreach(QString category, m_categoryItemsMap.keys()) { + QList *categoryItemList = m_categoryItemsMap.value(category); + delete categoryItemList; + } } void SettingsDialog::pageSelected() { QTreeWidgetItem *item = pageTree->currentItem(); + if (!item) + return; + PageData data = item->data(0, Qt::UserRole).value(); int index = data.index; m_currentCategory = data.category; m_currentPage = data.id; stackedPages->setCurrentIndex(index); + // If user selects a toplevel item, select the first child for them + // I.e. Top level items are not really selectable + if ((pageTree->indexOfTopLevelItem(item) >= 0) && (item->childCount() > 0)) { + emit categoryItemSelected(); + } +} + +void SettingsDialog::categoryItemSelectedShowChildInstead() +{ + QTreeWidgetItem *item = pageTree->currentItem(); + item->setExpanded(true); + pageTree->setCurrentItem(item->child(0), 0, QItemSelectionModel::SelectCurrent); } void SettingsDialog::deletePage() { QTreeWidgetItem *item = pageTree->currentItem(); - item->parent()->removeChild(item); + PageData data = item->data(0, Qt::UserRole).value(); + QString category = data.category; + QList *categoryItemList = m_categoryItemsMap.value(category); + QTreeWidgetItem *parentItem = item->parent(); + parentItem->removeChild(item); + categoryItemList->removeOne(item); + if (parentItem->childCount() == 1) { + parentItem->removeChild(parentItem->child(0)); + } pageSelected(); } @@ -227,11 +260,20 @@ void SettingsDialog::insertPage(IOptionsPage* page) if (!categoryItem) return; + // If this category has no child right now + // we need to add the "default child" + QList *categoryItemList = m_categoryItemsMap.value(page->category()); + if (categoryItem->childCount() == 0) { + QTreeWidgetItem *defaultItem = categoryItemList->at(0); + categoryItem->addChild(defaultItem); + } + QTreeWidgetItem *item = new QTreeWidgetItem; item->setText(0, page->trName()); item->setData(0, Qt::UserRole, qVariantFromValue(pageData)); categoryItem->addChild(item); + categoryItemList->append(item); m_pages.append(page); stackedPages->addWidget(page->createPage(stackedPages)); @@ -256,7 +298,7 @@ void SettingsDialog::accept() { m_applied = true; foreach (IOptionsPage *page, m_pages) { - page->apply(); + page->apply(); page->finish(); } done(QDialog::Accepted); @@ -266,14 +308,15 @@ void SettingsDialog::reject() { foreach (IOptionsPage *page, m_pages) page->finish(); + done(QDialog::Rejected); } void SettingsDialog::apply() { - foreach (IOptionsPage *page, m_pages) { - page->apply(); - } + foreach (IOptionsPage *page, m_pages) + page->apply(); + m_applied = true; } diff --git a/ground/openpilotgcs/src/plugins/coreplugin/dialogs/settingsdialog.h b/ground/openpilotgcs/src/plugins/coreplugin/dialogs/settingsdialog.h index 4a5f161f8..3000084a2 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/dialogs/settingsdialog.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/dialogs/settingsdialog.h @@ -62,6 +62,7 @@ public: signals: void settingsDialogShown(Core::Internal::SettingsDialog*); void settingsDialogRemoved(); + void categoryItemSelected(); public slots: void done(int); @@ -71,9 +72,13 @@ private slots: void accept(); void reject(); void apply(); + void categoryItemSelectedShowChildInstead(); + private: + QList m_pages; + QMap *> m_categoryItemsMap; UAVGadgetInstanceManager *m_instanceManager; bool m_applied; QString m_currentCategory; diff --git a/ground/openpilotgcs/src/plugins/coreplugin/gcsversioninfo.pri b/ground/openpilotgcs/src/plugins/coreplugin/gcsversioninfo.pri new file mode 100644 index 000000000..559dc3528 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/coreplugin/gcsversioninfo.pri @@ -0,0 +1,35 @@ +# +# This qmake file generates a header with the GCS version info string. +# +# This is a bit tricky since the script should be run always and before +# the other dependencies evaluation. +# + +# Since debug_and_release option is set, we need this +!debug_and_release|build_pass { + ROOT_DIR = $$GCS_SOURCE_TREE/../.. + VERSION_INFO_HEADER = $$GCS_BUILD_TREE/gcsversioninfo.h + VERSION_INFO_SCRIPT = $$ROOT_DIR/make/scripts/version-info.py + VERSION_INFO_TEMPLATE = $$ROOT_DIR/make/templates/gcsversioninfotemplate.h + VERSION_INFO_COMMAND = python \"$$VERSION_INFO_SCRIPT\" + + # Create custom version_info target which generates a header + version_info.target = $$VERSION_INFO_HEADER + version_info.commands = $$VERSION_INFO_COMMAND \ + --path=\"$$GCS_SOURCE_TREE\" \ + --template=\"$$VERSION_INFO_TEMPLATE\" \ + --outfile=\"$$VERSION_INFO_HEADER\" + version_info.depends = FORCE + QMAKE_EXTRA_TARGETS += version_info + + # Hook version_info target in between qmake's Makefile update and + # the actual project target + version_info_hook.depends = version_info + debug_and_release { + CONFIG(debug,debug|release):version_info_hook.target = Makefile.Debug + CONFIG(release,debug|release):version_info_hook.target = Makefile.Release + } else { + version_info_hook.target = Makefile + } + QMAKE_EXTRA_TARGETS += version_info_hook +} diff --git a/ground/openpilotgcs/src/plugins/coreplugin/images/helpicon.svg b/ground/openpilotgcs/src/plugins/coreplugin/images/helpicon.svg new file mode 100644 index 000000000..620acb6ae --- /dev/null +++ b/ground/openpilotgcs/src/plugins/coreplugin/images/helpicon.svg @@ -0,0 +1,37 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ground/openpilotgcs/src/plugins/coreplugin/iuavgadgetfactory.h b/ground/openpilotgcs/src/plugins/coreplugin/iuavgadgetfactory.h index 96fed8b28..5b8029241 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/iuavgadgetfactory.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/iuavgadgetfactory.h @@ -31,6 +31,7 @@ #include "core_global.h" #include +#include #include #include "uavconfiginfo.h" @@ -51,7 +52,9 @@ public: IUAVGadgetFactory(QString classId, QString name, QObject *parent = 0) : QObject(parent), m_classId(classId), - m_name(name) {} + m_name(name), + m_icon(QIcon()), + m_singleConfigurationGadget(false) {} virtual ~IUAVGadgetFactory() {} virtual IUAVGadget *createGadget(QWidget *parent) = 0; @@ -60,9 +63,16 @@ public: virtual IOptionsPage *createOptionsPage(IUAVGadgetConfiguration */*config*/) { return 0; } QString classId() const { return m_classId; } QString name() const { return m_name; } + QIcon icon() const { return m_icon; } + bool isSingleConfigurationGadget() { return m_singleConfigurationGadget; } +protected: + void setIcon(QIcon icon) { m_icon = icon; } + void setSingleConfigurationGadgetTrue() { m_singleConfigurationGadget = true; } private: QString m_classId; // unique class id QString m_name; // display name, should also be unique + QIcon m_icon; + bool m_singleConfigurationGadget; // true if there is exactly one configuration for this gadget }; } // namespace Core diff --git a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp index b18938f71..5926e6c98 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp @@ -30,6 +30,7 @@ #include "actioncontainer.h" #include "actionmanager_p.h" #include "basemode.h" +#include "connectionmanager.h" #include "coreimpl.h" #include "coreconstants.h" #include "fancytabwidget.h" @@ -39,35 +40,34 @@ #include "mimedatabase.h" #include "outputpane.h" #include "plugindialog.h" +#include "qxtlogger.h" +#include "qxtbasicstdloggerengine.h" #include "shortcutsettings.h" -#include "workspacesettings.h" -#include "modemanager.h" #include "uavgadgetmode.h" #include "uavgadgetmanager.h" #include "uavgadgetinstancemanager.h" -#include "connectionmanager.h" -#include "qxtlogger.h" -#include "qxtbasicstdloggerengine.h" +#include "workspacesettings.h" -#include "settingsdialog.h" -#include "variablemanager.h" -#include "threadmanager.h" -#include "versiondialog.h" #include "authorsdialog.h" -#include "viewmanager.h" -#include "uniqueidmanager.h" -#include "manhattanstyle.h" -#include "dialogs/iwizard.h" -#include "rightpane.h" #include "baseview.h" #include "ioutputpane.h" #include "icorelistener.h" #include "iconfigurableplugin.h" +#include "manhattanstyle.h" +#include "rightpane.h" +#include "settingsdialog.h" +#include "threadmanager.h" +#include "uniqueidmanager.h" +#include "variablemanager.h" +#include "versiondialog.h" +#include "viewmanager.h" #include +#include +#include "dialogs/iwizard.h" #include #include -#include +#include #include #include @@ -112,9 +112,9 @@ MainWindow::MainWindow() : m_globalContext(QList() << Constants::C_GLOBAL_ID), m_additionalContexts(m_globalContext), // keep this in sync with main() in app/main.cpp - m_settings(new QSettings(QSettings::IniFormat, QSettings::UserScope, + m_settings(new QSettings(XmlConfig::XmlSettingsFormat, QSettings::UserScope, QLatin1String("OpenPilot"), QLatin1String("OpenPilotGCS"), this)), - m_globalSettings(new QSettings(QSettings::IniFormat, QSettings::SystemScope, + m_globalSettings(new QSettings(XmlConfig::XmlSettingsFormat, QSettings::SystemScope, QLatin1String("OpenPilot"), QLatin1String("OpenPilotGCS"), this)), m_settingsDatabase(new SettingsDatabase(QFileInfo(m_settings->fileName()).path(), QLatin1String("OpenPilotGCS"), @@ -155,7 +155,7 @@ MainWindow::MainWindow() : QCoreApplication::setApplicationVersion(QLatin1String(Core::Constants::GCS_VERSION_LONG)); QCoreApplication::setOrganizationName(QLatin1String("OpenPilot")); QCoreApplication::setOrganizationDomain(QLatin1String("openpilot.org")); - QSettings::setDefaultFormat(QSettings::IniFormat); + QSettings::setDefaultFormat(XmlConfig::XmlSettingsFormat); QString baseName = qApp->style()->objectName(); #ifdef Q_WS_X11 if (baseName == QLatin1String("windows")) { @@ -284,7 +284,8 @@ void MainWindow::extensionsInitialized() { QSettings* qs = m_settings; - QSettings defaultSettings(":/core/OpenPilotGCS.ini", QSettings::IniFormat); + QSettings defaultSettings(":/core/OpenPilotGCS.xml", XmlConfig::XmlSettingsFormat); +// QSettings defaultSettings(":/core/OpenPilotGCS.ini", QSettings::IniFormat); if ( ! qs->allKeys().count() ){ QMessageBox msgBox; @@ -293,7 +294,7 @@ void MainWindow::extensionsInitialized() msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); msgBox.setDefaultButton(QMessageBox::Yes); if ( msgBox.exec() == QMessageBox::Yes ){ - qDebug() << "Load default config from resource /core/OpenPilotGCS.ini"; + qDebug() << "Load default config from resource /core/OpenPilotGCS.xml"; qs = &defaultSettings; } } diff --git a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp index f93e5cb60..55dc239a8 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp @@ -56,7 +56,9 @@ UAVGadgetInstanceManager::UAVGadgetInstanceManager(QObject *parent) : m_factories.append(f); QString classId = f->classId(); QString name = f->name(); - m_classIds.insert(classId, name); + QIcon icon = f->icon(); + m_classIdNameMap.insert(classId, name); + m_classIdIconMap.insert(classId, icon); } } } @@ -108,7 +110,7 @@ void UAVGadgetInstanceManager::readConfigs_1_2_0(QSettings *qs) { UAVConfigInfo configInfo; - foreach (QString classId, m_classIds.keys()) + foreach (QString classId, m_classIdNameMap.keys()) { IUAVGadgetFactory *f = factory(classId); qs->beginGroup(classId); @@ -159,7 +161,7 @@ void UAVGadgetInstanceManager::readConfigs_1_1_0(QSettings *qs) { UAVConfigInfo configInfo; - foreach (QString classId, m_classIds.keys()) + foreach (QString classId, m_classIdNameMap.keys()) { IUAVGadgetFactory *f = factory(classId); qs->beginGroup(classId); @@ -242,7 +244,8 @@ void UAVGadgetInstanceManager::createOptionsPages() IUAVGadgetFactory *f = factory(config->classId()); IOptionsPage *p = f->createOptionsPage(config); if (p) { - IOptionsPage *page = new UAVGadgetOptionsPageDecorator(p, config); + IOptionsPage *page = new UAVGadgetOptionsPageDecorator(p, config, f->isSingleConfigurationGadget()); + page->setIcon(f->icon()); m_optionsPages.append(page); m_pm->addObject(page); } @@ -334,6 +337,7 @@ void UAVGadgetInstanceManager::cloneConfiguration(IUAVGadgetConfiguration *conf IUAVGadgetFactory *f = factory(config->classId()); IOptionsPage *p = f->createOptionsPage(config); IOptionsPage *page = new UAVGadgetOptionsPageDecorator(p, config); + page->setIcon(f->icon()); m_provisionalConfigs.append(config); m_provisionalOptionsPages.append(page); m_settingsDialog->insertPage(page); @@ -452,7 +456,12 @@ QStringList UAVGadgetInstanceManager::configurationNames(QString classId) const QString UAVGadgetInstanceManager::gadgetName(QString classId) const { - return m_classIds.value(classId); + return m_classIdNameMap.value(classId); +} + +QIcon UAVGadgetInstanceManager::gadgetIcon(QString classId) const +{ + return m_classIdIconMap.value(classId); } IUAVGadgetFactory *UAVGadgetInstanceManager::factory(QString classId) const diff --git a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.h b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.h index 1b8f574ee..fab30f284 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.h @@ -32,6 +32,7 @@ #include #include #include +#include #include "core_global.h" #include "uavconfiginfo.h" @@ -68,9 +69,10 @@ public: void cloneConfiguration(IUAVGadgetConfiguration *config); void applyChanges(IUAVGadgetConfiguration *config); void configurationNameEdited(QString text, bool hasText = true); - QStringList classIds() const { return m_classIds.keys(); } + QStringList classIds() const { return m_classIdNameMap.keys(); } QStringList configurationNames(QString classId) const; QString gadgetName(QString classId) const; + QIcon gadgetIcon(QString classId) const; signals: void configurationChanged(IUAVGadgetConfiguration* config); @@ -91,7 +93,8 @@ private: QList m_factories; QList m_configurations; QList m_optionsPages; - QMap m_classIds; + QMap m_classIdNameMap; + QMap m_classIdIconMap; QMap m_takenNames; QList m_provisionalConfigs; QList m_provisionalDeletes; diff --git a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetmanager/uavgadgetview.cpp b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetmanager/uavgadgetview.cpp index a86b52d17..13b2b3062 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetmanager/uavgadgetview.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetmanager/uavgadgetview.cpp @@ -91,6 +91,7 @@ UAVGadgetView::UAVGadgetView(Core::UAVGadgetManager *uavGadgetManager, IUAVGadge m_defaultIndex = 0; startFromOne = true; m_uavGadgetList->insertItem(0, im->gadgetName(classId), classId); + m_uavGadgetList->setItemIcon(0, im->gadgetIcon(classId)); m_uavGadgetList->insertSeparator(1); } else { @@ -101,6 +102,7 @@ UAVGadgetView::UAVGadgetView(Core::UAVGadgetManager *uavGadgetManager, IUAVGadge break; } m_uavGadgetList->insertItem(i, im->gadgetName(classId), classId); + m_uavGadgetList->setItemIcon(i, im->gadgetIcon(classId)); } ++index; } diff --git a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetoptionspagedecorator.cpp b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetoptionspagedecorator.cpp index d5fc1b054..f95f7e4c1 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetoptionspagedecorator.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetoptionspagedecorator.cpp @@ -34,10 +34,12 @@ using namespace Core; -UAVGadgetOptionsPageDecorator::UAVGadgetOptionsPageDecorator(IOptionsPage *page, IUAVGadgetConfiguration *config, QObject *parent) : +UAVGadgetOptionsPageDecorator::UAVGadgetOptionsPageDecorator(IOptionsPage *page, IUAVGadgetConfiguration *config, + bool isSingleConfigurationGadget, QObject *parent) : Core::IOptionsPage(parent), m_optionsPage(page), m_config(config), + m_isSingleConfigurationGadget(isSingleConfigurationGadget), m_id(config->name()), m_category(config->classId()) { @@ -65,6 +67,11 @@ QWidget *UAVGadgetOptionsPageDecorator::createPage(QWidget *parent) wi->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); m_page->verticalLayout_4->addWidget(wi); + // For some gadgets it might not make sense to have multiple configurations + if (m_isSingleConfigurationGadget) { + m_page->configurationBox->hide(); + } + connect(m_page->cloneButton, SIGNAL(clicked()), this, SLOT(cloneConfiguration())); connect(m_page->deleteButton, SIGNAL(clicked()), this, SLOT(deleteConfiguration())); connect(m_page->nameLineEdit, SIGNAL(textEdited(QString)), this, SLOT(textEdited(QString))); diff --git a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetoptionspagedecorator.h b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetoptionspagedecorator.h index 919a8c510..14ec5bf39 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetoptionspagedecorator.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetoptionspagedecorator.h @@ -43,7 +43,7 @@ class CORE_EXPORT UAVGadgetOptionsPageDecorator : public Core::IOptionsPage { Q_OBJECT public: - explicit UAVGadgetOptionsPageDecorator(IOptionsPage *page, IUAVGadgetConfiguration *config, QObject *parent = 0); + explicit UAVGadgetOptionsPageDecorator(IOptionsPage *page, IUAVGadgetConfiguration *config, bool isSingleConfigurationGadget = false, QObject *parent = 0); QString id() const { return m_id; } QString trName() const { return m_id; } @@ -66,6 +66,7 @@ private slots: private: IOptionsPage *m_optionsPage; IUAVGadgetConfiguration *m_config; + bool m_isSingleConfigurationGadget; UAVGadgetInstanceManager *m_instanceManager; QString m_id; QString m_category; diff --git a/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.cpp b/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.cpp index cd4200765..aa8239f6e 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.cpp @@ -65,7 +65,7 @@ VersionDialog::VersionDialog(QWidget *parent) QString ideRev; #ifdef GCS_REVISION //: This gets conditionally inserted as argument %8 into the description string. - ideRev = tr("From revision %1
").arg(QString::fromLatin1(GCS_REVISION_STR).left(10)); + ideRev = tr("From revision %1
").arg(QString::fromLatin1(GCS_REVISION_STR).left(60)); #endif const QString description = tr( diff --git a/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.h b/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.h index 1293e7313..ab6ec24d2 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.h @@ -29,6 +29,9 @@ #ifndef VERSIONDIALOG_H #define VERSIONDIALOG_H +// autogenerated version info string +#include "../../../../../build/ground/openpilotgcs/gcsversioninfo.h" + #include namespace Core { diff --git a/ground/openpilotgcs/src/plugins/dial/dialgadgetfactory.cpp b/ground/openpilotgcs/src/plugins/dial/dialgadgetfactory.cpp index c267b4ee3..88cb6a024 100644 --- a/ground/openpilotgcs/src/plugins/dial/dialgadgetfactory.cpp +++ b/ground/openpilotgcs/src/plugins/dial/dialgadgetfactory.cpp @@ -34,7 +34,7 @@ DialGadgetFactory::DialGadgetFactory(QObject *parent) : IUAVGadgetFactory(QString("DialGadget"), - tr("Analog Dial Gadget"), + tr("Analog Dial"), parent) { } diff --git a/ground/openpilotgcs/src/plugins/gpsdisplay/gpsdisplaygadgetfactory.cpp b/ground/openpilotgcs/src/plugins/gpsdisplay/gpsdisplaygadgetfactory.cpp index 673891a16..e87290cba 100644 --- a/ground/openpilotgcs/src/plugins/gpsdisplay/gpsdisplaygadgetfactory.cpp +++ b/ground/openpilotgcs/src/plugins/gpsdisplay/gpsdisplaygadgetfactory.cpp @@ -33,7 +33,7 @@ GpsDisplayGadgetFactory::GpsDisplayGadgetFactory(QObject *parent) : IUAVGadgetFactory(QString("GpsDisplayGadget"), - tr("GPS Display Gadget"), + tr("GPS Display"), parent) { } diff --git a/ground/openpilotgcs/src/plugins/importexport/importexport.pro b/ground/openpilotgcs/src/plugins/importexport/importexport.pro index e3ae374a9..0d5d2778d 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexport.pro +++ b/ground/openpilotgcs/src/plugins/importexport/importexport.pro @@ -6,16 +6,14 @@ include(../../openpilotgcsplugin.pri) include(importexport_dependencies.pri) HEADERS += importexportplugin.h \ importexportgadgetwidget.h \ - importexportdialog.h \ - xmlconfig.h + importexportdialog.h HEADERS += importexportgadget.h HEADERS += importexportgadgetfactory.h HEADERS += importexportgadgetconfiguration.h HEADERS += importexportgadgetoptionspage.h SOURCES += importexportplugin.cpp \ importexportgadgetwidget.cpp \ - importexportdialog.cpp \ - xmlconfig.cpp + importexportdialog.cpp SOURCES += importexportgadget.cpp SOURCES += importexportgadgetfactory.cpp SOURCES += importexportgadgetconfiguration.cpp diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.cpp index da8a284af..eda567bde 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.cpp @@ -28,7 +28,7 @@ */ #include "importexportgadgetwidget.h" #include "ui_importexportgadgetwidget.h" -#include "xmlconfig.h" +#include "utils/xmlconfig.h" #include "coreplugin/uavgadgetinstancemanager.h" #include "coreplugin/icore.h" #include diff --git a/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetfactory.cpp b/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetfactory.cpp index 33f6e0421..9e79256d3 100644 --- a/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetfactory.cpp +++ b/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetfactory.cpp @@ -33,7 +33,7 @@ LineardialGadgetFactory::LineardialGadgetFactory(QObject *parent) : IUAVGadgetFactory(QString("LineardialGadget"), - tr("Bargraph Dial Gadget"), + tr("Bargraph Dial"), parent) { } diff --git a/ground/openpilotgcs/src/plugins/modelview/modelviewgadgetfactory.cpp b/ground/openpilotgcs/src/plugins/modelview/modelviewgadgetfactory.cpp index a87bbbe75..090c6cc70 100644 --- a/ground/openpilotgcs/src/plugins/modelview/modelviewgadgetfactory.cpp +++ b/ground/openpilotgcs/src/plugins/modelview/modelviewgadgetfactory.cpp @@ -33,7 +33,7 @@ #include ModelViewGadgetFactory::ModelViewGadgetFactory(QObject *parent) : - IUAVGadgetFactory(QString("ModelViewGadget"), tr("ModelView Gadget"), parent) + IUAVGadgetFactory(QString("ModelViewGadget"), tr("ModelView"), parent) { } diff --git a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetfactory.cpp b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetfactory.cpp index fa60d10f0..5a3908c89 100644 --- a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetfactory.cpp +++ b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetfactory.cpp @@ -32,7 +32,7 @@ #include OPMapGadgetFactory::OPMapGadgetFactory(QObject *parent) : - IUAVGadgetFactory(QString("OPMapGadget"), tr("OPMap Gadget"), parent) + IUAVGadgetFactory(QString("OPMapGadget"), tr("OPMap"), parent) { } diff --git a/ground/openpilotgcs/src/plugins/pfd/pfdgadgetfactory.cpp b/ground/openpilotgcs/src/plugins/pfd/pfdgadgetfactory.cpp index 82932cf62..b76b87361 100644 --- a/ground/openpilotgcs/src/plugins/pfd/pfdgadgetfactory.cpp +++ b/ground/openpilotgcs/src/plugins/pfd/pfdgadgetfactory.cpp @@ -33,7 +33,7 @@ PFDGadgetFactory::PFDGadgetFactory(QObject *parent) : IUAVGadgetFactory(QString("PFDGadget"), - tr("Primary Flight Display Gadget"), + tr("Primary Flight Display"), parent) { } diff --git a/ground/openpilotgcs/src/plugins/pipxtreme/pipxtremegadgetfactory.cpp b/ground/openpilotgcs/src/plugins/pipxtreme/pipxtremegadgetfactory.cpp index 42ce2ec91..4574913d5 100644 --- a/ground/openpilotgcs/src/plugins/pipxtreme/pipxtremegadgetfactory.cpp +++ b/ground/openpilotgcs/src/plugins/pipxtreme/pipxtremegadgetfactory.cpp @@ -31,7 +31,7 @@ #include PipXtremeGadgetFactory::PipXtremeGadgetFactory(QObject *parent) : - IUAVGadgetFactory(QString("PipXtreme"), tr("PipXtreme Gadget"), parent) + IUAVGadgetFactory(QString("PipXtreme"), tr("PipXtreme"), parent) { } @@ -49,8 +49,3 @@ IUAVGadgetConfiguration * PipXtremeGadgetFactory::createConfiguration(QSettings { return new PipXtremeGadgetConfiguration(QString("PipXtreme"), qSettings); } - -IOptionsPage * PipXtremeGadgetFactory::createOptionsPage(IUAVGadgetConfiguration *config) -{ - return new PipXtremeGadgetOptionsPage(qobject_cast(config)); -} diff --git a/ground/openpilotgcs/src/plugins/pipxtreme/pipxtremegadgetfactory.h b/ground/openpilotgcs/src/plugins/pipxtreme/pipxtremegadgetfactory.h index d6d2bf736..8bd48f46b 100644 --- a/ground/openpilotgcs/src/plugins/pipxtreme/pipxtremegadgetfactory.h +++ b/ground/openpilotgcs/src/plugins/pipxtreme/pipxtremegadgetfactory.h @@ -45,7 +45,6 @@ public: Core::IUAVGadget * createGadget(QWidget *parent); IUAVGadgetConfiguration * createConfiguration(QSettings *qSettings); - IOptionsPage * createOptionsPage(IUAVGadgetConfiguration *config); }; #endif diff --git a/ground/openpilotgcs/src/plugins/scope/scopegadgetfactory.cpp b/ground/openpilotgcs/src/plugins/scope/scopegadgetfactory.cpp index 1c62c1f57..adbdcdd0d 100644 --- a/ground/openpilotgcs/src/plugins/scope/scopegadgetfactory.cpp +++ b/ground/openpilotgcs/src/plugins/scope/scopegadgetfactory.cpp @@ -33,7 +33,7 @@ ScopeGadgetFactory::ScopeGadgetFactory(QObject *parent) : IUAVGadgetFactory(QString("ScopeGadget"), - tr("Scope Gadget"), + tr("Scope"), parent) { } diff --git a/ground/openpilotgcs/src/plugins/systemhealth/systemhealthgadgetfactory.cpp b/ground/openpilotgcs/src/plugins/systemhealth/systemhealthgadgetfactory.cpp index 80abb1be7..41e068c17 100644 --- a/ground/openpilotgcs/src/plugins/systemhealth/systemhealthgadgetfactory.cpp +++ b/ground/openpilotgcs/src/plugins/systemhealth/systemhealthgadgetfactory.cpp @@ -33,7 +33,7 @@ SystemHealthGadgetFactory::SystemHealthGadgetFactory(QObject *parent) : IUAVGadgetFactory(QString("SystemHealthGadget"), - tr("System Health Gadget"), + tr("System Health"), parent) { } diff --git a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp index 47ad9a8ae..9bfa9f24e 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp @@ -172,6 +172,36 @@ QByteArray UAVObjectUtilManager::getBoardCPUSerial() return cpuSerial; } +/** + * Get the UAV Board Description, for anyone interested. + */ +QString UAVObjectUtilManager::getBoardDescription() +{ + QString description; + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); + if (!pm) + return 0; + UAVObjectManager *om = pm->getObject(); + if (!om) + return 0; + + UAVDataObject *obj = dynamic_cast(om->getObject(QString("FirmwareIAPObj"))); + // The code below will ask for the object update and wait for the updated to be received, + // or the timeout of the timer, set to 1 second. + QEventLoop loop; + connect(obj, SIGNAL(objectUpdated(UAVObject*)), &loop, SLOT(quit())); + QTimer::singleShot(1000, &loop, SLOT(quit())); // Create a timeout + obj->requestUpdate(); + loop.exec(); + + UAVObjectField* descriptionField = obj->getField("Description"); + // Description starts with an offset of + for (int i = 14; i < descriptionField->getNumElements(); ++i) { + description.append(descriptionField->getValue(i).toChar()); + } + return description; +} + // ****************************** diff --git a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h index f97f969d8..5d6afbfa2 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h +++ b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h @@ -62,6 +62,7 @@ public: int getBoardModel(); QByteArray getBoardCPUSerial(); + QString getBoardDescription(); private: QMutex *mutex; diff --git a/ground/openpilotgcs/src/plugins/uploader/devicewidget.cpp b/ground/openpilotgcs/src/plugins/uploader/devicewidget.cpp index 7284d5d55..a5c68e252 100644 --- a/ground/openpilotgcs/src/plugins/uploader/devicewidget.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/devicewidget.cpp @@ -168,17 +168,18 @@ bool deviceWidget::populateStructuredDescription(QByteArray desc) # 20 bytes: SHA1 sum of the firmware. # 40 bytes: free for now. */ - // I don't want to use structs, ok ? - quint32 gitCommitTag = desc.at(4)&0xFF; + + // Note: the ARM binary is big-endian: + quint32 gitCommitTag = desc.at(7)&0xFF; for (int i=1;i<4;i++) { gitCommitTag = gitCommitTag<<8; - gitCommitTag += desc.at(4+i) & 0xFF; + gitCommitTag += desc.at(7-i) & 0xFF; } myDevice->commitTag->setText("GIT tag 0x" + QString::number(gitCommitTag,16)); - quint32 buildDate = desc.at(8)&0xFF; + quint32 buildDate = desc.at(11)&0xFF; for (int i=1;i<4;i++) { buildDate = buildDate<<8; - buildDate += desc.at(8+i) & 0xFF; + buildDate += desc.at(11-i) & 0xFF; } myDevice->buildDate->setText(QString("Build time: ") + QDateTime::fromTime_t(buildDate).toString()); diff --git a/ground/openpilotgcs/src/plugins/uploader/devicewidget.ui b/ground/openpilotgcs/src/plugins/uploader/devicewidget.ui index a5f17794e..ec45f52df 100644 --- a/ground/openpilotgcs/src/plugins/uploader/devicewidget.ui +++ b/ground/openpilotgcs/src/plugins/uploader/devicewidget.ui @@ -17,7 +17,11 @@ - + + + true + + diff --git a/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.cpp b/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.cpp index 7e9b1889b..f1511e746 100644 --- a/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.cpp @@ -102,6 +102,9 @@ void runningDeviceWidget::populate() QString serial = utilMngr->getBoardCPUSerial().toHex(); myDevice->cpuSerial->setText(serial); + QString description = utilMngr->getBoardDescription(); + myDevice->description->setText(description); + status("Ready...", STATUSICON_INFO); } diff --git a/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.ui b/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.ui index 105a385c7..4a730c509 100644 --- a/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.ui +++ b/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.ui @@ -77,10 +77,18 @@ - + + + true + + - + + + true + + diff --git a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetfactory.cpp b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetfactory.cpp index 4099b936b..692985e5c 100755 --- a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetfactory.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetfactory.cpp @@ -33,7 +33,7 @@ #include UploaderGadgetFactory::UploaderGadgetFactory(QObject *parent) : - IUAVGadgetFactory(QString("Uploader"), tr("Uploader Gadget"), parent) + IUAVGadgetFactory(QString("Uploader"), tr("Uploader"), parent) { } @@ -52,8 +52,3 @@ IUAVGadgetConfiguration *UploaderGadgetFactory::createConfiguration(QSettings* q return new UploaderGadgetConfiguration(QString("Uploader"), qSettings); } -IOptionsPage *UploaderGadgetFactory::createOptionsPage(IUAVGadgetConfiguration *config) -{ - return new UploaderGadgetOptionsPage(qobject_cast(config)); -} - diff --git a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetfactory.h b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetfactory.h index fb44be6cc..c836287b1 100755 --- a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetfactory.h +++ b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetfactory.h @@ -46,7 +46,6 @@ public: Core::IUAVGadget *createGadget(QWidget *parent); IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings); - IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); }; #endif // UPLOADERGADGETFACTORY_H diff --git a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp index 128ac6e86..397533c2b 100755 --- a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp @@ -35,6 +35,8 @@ UploaderGadgetWidget::UploaderGadgetWidget(QWidget *parent) : QWidget(parent) currentStep = IAP_STATE_READY; resetOnly=false; dfu = NULL; + m_timer = 0; + m_progress = 0; // Listen to autopilot connection events ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); @@ -430,28 +432,28 @@ void UploaderGadgetWidget::systemRescue() log("** Follow those instructions to attempt a system rescue **"); log("**********************************************************"); log("You will be prompted to first connect USB, then system power"); - pd = new QProgressDialog(tr("Please connect the board (USB only!)"), tr("Cancel"), 0, 20); - QProgressBar * bar=new QProgressBar(pd); + m_progress = new QProgressDialog(tr("Please connect the board (USB only!)"), tr("Cancel"), 0, 20); + QProgressBar * bar=new QProgressBar(m_progress); bar->setFormat("Timeout"); - pd->setBar(bar); - pd->setMinimumDuration(0); - pd->setRange(0,20); - connect(pd, SIGNAL(canceled()), this, SLOT(cancel())); - t = new QTimer(this); - connect(t, SIGNAL(timeout()), this, SLOT(perform())); - t->start(1000); - connect(USBMonitor::instance(), SIGNAL(deviceDiscovered(USBPortInfo)),&q, SLOT(quit())); - q.exec(); - if(!t->isActive()) + m_progress->setBar(bar); + m_progress->setMinimumDuration(0); + m_progress->setRange(0,20); + connect(m_progress, SIGNAL(canceled()), this, SLOT(cancel())); + m_timer = new QTimer(this); + connect(m_timer, SIGNAL(timeout()), this, SLOT(perform())); + m_timer->start(1000); + connect(USBMonitor::instance(), SIGNAL(deviceDiscovered(USBPortInfo)),&m_eventloop, SLOT(quit())); + m_eventloop.exec(); + if(!m_timer->isActive()) { - pd->close(); - t->stop(); + m_progress->close(); + m_timer->stop(); QMessageBox::warning(this,tr("Openpilot Uploader"),tr("No board connection was detected!")); m_config->rescueButton->setEnabled(true); return; } - pd->close(); - t->stop(); + m_progress->close(); + m_timer->stop(); log("... Detecting First Board..."); repaint(); dfu = new DFUObject(DFU_DEBUG, false, QString()); @@ -477,8 +479,8 @@ void UploaderGadgetWidget::systemRescue() if(QMessageBox::question(this,tr("OpenPilot Uploader"),tr("If you want to search for other boards connect power now and press Yes"),QMessageBox::Yes,QMessageBox::No)==QMessageBox::Yes) { log("\nWaiting..."); - QTimer::singleShot(3000, &q, SLOT(quit())); - q.exec(); + QTimer::singleShot(3000, &m_eventloop, SLOT(quit())); + m_eventloop.exec(); log("Detecting second board..."); repaint(); if(!dfu->findDevices()) @@ -517,17 +519,17 @@ void UploaderGadgetWidget::systemRescue() } void UploaderGadgetWidget::perform() { - if(pd->value()==19) + if(m_progress->value()==19) { - t->stop(); - q.exit(); + m_timer->stop(); + m_eventloop.exit(); } - pd->setValue(pd->value()+1); + m_progress->setValue(m_progress->value()+1); } void UploaderGadgetWidget::cancel() { - t->stop(); - q.exit(); + m_timer->stop(); + m_eventloop.exit(); } /** @@ -554,12 +556,16 @@ UploaderGadgetWidget::~UploaderGadgetWidget() QWidget *qw = m_config->systemElements->widget(0); m_config->systemElements->removeTab(0); delete qw; + qw = 0; + } + if (m_progress) { + delete m_progress; + m_progress = 0; + } + if (m_timer) { + delete m_timer; + m_timer = 0; } - if (pd) - pd->deleteLater();; - if (t) - t->deleteLater();; - } diff --git a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.h b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.h index b629ad605..8fb167a82 100755 --- a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.h +++ b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.h @@ -78,10 +78,10 @@ private: bool resetOnly; void clearLog(); QString getPortDevice(const QString &friendName); - QProgressDialog* pd; - QTimer* t; + QProgressDialog* m_progress; + QTimer* m_timer; QLineEdit* openFileNameLE; - QEventLoop q; + QEventLoop m_eventloop; private slots: void error(QString errorString,int errorNumber); void info(QString infoString,int infoNumber); diff --git a/make/boards/ahrs/board-info.mk b/make/boards/ahrs/board-info.mk new file mode 100644 index 000000000..2103357ba --- /dev/null +++ b/make/boards/ahrs/board-info.mk @@ -0,0 +1,18 @@ +BOARD_TYPE := 0x02 +BOARD_REVISION := 0x01 +BOOTLOADER_VERSION := 0x00 +HW_TYPE := 0x00 + +MCU := cortex-m3 +CHIP := STM32F103CBT +BOARD := STM32103CB_AHRS +MODEL := MD +MODEL_SUFFIX := + +# Note: These must match the values in link_$(BOARD)_memory.ld +BL_BANK_BASE := 0x08000000 # Start of bootloader flash +BL_BANK_SIZE := 0x00002000 # Should include BD_INFO region +FW_BANK_BASE := 0x08002000 # Start of firmware flash +FW_BANK_SIZE := 0x0001E000 # Should include FW_DESC_SIZE + +FW_DESC_SIZE := 0x00000064 diff --git a/make/boards/coptercontrol/board-info.mk b/make/boards/coptercontrol/board-info.mk new file mode 100644 index 000000000..8d3f5d196 --- /dev/null +++ b/make/boards/coptercontrol/board-info.mk @@ -0,0 +1,18 @@ +BOARD_TYPE := 0x04 +BOARD_REVISION := 0x01 +BOOTLOADER_VERSION := 0x00 +HW_TYPE := 0x01 + +MCU := cortex-m3 +CHIP := STM32F103CBT +BOARD := STM32103CB_CC_Rev1 +MODEL := MD +MODEL_SUFFIX := _CC + +# Note: These must match the values in link_$(BOARD)_memory.ld +BL_BANK_BASE := 0x08000000 # Start of bootloader flash +BL_BANK_SIZE := 0x00003000 # Should include BD_INFO region +FW_BANK_BASE := 0x08003000 # Start of firmware flash +FW_BANK_SIZE := 0x0001D000 # Should include FW_DESC_SIZE + +FW_DESC_SIZE := 0x00000064 diff --git a/make/boards/ins/board-info.mk b/make/boards/ins/board-info.mk new file mode 100644 index 000000000..8a57661bf --- /dev/null +++ b/make/boards/ins/board-info.mk @@ -0,0 +1,18 @@ +BOARD_TYPE := 0x05 +BOARD_REVISION := 0x01 +BOOTLOADER_VERSION := 0x00 +HW_TYPE := 0x00 + +MCU := cortex-m3 +CHIP := STM32F103RET +BOARD := STM3210E_INS +MODEL := HD +MODEL_SUFFIX := _OP + +# Note: These must match the values in link_$(BOARD)_memory.ld +BL_BANK_BASE := 0x08000000 # Start of bootloader flash +BL_BANK_SIZE := 0x00002000 # Should include BD_INFO region +FW_BANK_BASE := 0x08002000 # Start of firmware flash +FW_BANK_SIZE := 0x0001E000 # Should include FW_DESC_SIZE + +FW_DESC_SIZE := 0x00000064 diff --git a/make/boards/openpilot/board-info.mk b/make/boards/openpilot/board-info.mk new file mode 100644 index 000000000..f1e35505c --- /dev/null +++ b/make/boards/openpilot/board-info.mk @@ -0,0 +1,18 @@ +BOARD_TYPE := 0x01 +BOARD_REVISION := 0x01 +BOOTLOADER_VERSION := 0x00 +HW_TYPE := 0x00 + +MCU := cortex-m3 +CHIP := STM32F103RET +BOARD := STM3210E_OP +MODEL := HD +MODEL_SUFFIX := _OP + +# Note: These must match the values in link_$(BOARD)_memory.ld +BL_BANK_BASE := 0x08000000 # Start of bootloader flash +BL_BANK_SIZE := 0x00005000 # Should include BD_INFO region +FW_BANK_BASE := 0x08005000 # Start of firmware flash +FW_BANK_SIZE := 0x0007B000 # Should include FW_DESC_SIZE + +FW_DESC_SIZE := 0x00000064 diff --git a/make/boards/pipxtreme/board-info.mk b/make/boards/pipxtreme/board-info.mk new file mode 100644 index 000000000..f9635109e --- /dev/null +++ b/make/boards/pipxtreme/board-info.mk @@ -0,0 +1,20 @@ +BOARD_TYPE := 0x03 +BOARD_REVISION := 0x01 +BOOTLOADER_VERSION := 0x00 +HW_TYPE := 0x01 + +MCU := cortex-m3 +CHIP := STM32F103CBT +BOARD := STM32103CB_PIPXTREME +MODEL := MD +MODEL_SUFFIX := + +# Note: These must match the values in link_$(BOARD)_memory.ld +BL_BANK_BASE := 0x08000000 # Start of bootloader flash +BL_BANK_SIZE := 0x00003000 # Should include BD_INFO region +FW_BANK_BASE := 0x08003000 # Start of firmware flash +FW_BANK_SIZE := 0x0001CC00 # Should include FW_DESC_SIZE +EE_BANK_BASE := 0x0801FC00 # EEPROM storage area +EE_BANK_SIZE := 0x00000400 # Size of EEPROM storage area + +FW_DESC_SIZE := 0x00000064 diff --git a/make/firmware-defs.mk b/make/firmware-defs.mk index eee2d6e9c..901a6c454 100644 --- a/make/firmware-defs.mk +++ b/make/firmware-defs.mk @@ -45,6 +45,10 @@ MSG_ASMFROMC := ${quote} AS(C) ${quote} MSG_ASMFROMC_ARM := ${quote} AS(C)-ARM ${quote} MSG_PYMITEINIT := ${quote} PY ${quote} MSG_INSTALLING := ${quote} INSTALL ${quote} +MSG_OPFIRMWARE := ${quote} OPFW ${quote} +MSG_FWINFO := ${quote} FWINFO ${quote} +MSG_JTAG_PROGRAM := ${quote} JTAG-PGM ${quote} +MSG_JTAG_WIPE := ${quote} JTAG-WIPE ${quote} toprel = $(subst $(realpath $(TOP))/,,$(abspath $(1))) @@ -68,6 +72,10 @@ gccversion : @echo $(MSG_LOAD_FILE) $(call toprel, $@) $(V1) $(OBJCOPY) -O binary $< $@ +%.bin: %.o + @echo $(MSG_LOAD_FILE) $(call toprel, $@) + $(V1) $(OBJCOPY) -O binary $< $@ + %.bin.o: %.bin @echo $(MSG_BIN_OBJ) $(call toprel, $@) $(V1) $(OBJCOPY) -I binary -O elf32-littlearm --binary-architecture arm \ @@ -90,12 +98,39 @@ gccversion : $(V1) $(NM) -n $< > $@ define SIZE_TEMPLATE +.PHONY: size +size: $(1)_size + .PHONY: $(1)_size $(1)_size: $(1) @echo $(MSG_SIZE) $$(call toprel, $$<) $(V1) $(SIZE) -A $$< endef +# OpenPilot firmware image template +# $(1) = path to bin file +# $(2) = boardtype in hex +# $(3) = board revision in hex +define OPFW_TEMPLATE +FORCE: + +$(1).firmwareinfo.c: $(1) $(TOP)/make/templates/firmwareinfotemplate.c FORCE + @echo $(MSG_FWINFO) $$(call toprel, $$@) + $(V1) python $(TOP)/make/scripts/version-info.py \ + --path=$(TOP) \ + --template=$(TOP)/make/templates/firmwareinfotemplate.c \ + --outfile=$$@ \ + --image=$(1) \ + --type=$(2) \ + --revision=$(3) + +$(eval $(call COMPILE_C_TEMPLATE, $(1).firmwareinfo.c)) + +$(OUTDIR)/$(notdir $(basename $(1))).opfw : $(1) $(1).firmwareinfo.bin + @echo $(MSG_OPFIRMWARE) $$(call toprel, $$@) + $(V1) cat $(1) $(1).firmwareinfo.bin > $$@ +endef + # Assemble: create object files from assembler source files. define ASSEMBLE_TEMPLATE $(OUTDIR)/$(notdir $(basename $(1))).o : $(1) @@ -163,21 +198,48 @@ $($(1):.c=.s) : %.s : %.c $(V1) $(CC) -S $$(CFLAGS) $$(CONLYFLAGS) $$< -o $$@ endef +# $(1) = Name of binary image to write +# $(2) = Base of flash region to write/wipe +# $(3) = Size of flash region to write/wipe +define JTAG_TEMPLATE # --------------------------------------------------------------------------- # Options for OpenOCD flash-programming # see openocd.pdf/openocd.texi for further information # if OpenOCD is in the $PATH just set OPENOCDEXE=openocd -OOCD_EXE=openocd +OOCD_EXE ?= openocd + # debug level -OOCD_CL=-d0 +OOCD_JTAG_SETUP = -d0 # interface and board/target settings (using the OOCD target-library here) -OOCD_CL+=-s $(TOP)/flight/Project/OpenOCD -OOCD_CL+=-f foss-jtag.revb.cfg -f stm32.cfg +OOCD_JTAG_SETUP += -s $(TOP)/flight/Project/OpenOCD +OOCD_JTAG_SETUP += -f foss-jtag.revb.cfg -f stm32.cfg # initialize -OOCD_CL+=-c init +OOCD_BOARD_RESET = -c init # show the targets -OOCD_CL+=-c targets +#OOCD_BOARD_RESET += -c targets # commands to prepare flash-write -OOCD_CL+= -c "reset halt" +OOCD_BOARD_RESET += -c "reset halt" + +.PHONY: program +program: $(1) + @echo $(MSG_JTAG_PROGRAM) $$(call toprel, $$<) + $(V1) $(OOCD_EXE) \ + $$(OOCD_JTAG_SETUP) \ + $$(OOCD_BOARD_RESET) \ + -c "flash write_image erase $$< $(2) bin" \ + -c "verify_image $$< $(2) bin" \ + -c "reset run" \ + -c "shutdown" + +.PHONY: wipe +wipe: + @echo $(MSG_JTAG_WIPE) wiping $(3) bytes starting from $(2) + $(V1) $(OOCD_EXE) \ + $$(OOCD_JTAG_SETUP) \ + $$(OOCD_BOARD_RESET) \ + -c "flash erase_address pad $(2) $(3)" \ + -c "reset run" \ + -c "shutdown" +endef \ No newline at end of file diff --git a/make/scripts/version-info.py b/make/scripts/version-info.py index 5022cbd73..8c4fe901e 100644 --- a/make/scripts/version-info.py +++ b/make/scripts/version-info.py @@ -69,7 +69,7 @@ class Repo: def _get_tag(self): """Get and store git tag for the HEAD commit""" self._tag = None - self._exec('describe --exact-match HEAD') + self._exec('describe --tags --exact-match HEAD') if self._rc == 0: self._tag = self._out.strip(' \t\n\r') @@ -235,6 +235,21 @@ def sha1(file): hex_stream = lambda s:",".join(['0x'+hex(ord(c))[2:].zfill(2) for c in s]) return hex_stream(sha1.digest()) +def xtrim(string, suffix, length): + """Return string+suffix concatenated and trimmed up to length characters + + This function appends suffix to the end of string and returns the result + up to length characters. If it does not fit then the string will be + truncated and the '+' will be put between it and the suffix. + """ + + if len(string) + len(suffix) <= length: + return ''.join([string, suffix]) + else: + n = length-1-len(suffix) + assert n > 0, "length of truncated string+suffix exceeds maximum length" + return ''.join([string[:n], '+', suffix]) + def main(): """This utility uses git repository in the current working directory or from the given path to extract some info about it and HEAD commit. @@ -306,6 +321,7 @@ dependent targets. TAG_OR_BRANCH = r.tag(r.branch('unreleased')), TAG_OR_HASH8 = r.tag(r.hash(8, 'untagged')), DIRTY = r.dirty(), + FWTAG = xtrim(r.tag(r.branch('unreleased')), r.dirty(), 25), UNIXTIME = r.time(), DATE = r.time('%Y%m%d'), DATETIME = r.time('%Y%m%d %H:%M'), diff --git a/make/templates/firmwareinfotemplate.c b/make/templates/firmwareinfotemplate.c index 3f3829cc6..b9297273e 100644 --- a/make/templates/firmwareinfotemplate.c +++ b/make/templates/firmwareinfotemplate.c @@ -62,7 +62,7 @@ const struct fw_version_info fw_version_blob __attribute__((used)) __attribute__ .timestamp = ${UNIXTIME}, .board_type = ${BOARD_TYPE}, .board_revision = ${BOARD_REVISION}, - .commit_tag_name = "${TAG_OR_BRANCH}${DIRTY}", + .commit_tag_name = "${FWTAG}", .sha1sum = { ${SHA1} }, }; diff --git a/make/templates/gcsversioninfotemplate.h b/make/templates/gcsversioninfotemplate.h new file mode 100644 index 000000000..2130f59bf --- /dev/null +++ b/make/templates/gcsversioninfotemplate.h @@ -0,0 +1,32 @@ +/** + ****************************************************************************** + * + * @file ${OUTFILENAME} + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011. + * @brief GCS revision info file autogenerated using template + * ${TEMPLATE} + * + * @see The GNU Public License (GPL) Version 3 + * + *****************************************************************************/ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#define GCS_REVISION ${TAG_OR_BRANCH}:${HASH8}${DIRTY} ${DATETIME} + +/** + * @} + */ diff --git a/make/winx86/README.txt b/make/winx86/README.txt index 24f160f34..17477d098 100644 --- a/make/winx86/README.txt +++ b/make/winx86/README.txt @@ -33,11 +33,14 @@ It is expected that you have the following tools installed into the listed locations (but any other locations are fine as well): - Python in C:\Python27 - - QtSDK in C:\Qt\2010.05 + - QtSDK in C:\Qt\2010.05 or C:\QtSDK (depending on SDK version) - CodeSourcery G++ in %ProgramFiles%\CodeSourcery\Sourcery G++ Lite - msysGit in %ProgramFiles%\Git - Unicode NSIS in %ProgramFiles%\NSIS\Unicode - - OpenOCD in C:\OpenOCD\0.4.0\bin + - OpenOCD in C:\OpenOCD\0.4.0\bin (optional) + +The SDL library and headers should be installed into Qt directories to build +the GCS. Check the wiki or ground/openpilotgcs/copydata.pro for details. Also it is assumed that you have the C:\Program Files\Git\cmd\ directory in the PATH. Usually this is the case for msysGit installation if you have chosen diff --git a/make/winx86/cmd/sh.cmd b/make/winx86/cmd/sh.cmd index dd70a8e44..480044ab7 100644 --- a/make/winx86/cmd/sh.cmd +++ b/make/winx86/cmd/sh.cmd @@ -38,6 +38,9 @@ rem As a result, the SDL headers will not be found, if they were copied into rem QtSDK's MinGW directory. In that case make sure that you have correct rem directories specified here. rem +rem Also the SDL should be installed into Qt directories to build the GCS. +rem Check the wiki or ground/openpilotgcs/copydata.pro for details. +rem rem Also you can add any paths below just by adding extra 'call :which' rem lines with the following parameters: rem - environment variable which will be set to the tool location, if found; @@ -51,8 +54,12 @@ set NOT_FOUND= set PATH_DIRS= call :which MSYSGIT "%ProgramFiles%\Git\bin" git.exe +rem These two lines for qt-sdk-win-opensource-2010.05.exe: call :which QTMINGW "C:\Qt\2010.05\mingw\bin" mingw32-make.exe call :which QTSDK "C:\Qt\2010.05\qt\bin" qmake.exe +rem These two lines for Qt_SDK_Win_offline_v1_1_1_en.exe: +rem call :which QTMINGW "C:\QtSDK\mingw\bin" mingw32-make.exe +rem call :which QTSDK "C:\QtSDK\Desktop\Qt\4.7.3\mingw\bin" qmake.exe call :which CODESOURCERY "%ProgramFiles%\CodeSourcery\Sourcery G++ Lite\bin" cs-make.exe call :which PYTHON "C:\Python27" python.exe call :which UNSIS "%ProgramFiles%\NSIS\Unicode" makensis.exe diff --git a/release/Makefile b/package/Makefile similarity index 66% rename from release/Makefile rename to package/Makefile index 8f5af3008..1b27755e8 100644 --- a/release/Makefile +++ b/package/Makefile @@ -14,11 +14,12 @@ ROOT_DIR := $(realpath $(WHEREAMI)/../) # Set up some macros BUILD_DIR := $(ROOT_DIR)/build VERSION_CMD := python $(ROOT_DIR)/make/scripts/version-info.py --path="$(ROOT_DIR)" -RELEASE_LBL := $(shell $(VERSION_CMD) --format=\$${DATE}-\$${TAG_OR_HASH8}\$${DIRTY}) -RELEASE_DIR := $(BUILD_DIR)/release-$(RELEASE_LBL) -FW_DIR := $(RELEASE_DIR)/firmware-$(RELEASE_LBL) +PACKAGE_LBL := $(shell $(VERSION_CMD) --format=\$${DATE}-\$${TAG_OR_HASH8}\$${DIRTY}) +PACKAGE_DIR := $(BUILD_DIR)/package-$(PACKAGE_LBL) +FW_DIR := $(PACKAGE_DIR)/firmware-$(PACKAGE_LBL) BL_DIR := $(FW_DIR)/bootloaders -BLUPD_DIR := $(FW_DIR)/bootloader_updaters +BU_DIR := $(FW_DIR)/bootloader-updaters +FE_DIR := $(FW_DIR)/flash-erase-tools # Clean build options (recommended for package testing only) ifeq ($(CLEAN_BUILD), NO) @@ -32,13 +33,16 @@ CLEAN_GROUND := YES CLEAN_FLIGHT := YES endif -# Setup targets -FW_TARGETS_COMMON := ahrs pipxtreme -FW_TARGETS_INPUT := coptercontrol openpilot -FW_TARGETS_TOOLS := coptercontrol -FW_TARGETS := $(FW_TARGETS_COMMON) $(FW_TARGETS_INPUT) -BL_TARGETS := $(addprefix bl_, $(FW_TARGETS)) -BLUPD_TARGETS := $(addprefix blupd_, $(FW_TARGETS)) +# Set up targets +FW_STEMS_COMMON := ahrs pipxtreme +FW_STEMS_INPUT := coptercontrol openpilot +FW_STEMS_TOOLS := coptercontrol +FW_STEMS_ALL := $(FW_STEMS_COMMON) $(FW_STEMS_INPUT) +FW_TARGETS_COMMON := $(addprefix fw_, $(FW_STEMS_COMMON)) +FW_TARGETS_INPUT := $(addprefix fw_, $(FW_STEMS_INPUT)) +FW_TARGETS_TOOLS := $(addprefix fw_, $(FW_STEMS_TOOLS)) +BL_TARGETS := $(addprefix bl_, $(FW_STEMS_ALL)) +BU_TARGETS := $(addprefix bu_, $(FW_STEMS_ALL)) help: @echo @@ -48,11 +52,11 @@ help: @echo " Here is a summary of the available targets:" @echo @echo " [Packaging]" - @echo " release - Build and package the OpenPilot distributable" - @echo " release_flight - Build and package the OpenPilot flight firmware only" + @echo " package - Build and package the OpenPilot distributable" + @echo " package_flight - Build and package the OpenPilot flight firmware only" @echo @echo " Notes:" - @echo " - package will be placed in $(RELEASE_DIR)" + @echo " - package will be placed in $(PACKAGE_DIR)" @echo @echo " - the build directory will be removed first on every run unless one" @echo " of CLEAN_BUILD=NO or CLEAN_BUILD=NEVER options is defined." @@ -97,22 +101,19 @@ endif endef # Firmware for different input drivers -$(eval $(call INSTALL_TEMPLATE,fw_common,uavobjects,$(FW_DIR),,-$(RELEASE_LBL),,,$(FW_TARGETS_COMMON),install)) -$(eval $(call INSTALL_TEMPLATE,fw_pwm,uavobjects,$(FW_DIR),,-pwm-$(RELEASE_LBL),,clean,$(FW_TARGETS_INPUT),install)) -$(eval $(call INSTALL_TEMPLATE,fw_spektrum,uavobjects,$(FW_DIR),,-spektrum-$(RELEASE_LBL),USE_SPEKTRUM=YES,clean,$(FW_TARGETS_INPUT),install)) -$(eval $(call INSTALL_TEMPLATE,fw_ppm,uavobjects,$(FW_DIR),,-ppm-$(RELEASE_LBL),USE_PPM=YES,clean,$(FW_TARGETS_INPUT),install)) +$(eval $(call INSTALL_TEMPLATE,fw_common,uavobjects,$(FW_DIR),,-$(PACKAGE_LBL),,,$(FW_TARGETS_COMMON),install)) +$(eval $(call INSTALL_TEMPLATE,fw_pwm,uavobjects,$(FW_DIR),,-pwm-$(PACKAGE_LBL),,clean,$(FW_TARGETS_INPUT),install)) +$(eval $(call INSTALL_TEMPLATE,fw_spektrum,uavobjects,$(FW_DIR),,-dsm2sat-$(PACKAGE_LBL),USE_SPEKTRUM=YES,clean,$(FW_TARGETS_INPUT),install)) +$(eval $(call INSTALL_TEMPLATE,fw_ppm,uavobjects,$(FW_DIR),,-ppm-$(PACKAGE_LBL),USE_PPM=YES,clean,$(FW_TARGETS_INPUT),install)) -# Bootloaders (change 'bin' to 'install' to install bootloaders too) -$(eval $(call INSTALL_TEMPLATE,all_bl,uavobjects,$(BL_DIR),,-$(RELEASE_LBL),,,$(BL_TARGETS),bin)) +# Bootloaders (change 'install' to 'bin' if you don't want to install bootloaders) +$(eval $(call INSTALL_TEMPLATE,all_bl,uavobjects,$(BL_DIR),,-$(PACKAGE_LBL),,,$(BL_TARGETS),install)) -# Bootloader Updaters -$(eval $(call INSTALL_TEMPLATE,blupd_coptercontrol,all_bl,$(BLUPD_DIR),CopterControl_,-$(RELEASE_LBL),,,blupd_coptercontrol,install)) -$(eval $(call INSTALL_TEMPLATE,blupd_ahrs,all_bl,$(BLUPD_DIR),AHRS_,-$(RELEASE_LBL),,,blupd_ahrs,install)) -$(eval $(call INSTALL_TEMPLATE,blupd_openpilot,all_bl,$(BLUPD_DIR),OpenPilot_,-$(RELEASE_LBL),,,blupd_openpilot,install)) -$(eval $(call INSTALL_TEMPLATE,blupd_pipxtreme,all_bl,$(BLUPD_DIR),PipXtreme_,-$(RELEASE_LBL),,,blupd_pipxtreme,install)) +# Bootloader updaters +$(eval $(call INSTALL_TEMPLATE,all_bu,all_bl,$(BU_DIR),,-$(PACKAGE_LBL),,,$(BU_TARGETS),install)) # CopterControl flash eraser tool -$(eval $(call INSTALL_TEMPLATE,fw_tools,uavobjects,$(BLUPD_DIR),,-FlashEraser-$(RELEASE_LBL),ERASE_FLASH=YES,clean,$(FW_TARGETS_TOOLS),install)) +$(eval $(call INSTALL_TEMPLATE,fw_tools,uavobjects,$(FE_DIR),,-flash-erase-$(PACKAGE_LBL),ERASE_FLASH=YES,clean,$(FW_TARGETS_TOOLS),install)) # Order-only dependencies # They are bit complicated to support parallel (-j) builds and to create @@ -126,17 +127,17 @@ fw_ppm: | fw_spektrum # ordered build fw_tools: | fw_spektrum # ordered build, replace fw_spektrum by fw_ppm if uncommented below -release_fw: | fw_common fw_pwm fw_spektrum # fw_ppm +package_fw: | fw_common fw_pwm fw_spektrum # fw_ppm -release_blupd: | $(BLUPD_TARGETS) +package_bu: | all_bu -release_flight: | release_fw release_blupd fw_tools +package_flight: | package_fw package_bu fw_tools -release_ground: | ground_package +package_ground: | ground_package -release: | release_flight release_ground +package: | package_flight package_ground -.PHONY: help uavobjects all_clean release release_flight release_fw release_blupd release_ground +.PHONY: help uavobjects all_clean package package_flight package_fw package_bu package_ground # Decide on a verbosity level based on the V= parameter export AT := @ diff --git a/release/Makefile.linux b/package/Makefile.linux similarity index 100% rename from release/Makefile.linux rename to package/Makefile.linux diff --git a/package/Makefile.osx b/package/Makefile.osx new file mode 100644 index 000000000..e2b3c62ba --- /dev/null +++ b/package/Makefile.osx @@ -0,0 +1,20 @@ +# +# MacOSX-specific packaging +# + +osx_package: gcs package_flight + ( \ + ROOT_DIR="$(ROOT_DIR)" \ + BUILD_DIR="$(BUILD_DIR)" \ + PACKAGE_LBL="$(PACKAGE_LBL)" \ + PACKAGE_DIR="$(PACKAGE_DIR)" \ + FW_DIR="$(FW_DIR)" \ + "$(ROOT_DIR)/package/osx/package" \ + ) + +gcs: uavobjects + $(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@ + +ground_package: | osx_package + +.PHONY: gcs ground_package osx_package diff --git a/release/Makefile.winx86 b/package/Makefile.winx86 similarity index 54% rename from release/Makefile.winx86 rename to package/Makefile.winx86 index 1c8a1db4c..5ff65a97d 100644 --- a/release/Makefile.winx86 +++ b/package/Makefile.winx86 @@ -4,19 +4,22 @@ NSIS_CMD := makensis.exe NSIS_OPTS := /V3 -NSIS_DIR := $(ROOT_DIR)/release/winx86 +NSIS_DIR := $(ROOT_DIR)/package/winx86 NSIS_SCRIPT := $(NSIS_DIR)/openpilotgcs.nsi NSIS_TEMPLATE := $(NSIS_DIR)/openpilotgcs.tpl NSIS_HEADER := $(BUILD_DIR)/ground/openpilotgcs/openpilotgcs.nsh -package: gcs release_flight - mkdir -p "$(dir $(NSIS_HEADER))" +win_package: gcs package_flight + $(V1) mkdir -p "$(dir $(NSIS_HEADER))" $(VERSION_CMD) --template="$(NSIS_TEMPLATE)" --outfile="$(NSIS_HEADER)" + $(V1) echo "Building Windows installer, please wait..." + $(V1) echo "If you have a script error in line 1 - use Unicode NSIS 2.46+" + $(V1) echo " http://www.scratchpaper.com" $(NSIS_CMD) $(NSIS_OPTS) $(NSIS_SCRIPT) gcs: uavobjects $(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@ -ground_package: | package +ground_package: | win_package -.PHONY: gcs ground_package package +.PHONY: gcs ground_package win_package diff --git a/package/osx/OpenPilot.dmg b/package/osx/OpenPilot.dmg new file mode 100644 index 000000000..97ba31eee Binary files /dev/null and b/package/osx/OpenPilot.dmg differ diff --git a/package/osx/libraries b/package/osx/libraries new file mode 100755 index 000000000..f97b969b8 --- /dev/null +++ b/package/osx/libraries @@ -0,0 +1,47 @@ +#!/bin/bash + +APP="${1?}" +PLUGINS="${APP}/Contents/PlugIns" +OP_PLUGINS="${APP}/Contents/PlugIns/OpenPilot" +QT_LIBS="QtGui QtCore QtSvg QtSql QtOpenGL QtNetwork QtXml QtDBus QtScript phonon" + +echo "Processing Qt libraries in $1" +macdeployqt "${APP}" + +for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib +do + for g in $QT_LIBS + do + install_name_tool -change \ + ${g}.framework/Versions/4/${g} \ + @executable_path/../Frameworks/${g}.framework/Versions/4/${g} \ + "${f}" + done +done + +# should be redundant but some libs missed by main app and macdeployqt +for f in ${QT_LIBS} +do + echo "Copying ${f}" + cp -r /Library/Frameworks/${f}.framework "${APP}/Contents/Frameworks/" + + echo "Changing package identification of ${f}" + install_name_tool -id \ + @executable_path/../Frameworks/${f}.framework/Versions/4/QtCore \ + "${APP}/Contents/Frameworks/${f}.framework/Versions/4/${f}" + + echo "Changing package linkages" + for g in $QT_LIBS + do + install_name_tool -change \ + ${g}.framework/Versions/4/${g} \ + @executable_path/../Frameworks/${g}.framework/Versions/4/${g} \ + "${APP}/Contents/Frameworks/${f}.framework/Versions/4/${f}" + done +done + +# deleting unnecessary files +echo "Deleting unnecessary files" +find "${APP}/Contents/Frameworks" -iname "current" -exec rm -rf \{\} \; +find "${APP}/Contents/Frameworks" -iname "4.0" -exec rm -rf \{\} \; +find "${APP}/Contents/Frameworks" -iname "*_debug" -exec rm -rf \{\} \; diff --git a/package/osx/package b/package/osx/package new file mode 100755 index 000000000..a12e7e9fe --- /dev/null +++ b/package/osx/package @@ -0,0 +1,32 @@ +#!/bin/bash + +# the following environment variables must be set +: ${ROOT_DIR?} ${BUILD_DIR?} ${PACKAGE_LBL?} ${PACKAGE_DIR?} ${FW_DIR?} + +# more variables +APP_PATH="${BUILD_DIR}/ground/openpilotgcs/bin/OpenPilot GCS.app" +TEMP_FILE="${PACKAGE_DIR}/OpenPilot-temp.dmg" +OUT_FILE="${PACKAGE_DIR}/OpenPilot-${PACKAGE_LBL}.dmg" +VOL_NAME="OpenPilot" + +# prepare the stage +rm -f "${TEMP_FILE}" +rm -f "${OUT_FILE}" + +hdiutil convert "${ROOT_DIR}/package/osx/OpenPilot.dmg" \ + -format UDRW -o "${TEMP_FILE}" +device=$(hdiutil attach "${TEMP_FILE}" | \ + egrep '^/dev/' | sed 1q | awk '{print $1}') + +# packaging goes here +cp -r "${APP_PATH}" "/Volumes/${VOL_NAME}" +cp -r "${FW_DIR}" "/Volumes/${VOL_NAME}/firmware" + +"${ROOT_DIR}/package/osx/libraries" \ + "/Volumes/${VOL_NAME}/OpenPilot GCS.app" || exit 1 + +hdiutil detach ${device} +hdiutil convert "${TEMP_FILE}" -format UDZO -o "${OUT_FILE}" + +# cleanup +rm "${TEMP_FILE}" diff --git a/release/winx86/licenses/GPLv3_de.rtf b/package/winx86/licenses/GPLv3_de.rtf similarity index 100% rename from release/winx86/licenses/GPLv3_de.rtf rename to package/winx86/licenses/GPLv3_de.rtf diff --git a/release/winx86/licenses/GPLv3_en.rtf b/package/winx86/licenses/GPLv3_en.rtf similarity index 100% rename from release/winx86/licenses/GPLv3_en.rtf rename to package/winx86/licenses/GPLv3_en.rtf diff --git a/release/winx86/licenses/GPLv3_es.rtf b/package/winx86/licenses/GPLv3_es.rtf similarity index 100% rename from release/winx86/licenses/GPLv3_es.rtf rename to package/winx86/licenses/GPLv3_es.rtf diff --git a/release/winx86/licenses/GPLv3_fr.rtf b/package/winx86/licenses/GPLv3_fr.rtf similarity index 100% rename from release/winx86/licenses/GPLv3_fr.rtf rename to package/winx86/licenses/GPLv3_fr.rtf diff --git a/release/winx86/licenses/GPLv3_ru.rtf b/package/winx86/licenses/GPLv3_ru.rtf similarity index 100% rename from release/winx86/licenses/GPLv3_ru.rtf rename to package/winx86/licenses/GPLv3_ru.rtf diff --git a/release/winx86/licenses/GPLv3_zh_CN.rtf b/package/winx86/licenses/GPLv3_zh_CN.rtf similarity index 100% rename from release/winx86/licenses/GPLv3_zh_CN.rtf rename to package/winx86/licenses/GPLv3_zh_CN.rtf diff --git a/release/winx86/openpilotgcs.nsi b/package/winx86/openpilotgcs.nsi similarity index 94% rename from release/winx86/openpilotgcs.nsi rename to package/winx86/openpilotgcs.nsi index 0bf5eb52a..9cad5d233 100644 --- a/release/winx86/openpilotgcs.nsi +++ b/package/winx86/openpilotgcs.nsi @@ -50,17 +50,17 @@ !define INSTALLER_NAME "OpenPilot GCS Installer" ; Read automatically generated version info -; !define RELEASE_LBL "${DATE}-${TAG_OR_HASH8}" -; !define RELEASE_DIR "..\..\build\release-$${RELEASE_LBL}" -; !define OUT_FILE "OpenPilotGCS-$${RELEASE_LBL}-install.exe" -; !define FIRMWARE_DIR "firmware-$${RELEASE_LBL}" +; !define PACKAGE_LBL "${DATE}-${TAG_OR_HASH8}" +; !define PACKAGE_DIR "..\..\build\package-$${PACKAGE_LBL}" +; !define OUT_FILE "OpenPilotGCS-$${PACKAGE_LBL}-install.exe" +; !define FIRMWARE_DIR "firmware-$${PACKAGE_LBL}" ; !define PRODUCT_VERSION "0.0.0.0" ; !define FILE_VERSION "${TAG_OR_BRANCH}:${HASH8} ${DATETIME}" ; !define BUILD_DESCRIPTION "${TAG_OR_BRANCH}:${HASH8} built using ${ORIGIN} as origin, committed ${DATETIME} as ${HASH}" !include "${GCS_BUILD_TREE}\openpilotgcs.nsh" Name "${PRODUCT_NAME}" - OutFile "${RELEASE_DIR}\${OUT_FILE}" + OutFile "${PACKAGE_DIR}\${OUT_FILE}" VIProductVersion ${PRODUCT_VERSION} VIAddVersionKey "ProductName" "${INSTALLER_NAME}" @@ -185,7 +185,7 @@ SectionEnd Section "Firmware" InSecFirmware SetOutPath "$INSTDIR\firmware\${FIRMWARE_DIR}" - File /r "${RELEASE_DIR}\${FIRMWARE_DIR}\*" + File /r "${PACKAGE_DIR}\${FIRMWARE_DIR}\*" SectionEnd Section "Shortcuts" InSecShortcuts diff --git a/release/winx86/openpilotgcs.tpl b/package/winx86/openpilotgcs.tpl similarity index 74% rename from release/winx86/openpilotgcs.tpl rename to package/winx86/openpilotgcs.tpl index f75c6503a..bb0adc452 100644 --- a/release/winx86/openpilotgcs.tpl +++ b/package/winx86/openpilotgcs.tpl @@ -12,10 +12,10 @@ # ; Some names, paths and constants -!define RELEASE_LBL "${DATE}-${TAG_OR_HASH8}${DIRTY}" -!define RELEASE_DIR "..\..\build\release-$${RELEASE_LBL}" -!define OUT_FILE "OpenPilot-$${RELEASE_LBL}-install.exe" -!define FIRMWARE_DIR "firmware-$${RELEASE_LBL}" +!define PACKAGE_LBL "${DATE}-${TAG_OR_HASH8}${DIRTY}" +!define PACKAGE_DIR "..\..\build\package-$${PACKAGE_LBL}" +!define OUT_FILE "OpenPilot-$${PACKAGE_LBL}-install.exe" +!define FIRMWARE_DIR "firmware-$${PACKAGE_LBL}" ; Installer version info !define PRODUCT_VERSION "0.0.0.0" diff --git a/release/winx86/resources/header.bmp b/package/winx86/resources/header.bmp similarity index 100% rename from release/winx86/resources/header.bmp rename to package/winx86/resources/header.bmp diff --git a/release/winx86/resources/openpilot.ico b/package/winx86/resources/openpilot.ico similarity index 100% rename from release/winx86/resources/openpilot.ico rename to package/winx86/resources/openpilot.ico diff --git a/release/winx86/resources/welcome.bmp b/package/winx86/resources/welcome.bmp similarity index 100% rename from release/winx86/resources/welcome.bmp rename to package/winx86/resources/welcome.bmp diff --git a/release/winx86/translations/languages.nsh b/package/winx86/translations/languages.nsh similarity index 100% rename from release/winx86/translations/languages.nsh rename to package/winx86/translations/languages.nsh diff --git a/release/winx86/translations/strings_de.nsh b/package/winx86/translations/strings_de.nsh similarity index 100% rename from release/winx86/translations/strings_de.nsh rename to package/winx86/translations/strings_de.nsh diff --git a/release/winx86/translations/strings_en.nsh b/package/winx86/translations/strings_en.nsh similarity index 100% rename from release/winx86/translations/strings_en.nsh rename to package/winx86/translations/strings_en.nsh diff --git a/release/winx86/translations/strings_es.nsh b/package/winx86/translations/strings_es.nsh similarity index 100% rename from release/winx86/translations/strings_es.nsh rename to package/winx86/translations/strings_es.nsh diff --git a/release/winx86/translations/strings_fr.nsh b/package/winx86/translations/strings_fr.nsh similarity index 100% rename from release/winx86/translations/strings_fr.nsh rename to package/winx86/translations/strings_fr.nsh diff --git a/release/winx86/translations/strings_ru.nsh b/package/winx86/translations/strings_ru.nsh similarity index 100% rename from release/winx86/translations/strings_ru.nsh rename to package/winx86/translations/strings_ru.nsh diff --git a/release/winx86/translations/strings_zh_CN.nsh b/package/winx86/translations/strings_zh_CN.nsh similarity index 100% rename from release/winx86/translations/strings_zh_CN.nsh rename to package/winx86/translations/strings_zh_CN.nsh diff --git a/release/Makefile.osx b/release/Makefile.osx deleted file mode 100644 index d18b950d7..000000000 --- a/release/Makefile.osx +++ /dev/null @@ -1,10 +0,0 @@ -# -# MacOSX-specific packaging -# - -gcs: uavobjects - $(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@ - -ground_package: | gcs - -.PHONY: gcs ground_package diff --git a/shared/uavobjectdefinition/attitudesettings.xml b/shared/uavobjectdefinition/attitudesettings.xml index 808bbe80f..af89cc0d6 100644 --- a/shared/uavobjectdefinition/attitudesettings.xml +++ b/shared/uavobjectdefinition/attitudesettings.xml @@ -2,7 +2,7 @@ Settings for the @ref Attitude module used on CopterControl - +