AP_BoardConfig: added BRD_IO_ENABLE parameter

allow for px4io to be disabled completely
This commit is contained in:
Andrew Tridgell 2017-03-10 10:43:10 +11:00
parent acaef22416
commit c118deccb0
3 changed files with 14 additions and 1 deletions

View File

@ -165,6 +165,16 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = {
AP_GROUPINFO("TYPE", 9, AP_BoardConfig, px4.board_type, BOARD_TYPE_DEFAULT),
#endif
#if HAL_PX4_HAVE_PX4IO
// @Param: BRD_IO_ENABLE
// @DisplayName: Enable IO co-processor
// @Description: This allows for the IO co-processor on FMUv1 and FMUv2 to be disabled
// @Values: 0:Disabled,1:Enabled
// @RebootRequired: True
// @User: Advanced
AP_GROUPINFO("IO_ENABLE", 10, AP_BoardConfig, px4.io_enable, 1),
#endif
AP_GROUPEND
};

View File

@ -88,6 +88,7 @@ private:
AP_Int8 sbus_out_rate;
#endif
AP_Int8 board_type;
AP_Int8 io_enable;
} px4;
static enum px4_board_type px4_configured_board;

View File

@ -412,7 +412,9 @@ void AP_BoardConfig::px4_setup_peripherals(void)
}
#if HAL_PX4_HAVE_PX4IO
if (px4.io_enable.get() != 0) {
px4_setup_px4io();
}
#endif
#if defined(CONFIG_ARCH_BOARD_PX4FMU_V1)