From 3d821b8131f762836051b01bc8b2af145d99ebee Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 5 Sep 2013 22:32:13 +0200 Subject: [PATCH 1/3] Hotfix: Gain optimization --- ROMFS/px4fmu_common/init.d/10_dji_f330 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/10_dji_f330 b/ROMFS/px4fmu_common/init.d/10_dji_f330 index b8fe5fc31c..d21759507d 100644 --- a/ROMFS/px4fmu_common/init.d/10_dji_f330 +++ b/ROMFS/px4fmu_common/init.d/10_dji_f330 @@ -10,12 +10,12 @@ then # Set all params here, then disable autoconfig param set SYS_AUTOCONFIG 0 - param set MC_ATTRATE_D 0.004 + param set MC_ATTRATE_D 0.002 param set MC_ATTRATE_I 0.0 - param set MC_ATTRATE_P 0.12 + param set MC_ATTRATE_P 0.09 param set MC_ATT_D 0.0 param set MC_ATT_I 0.0 - param set MC_ATT_P 7.0 + param set MC_ATT_P 6.8 param set MC_YAWPOS_D 0.0 param set MC_YAWPOS_I 0.0 param set MC_YAWPOS_P 2.0 From 58adc7e40b886a9d5facd3aae61ec5d91e7f4cbf Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 6 Sep 2013 17:07:11 +0200 Subject: [PATCH 2/3] Make bool on FMUv1 and FMUv2 behave the same --- nuttx-configs/px4fmu-v1/nsh/defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuttx-configs/px4fmu-v1/nsh/defconfig b/nuttx-configs/px4fmu-v1/nsh/defconfig index 5be528f8c9..a1e128a400 100644 --- a/nuttx-configs/px4fmu-v1/nsh/defconfig +++ b/nuttx-configs/px4fmu-v1/nsh/defconfig @@ -712,7 +712,7 @@ CONFIG_SCHED_LPWORKSTACKSIZE=2048 # # Basic CXX Support # -# CONFIG_C99_BOOL8 is not set +CONFIG_C99_BOOL8=y CONFIG_HAVE_CXX=y CONFIG_HAVE_CXXINITIALIZE=y # CONFIG_CXX_NEWLONG is not set From 23a355644b69585d11011954f1d4cbc9e04a8f3b Mon Sep 17 00:00:00 2001 From: tstellanova Date: Fri, 6 Sep 2013 10:18:08 -0700 Subject: [PATCH 3/3] grab the git hash and inject it into every log file header --- Makefile | 11 +++++++++++ makefiles/firmware.mk | 8 ++++++++ src/modules/sdlog2/sdlog2_messages.h | 19 +++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/Makefile b/Makefile index 83a6f3ce9f..0a85622512 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,17 @@ export PX4_BASE := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))/ include $(PX4_BASE)makefiles/setup.mk +# +# Get a version string provided by git +# This assumes that git command is available and that +# the directory holding this file also contains .git directory +# +GIT_DESC := $(shell git log -1 --pretty=format:%H) +ifneq ($(words $(GIT_DESC)),1) + GIT_DESC := "unknown_git_version" +endif +export GIT_DESC + # # Canned firmware configurations that we (know how to) build. # diff --git a/makefiles/firmware.mk b/makefiles/firmware.mk index b3e50501c7..cb20d9cd19 100644 --- a/makefiles/firmware.mk +++ b/makefiles/firmware.mk @@ -110,6 +110,8 @@ ifneq ($(words $(PX4_BASE)),1) $(error Cannot build when the PX4_BASE path contains one or more space characters.) endif +$(info % GIT_DESC = $(GIT_DESC)) + # # Set a default target so that included makefiles or errors here don't # cause confusion. @@ -177,6 +179,12 @@ GLOBAL_DEPS += $(MAKEFILE_LIST) # EXTRA_CLEANS = + +# +# Extra defines for compilation +# +export EXTRADEFINES := -DGIT_VERSION=$(GIT_DESC) + # # Append the per-board driver directory to the header search path. # diff --git a/src/modules/sdlog2/sdlog2_messages.h b/src/modules/sdlog2/sdlog2_messages.h index 4eeb65a87e..1343bb3d0e 100644 --- a/src/modules/sdlog2/sdlog2_messages.h +++ b/src/modules/sdlog2/sdlog2_messages.h @@ -250,8 +250,26 @@ struct log_GVSP_s { float vz; }; +/* --- FWRV - FIRMWARE REVISION --- */ +#define LOG_FWRV_MSG 20 +struct log_FWRV_s { + char fw_revision[64]; +}; + #pragma pack(pop) + +/* + GIT_VERSION is defined at build time via a Makefile call to the + git command line. We create a fake log message format for + the firmware revision "FWRV" that is written to every log + header. This makes it easier to determine which version + of the firmware was running when a log was created. + */ +#define FREEZE_STR(s) #s +#define STRINGIFY(s) FREEZE_STR(s) +#define FW_VERSION_STR STRINGIFY(GIT_VERSION) + /* construct list of all message formats */ static const struct log_format_s log_formats[] = { @@ -274,6 +292,7 @@ static const struct log_format_s log_formats[] = { LOG_FORMAT(GPSP, "BLLfffbBffff", "AltRel,Lat,Lon,Alt,Yaw,LoiterR,LoiterDir,NavCmd,P1,P2,P3,P4"), LOG_FORMAT(ESC, "HBBBHHHHHHfH", "Counter,NumESC,Conn,N,Ver,Adr,Volt,Amp,RPM,Temp,SetP,SetPRAW"), LOG_FORMAT(GVSP, "fff", "VX,VY,VZ"), + LOG_FORMAT(FWRV,"Z",FW_VERSION_STR), }; static const int log_formats_num = sizeof(log_formats) / sizeof(struct log_format_s);