From b96ed557a98d217c9f9fe1bf26de6378b7042709 Mon Sep 17 00:00:00 2001 From: Bruce Luckcuck Date: Sat, 16 Feb 2019 18:38:05 -0500 Subject: [PATCH] Fix arming disabled flags count Changed to being based on the required last entry `ARMING_DISABLED_ARM_SWITCH` in the flags enumeration so that future changes to the flags won't require updating the count. --- src/main/fc/runtime_config.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/fc/runtime_config.h b/src/main/fc/runtime_config.h index 5e864b5d83..612b8f246c 100644 --- a/src/main/fc/runtime_config.h +++ b/src/main/fc/runtime_config.h @@ -20,6 +20,8 @@ #pragma once +#include "common/utils.h" + // FIXME some of these are flight modes, some of these are general status indicators typedef enum { ARMED = (1 << 0), @@ -60,7 +62,7 @@ typedef enum { ARMING_DISABLED_ARM_SWITCH = (1 << 19), // Needs to be the last element, since it's always activated if one of the others is active when arming } armingDisableFlags_e; -#define ARMING_DISABLE_FLAGS_COUNT 21 +#define ARMING_DISABLE_FLAGS_COUNT (LOG2(ARMING_DISABLED_ARM_SWITCH) + 1) extern const char *armingDisableFlagNames[ARMING_DISABLE_FLAGS_COUNT];