Skip to content

Commit

Permalink
AP_BoardConfig: add arm/disarm controlled GPIO for module power control
Browse files Browse the repository at this point in the history
  • Loading branch information
Hwurzburg authored and tridge committed Nov 18, 2023
1 parent fffe3af commit 176a4aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libraries/AP_BoardConfig/AP_BoardConfig.cpp
Expand Up @@ -289,7 +289,7 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = {
// @Param: OPTIONS
// @DisplayName: Board options
// @Description: Board specific option flags
// @Bitmask: 0:Enable hardware watchdog, 1:Disable MAVftp, 2:Enable set of internal parameters, 3:Enable Debug Pins, 4:Unlock flash on reboot, 5:Write protect firmware flash on reboot, 6:Write protect bootloader flash on reboot, 7:Skip board validation
// @Bitmask: 0:Enable hardware watchdog, 1:Disable MAVftp, 2:Enable set of internal parameters, 3:Enable Debug Pins, 4:Unlock flash on reboot, 5:Write protect firmware flash on reboot, 6:Write protect bootloader flash on reboot, 7:Skip board validation, 8:Disable board arming gpio output change on arm/disarm
// @User: Advanced
AP_GROUPINFO("OPTIONS", 19, AP_BoardConfig, _options, HAL_BRD_OPTIONS_DEFAULT),

Expand Down
12 changes: 11 additions & 1 deletion libraries/AP_BoardConfig/AP_BoardConfig.h
Expand Up @@ -155,9 +155,19 @@ class AP_BoardConfig {
UNLOCK_FLASH = (1<<4),
WRITE_PROTECT_FLASH = (1<<5),
WRITE_PROTECT_BOOTLOADER = (1<<6),
SKIP_BOARD_VALIDATION = (1<<7)
SKIP_BOARD_VALIDATION = (1<<7),
DISABLE_ARMING_GPIO = (1<<8)
};

//return true if arming gpio output is disabled
static bool arming_gpio_disabled(void) {
return _singleton?(_singleton->_options & DISABLE_ARMING_GPIO)!=0:1;
}

#ifndef HAL_ARM_GPIO_POL_INVERT
#define HAL_ARM_GPIO_POL_INVERT 0
#endif

// return true if ftp is disabled
static bool ftp_disabled(void) {
return _singleton?(_singleton->_options & DISABLE_FTP)!=0:1;
Expand Down

0 comments on commit 176a4aa

Please sign in to comment.