From 88e24dd8bdf3f36b0e66a33c6680f1eda9b000c5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 4 Nov 2016 17:57:28 +1100 Subject: [PATCH] AP_BoardConfig: added board type 103 for PH2 in-tree drivers --- libraries/AP_BoardConfig/AP_BoardConfig.h | 1 + libraries/AP_BoardConfig/px4_drivers.cpp | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/libraries/AP_BoardConfig/AP_BoardConfig.h b/libraries/AP_BoardConfig/AP_BoardConfig.h index d82fc792ee..0ced0a5814 100644 --- a/libraries/AP_BoardConfig/AP_BoardConfig.h +++ b/libraries/AP_BoardConfig/AP_BoardConfig.h @@ -57,6 +57,7 @@ public: #endif PX4_BOARD_TEST_V1 = 101, PX4_BOARD_TEST_V2 = 102, + PX4_BOARD_TEST_V3 = 103, PX4_BOARD_TEST_V4 = 104, }; #endif diff --git a/libraries/AP_BoardConfig/px4_drivers.cpp b/libraries/AP_BoardConfig/px4_drivers.cpp index 2833bd2e39..18b9d89f1f 100644 --- a/libraries/AP_BoardConfig/px4_drivers.cpp +++ b/libraries/AP_BoardConfig/px4_drivers.cpp @@ -492,17 +492,6 @@ void AP_BoardConfig::px4_start_fmuv4_sensors(void) */ void AP_BoardConfig::px4_start_common_sensors(void) { -#if defined(CONFIG_ARCH_BOARD_PX4FMU_V4) - /* - this works around an issue with some FMUv4 hardware (eg. copies - of the Pixracer) which have incorrect components leading to - sensor brownout on boot - */ - if (px4_start_driver(fmu_main, "fmu", "sensor_reset 20")) { - printf("FMUv4 sensor reset complete\n"); - } -#endif - if (px4_start_driver(ms5611_main, "ms5611", "start")) { printf("ms5611 started OK\n"); } else { @@ -673,8 +662,20 @@ void AP_BoardConfig::vrx_start_optional_sensors(void) void AP_BoardConfig::px4_setup_drivers(void) { +#if defined(CONFIG_ARCH_BOARD_PX4FMU_V4) + /* + this works around an issue with some FMUv4 hardware (eg. copies + of the Pixracer) which have incorrect components leading to + sensor brownout on boot + */ + if (px4_start_driver(fmu_main, "fmu", "sensor_reset 20")) { + printf("FMUv4 sensor reset complete\n"); + } +#endif + if (px4.board_type == PX4_BOARD_TEST_V1 || px4.board_type == PX4_BOARD_TEST_V2 || + px4.board_type == PX4_BOARD_TEST_V3 || px4.board_type == PX4_BOARD_TEST_V4) { // use in-tree drivers printf("Using in-tree drivers\n");