Cleanup ENUM usage
This commit is contained in:
parent
8bb6903a01
commit
46387c9dbe
|
@ -27,7 +27,6 @@ typedef enum BlackboxDevice {
|
|||
BLACKBOX_DEVICE_SDCARD = 2,
|
||||
#endif
|
||||
|
||||
BLACKBOX_DEVICE_END
|
||||
} BlackboxDevice;
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -36,7 +36,7 @@ typedef enum {
|
|||
|
||||
typedef enum {
|
||||
AI_ROLL = 0,
|
||||
AI_PITCH,
|
||||
AI_PITCH
|
||||
} angle_index_t;
|
||||
|
||||
#define ANGLE_INDEX_COUNT 2
|
||||
|
|
|
@ -22,7 +22,7 @@ typedef uint16_t pgn_t;
|
|||
// parameter group registry flags
|
||||
typedef enum {
|
||||
PGRF_NONE = 0,
|
||||
PGRF_CLASSIFICATON_BIT = (1 << 0),
|
||||
PGRF_CLASSIFICATON_BIT = (1 << 0)
|
||||
} pgRegistryFlags_e;
|
||||
|
||||
typedef enum {
|
||||
|
@ -30,7 +30,7 @@ typedef enum {
|
|||
PGR_PGN_VERSION_MASK = 0xf000,
|
||||
PGR_SIZE_MASK = 0x0fff,
|
||||
PGR_SIZE_SYSTEM_FLAG = 0x0000, // documentary
|
||||
PGR_SIZE_PROFILE_FLAG = 0x8000, // start using flags from the top bit down
|
||||
PGR_SIZE_PROFILE_FLAG = 0x8000 // start using flags from the top bit down
|
||||
} pgRegistryInternal_e;
|
||||
|
||||
// function that resets a single parameter group instance
|
||||
|
|
|
@ -24,11 +24,9 @@ typedef enum {
|
|||
ADC_CURRENT = 1,
|
||||
ADC_EXTERNAL1 = 2,
|
||||
ADC_RSSI = 3,
|
||||
ADC_CHANNEL_MAX = ADC_RSSI
|
||||
ADC_CHANNEL_COUNT
|
||||
} AdcChannel;
|
||||
|
||||
#define ADC_CHANNEL_COUNT (ADC_CHANNEL_MAX + 1)
|
||||
|
||||
typedef struct adc_config_s {
|
||||
ioTag_t tag;
|
||||
uint8_t adcChannel; // ADC1_INxx channel number
|
||||
|
|
|
@ -31,16 +31,9 @@
|
|||
typedef enum ADCDevice {
|
||||
ADCINVALID = -1,
|
||||
ADCDEV_1 = 0,
|
||||
#if defined(STM32F3)
|
||||
#if defined(STM32F3) || defined(STM32F4) || defined(STM32F7)
|
||||
ADCDEV_2,
|
||||
ADCDEV_3,
|
||||
ADCDEV_MAX = ADCDEV_3,
|
||||
#elif defined(STM32F4) || defined(STM32F7)
|
||||
ADCDEV_2,
|
||||
ADCDEV_3,
|
||||
ADCDEV_MAX = ADCDEV_3,
|
||||
#else
|
||||
ADCDEV_MAX = ADCDEV_1,
|
||||
ADCDEV_3
|
||||
#endif
|
||||
} ADCDevice;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ typedef enum I2CDevice {
|
|||
I2CDEV_2,
|
||||
I2CDEV_3,
|
||||
I2CDEV_4,
|
||||
I2CDEV_MAX = I2CDEV_4,
|
||||
I2CDEV_COUNT
|
||||
} I2CDevice;
|
||||
|
||||
typedef struct i2cDevice_s {
|
||||
|
|
|
@ -80,7 +80,7 @@ static i2cDevice_t i2cHardwareMap[] = {
|
|||
typedef struct{
|
||||
I2C_HandleTypeDef Handle;
|
||||
}i2cHandle_t;
|
||||
static i2cHandle_t i2cHandle[I2CDEV_MAX+1];
|
||||
static i2cHandle_t i2cHandle[I2CDEV_COUNT];
|
||||
|
||||
void I2C1_ER_IRQHandler(void)
|
||||
{
|
||||
|
|
|
@ -46,17 +46,17 @@ typedef enum {
|
|||
SPI_CLOCK_SLOW = 128, //00.65625 MHz
|
||||
SPI_CLOCK_STANDARD = 8, //10.50000 MHz
|
||||
SPI_CLOCK_FAST = 4, //21.00000 MHz
|
||||
SPI_CLOCK_ULTRAFAST = 2, //42.00000 MHz
|
||||
SPI_CLOCK_ULTRAFAST = 2 //42.00000 MHz
|
||||
#elif defined(STM32F7)
|
||||
SPI_CLOCK_SLOW = 256, //00.42188 MHz
|
||||
SPI_CLOCK_STANDARD = 16, //06.57500 MHz
|
||||
SPI_CLOCK_FAST = 4, //27.00000 MHz
|
||||
SPI_CLOCK_ULTRAFAST = 2, //54.00000 MHz
|
||||
SPI_CLOCK_ULTRAFAST = 2 //54.00000 MHz
|
||||
#else
|
||||
SPI_CLOCK_SLOW = 128, //00.56250 MHz
|
||||
SPI_CLOCK_STANDARD = 4, //09.00000 MHz
|
||||
SPI_CLOCK_FAST = 2, //18.00000 MHz
|
||||
SPI_CLOCK_ULTRAFAST = 2, //18.00000 MHz
|
||||
SPI_CLOCK_ULTRAFAST = 2 //18.00000 MHz
|
||||
#endif
|
||||
} SPIClockDivider_e;
|
||||
|
||||
|
@ -65,8 +65,7 @@ typedef enum SPIDevice {
|
|||
SPIDEV_1 = 0,
|
||||
SPIDEV_2,
|
||||
SPIDEV_3,
|
||||
SPIDEV_4,
|
||||
SPIDEV_MAX = SPIDEV_4,
|
||||
SPIDEV_4
|
||||
} SPIDevice;
|
||||
|
||||
typedef struct SPIDevice_s {
|
||||
|
|
|
@ -20,8 +20,7 @@
|
|||
#include "io_types.h"
|
||||
|
||||
typedef enum softSPIDevice {
|
||||
SOFT_SPIDEV_1 = 0,
|
||||
SOFT_SPIDEV_MAX = SOFT_SPIDEV_1,
|
||||
SOFT_SPIDEV_1 = 0
|
||||
} softSPIDevice_e;
|
||||
|
||||
typedef struct softSPIDevice_s {
|
||||
|
|
|
@ -55,7 +55,7 @@ void pwmICConfig(TIM_TypeDef *tim, uint8_t channel, uint16_t polarity);
|
|||
|
||||
typedef enum {
|
||||
INPUT_MODE_PPM,
|
||||
INPUT_MODE_PWM,
|
||||
INPUT_MODE_PWM
|
||||
} pwmInputMode_t;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -7,7 +7,7 @@ enum rcc_reg {
|
|||
RCC_AHB,
|
||||
RCC_APB2,
|
||||
RCC_APB1,
|
||||
RCC_AHB1,
|
||||
RCC_AHB1
|
||||
};
|
||||
|
||||
#define RCC_ENCODE(reg, mask) (((reg) << 5) | LOG2_32BIT(mask))
|
||||
|
|
|
@ -106,7 +106,7 @@ enum {
|
|||
|
||||
NRF24L01_1D_FEATURE_EN_DPL = 2,
|
||||
NRF24L01_1D_FEATURE_EN_ACK_PAY = 1,
|
||||
NRF24L01_1D_FEATURE_EN_DYN_ACK = 0,
|
||||
NRF24L01_1D_FEATURE_EN_DYN_ACK = 0
|
||||
};
|
||||
|
||||
// Pre-shifted and combined bits
|
||||
|
@ -162,7 +162,7 @@ enum {
|
|||
NRF24L01_06_RF_SETUP_RF_PWR_n6dbm = 0x04,
|
||||
NRF24L01_06_RF_SETUP_RF_PWR_0dbm = 0x06,
|
||||
|
||||
NRF24L01_1C_DYNPD_ALL_PIPES = 0x3F,
|
||||
NRF24L01_1C_DYNPD_ALL_PIPES = 0x3F
|
||||
};
|
||||
|
||||
// Pipes
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
typedef enum {
|
||||
RX_SPI_SOFTSPI,
|
||||
RX_SPI_HARDSPI,
|
||||
RX_SPI_HARDSPI
|
||||
} rx_spi_type_e;
|
||||
|
||||
#define RX_SPI_MAX_PAYLOAD_SIZE 32
|
||||
|
|
|
@ -67,7 +67,7 @@ typedef enum {
|
|||
SDCARD_STATE_SENDING_WRITE,
|
||||
SDCARD_STATE_WAITING_FOR_WRITE,
|
||||
SDCARD_STATE_WRITING_MULTIPLE_BLOCKS,
|
||||
SDCARD_STATE_STOPPING_MULTIPLE_BLOCK_WRITE,
|
||||
SDCARD_STATE_STOPPING_MULTIPLE_BLOCK_WRITE
|
||||
} sdcardState_e;
|
||||
|
||||
typedef struct sdcard_t {
|
||||
|
@ -352,7 +352,7 @@ static bool sdcard_readOCRRegister(uint32_t *result)
|
|||
typedef enum {
|
||||
SDCARD_RECEIVE_SUCCESS,
|
||||
SDCARD_RECEIVE_BLOCK_IN_PROGRESS,
|
||||
SDCARD_RECEIVE_ERROR,
|
||||
SDCARD_RECEIVE_ERROR
|
||||
} sdcardReceiveBlockStatus_e;
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,7 +43,7 @@ typedef struct sdcardMetadata_s {
|
|||
typedef enum {
|
||||
SDCARD_BLOCK_OPERATION_READ,
|
||||
SDCARD_BLOCK_OPERATION_WRITE,
|
||||
SDCARD_BLOCK_OPERATION_ERASE,
|
||||
SDCARD_BLOCK_OPERATION_ERASE
|
||||
} sdcardBlockOperation_e;
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
typedef enum {
|
||||
BAUDRATE_NORMAL = 19200,
|
||||
BAUDRATE_KISS = 38400,
|
||||
BAUDRATE_CASTLE = 18880,
|
||||
BAUDRATE_CASTLE = 18880
|
||||
} escBaudRate_e;
|
||||
|
||||
typedef enum {
|
||||
|
@ -32,7 +32,7 @@ typedef enum {
|
|||
PROTOCOL_BLHELI = 1,
|
||||
PROTOCOL_KISS = 2,
|
||||
PROTOCOL_KISSALL = 3,
|
||||
PROTOCOL_CASTLE = 4,
|
||||
PROTOCOL_CASTLE = 4
|
||||
} escProtocol_e;
|
||||
|
||||
#if defined(USE_ESCSERIAL)
|
||||
|
|
|
@ -25,4 +25,8 @@ typedef struct vcdProfile_s {
|
|||
int8_t v_offset;
|
||||
} vcdProfile_t;
|
||||
|
||||
enum VIDEO_SYSTEMS { VIDEO_SYSTEM_AUTO = 0, VIDEO_SYSTEM_PAL, VIDEO_SYSTEM_NTSC };
|
||||
enum VIDEO_SYSTEMS {
|
||||
VIDEO_SYSTEM_AUTO = 0,
|
||||
VIDEO_SYSTEM_PAL,
|
||||
VIDEO_SYSTEM_NTSC
|
||||
};
|
||||
|
|
|
@ -55,7 +55,7 @@ typedef enum {
|
|||
FEATURE_VTX = 1 << 24,
|
||||
FEATURE_RX_SPI = 1 << 25,
|
||||
FEATURE_SOFTSPI = 1 << 26,
|
||||
FEATURE_ESC_TELEMETRY = 1 << 27,
|
||||
FEATURE_ESC_TELEMETRY = 1 << 27
|
||||
} features_e;
|
||||
|
||||
void beeperOffSet(uint32_t mask);
|
||||
|
|
|
@ -176,7 +176,7 @@ typedef enum {
|
|||
} mspSDCardState_e;
|
||||
|
||||
typedef enum {
|
||||
MSP_SDCARD_FLAG_SUPPORTTED = 1,
|
||||
MSP_SDCARD_FLAG_SUPPORTTED = 1
|
||||
} mspSDCardFlags_e;
|
||||
|
||||
#define RATEPROFILE_MASK (1 << 7)
|
||||
|
|
|
@ -207,8 +207,7 @@ typedef enum {
|
|||
ADJUSTMENT_RC_RATE_YAW,
|
||||
ADJUSTMENT_D_SETPOINT,
|
||||
ADJUSTMENT_D_SETPOINT_TRANSITION,
|
||||
ADJUSTMENT_FUNCTION_COUNT,
|
||||
|
||||
ADJUSTMENT_FUNCTION_COUNT
|
||||
} adjustmentFunction_e;
|
||||
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ typedef enum {
|
|||
PASSTHRU_MODE = (1 << 8),
|
||||
SONAR_MODE = (1 << 9),
|
||||
FAILSAFE_MODE = (1 << 10),
|
||||
GTUNE_MODE = (1 << 11),
|
||||
GTUNE_MODE = (1 << 11)
|
||||
} flightModeFlags_e;
|
||||
|
||||
extern uint16_t flightModeFlags;
|
||||
|
@ -57,7 +57,7 @@ typedef enum {
|
|||
GPS_FIX = (1 << 1),
|
||||
CALIBRATE_MAG = (1 << 2),
|
||||
SMALL_ANGLE = (1 << 3),
|
||||
FIXED_WING = (1 << 4), // set when in flying_wing or airplane mode. currently used by althold selection code
|
||||
FIXED_WING = (1 << 4) // set when in flying_wing or airplane mode. currently used by althold selection code
|
||||
} stateFlags_t;
|
||||
|
||||
#define DISABLE_STATE(mask) (stateFlags &= ~(mask))
|
||||
|
|
|
@ -35,7 +35,6 @@ enum {
|
|||
INPUT_RC_AUX4,
|
||||
INPUT_GIMBAL_PITCH,
|
||||
INPUT_GIMBAL_ROLL,
|
||||
|
||||
INPUT_SOURCE_COUNT
|
||||
} inputSource_e;
|
||||
|
||||
|
@ -59,8 +58,7 @@ typedef enum {
|
|||
SERVO_SINGLECOPTER_1 = 3,
|
||||
SERVO_SINGLECOPTER_2 = 4,
|
||||
SERVO_SINGLECOPTER_3 = 5,
|
||||
SERVO_SINGLECOPTER_4 = 6,
|
||||
|
||||
SERVO_SINGLECOPTER_4 = 6
|
||||
} servoIndex_e; // FIXME rename to servoChannel_e
|
||||
|
||||
#define SERVO_PLANE_INDEX_MIN SERVO_FLAPS
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
typedef enum {
|
||||
AFATFS_SAVE_DIRECTORY_NORMAL,
|
||||
AFATFS_SAVE_DIRECTORY_FOR_CLOSE,
|
||||
AFATFS_SAVE_DIRECTORY_DELETED,
|
||||
AFATFS_SAVE_DIRECTORY_DELETED
|
||||
} afatfsSaveDirectoryEntryMode_e;
|
||||
|
||||
typedef enum {
|
||||
|
@ -119,7 +119,7 @@ typedef enum {
|
|||
typedef enum {
|
||||
CLUSTER_SEARCH_FREE_AT_BEGINNING_OF_FAT_SECTOR,
|
||||
CLUSTER_SEARCH_FREE,
|
||||
CLUSTER_SEARCH_OCCUPIED,
|
||||
CLUSTER_SEARCH_OCCUPIED
|
||||
} afatfsClusterSearchCondition_e;
|
||||
|
||||
enum {
|
||||
|
@ -127,14 +127,14 @@ enum {
|
|||
AFATFS_CREATEFILE_PHASE_FIND_FILE,
|
||||
AFATFS_CREATEFILE_PHASE_CREATE_NEW_FILE,
|
||||
AFATFS_CREATEFILE_PHASE_SUCCESS,
|
||||
AFATFS_CREATEFILE_PHASE_FAILURE,
|
||||
AFATFS_CREATEFILE_PHASE_FAILURE
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
AFATFS_FIND_CLUSTER_IN_PROGRESS,
|
||||
AFATFS_FIND_CLUSTER_FOUND,
|
||||
AFATFS_FIND_CLUSTER_FATAL,
|
||||
AFATFS_FIND_CLUSTER_NOT_FOUND,
|
||||
AFATFS_FIND_CLUSTER_NOT_FOUND
|
||||
} afatfsFindClusterStatus_e;
|
||||
|
||||
struct afatfsFileOperation_t;
|
||||
|
@ -234,7 +234,7 @@ typedef enum {
|
|||
AFATFS_APPEND_SUPERCLUSTER_PHASE_INIT = 0,
|
||||
AFATFS_APPEND_SUPERCLUSTER_PHASE_UPDATE_FREEFILE_DIRECTORY,
|
||||
AFATFS_APPEND_SUPERCLUSTER_PHASE_UPDATE_FAT,
|
||||
AFATFS_APPEND_SUPERCLUSTER_PHASE_UPDATE_FILE_DIRECTORY,
|
||||
AFATFS_APPEND_SUPERCLUSTER_PHASE_UPDATE_FILE_DIRECTORY
|
||||
} afatfsAppendSuperclusterPhase_e;
|
||||
|
||||
typedef struct afatfsAppendSupercluster_t {
|
||||
|
@ -251,7 +251,7 @@ typedef enum {
|
|||
AFATFS_APPEND_FREE_CLUSTER_PHASE_UPDATE_FAT2,
|
||||
AFATFS_APPEND_FREE_CLUSTER_PHASE_UPDATE_FILE_DIRECTORY,
|
||||
AFATFS_APPEND_FREE_CLUSTER_PHASE_COMPLETE,
|
||||
AFATFS_APPEND_FREE_CLUSTER_PHASE_FAILURE,
|
||||
AFATFS_APPEND_FREE_CLUSTER_PHASE_FAILURE
|
||||
} afatfsAppendFreeClusterPhase_e;
|
||||
|
||||
typedef struct afatfsAppendFreeCluster_t {
|
||||
|
@ -286,7 +286,7 @@ typedef enum {
|
|||
AFATFS_TRUNCATE_FILE_ERASE_FAT_CHAIN_CONTIGUOUS,
|
||||
AFATFS_TRUNCATE_FILE_PREPEND_TO_FREEFILE,
|
||||
#endif
|
||||
AFATFS_TRUNCATE_FILE_SUCCESS,
|
||||
AFATFS_TRUNCATE_FILE_SUCCESS
|
||||
} afatfsTruncateFilePhase_e;
|
||||
|
||||
typedef struct afatfsTruncateFile_t {
|
||||
|
@ -299,7 +299,7 @@ typedef struct afatfsTruncateFile_t {
|
|||
|
||||
typedef enum {
|
||||
AFATFS_DELETE_FILE_DELETE_DIRECTORY_ENTRY,
|
||||
AFATFS_DELETE_FILE_DEALLOCATE_CLUSTERS,
|
||||
AFATFS_DELETE_FILE_DEALLOCATE_CLUSTERS
|
||||
} afatfsDeleteFilePhase_e;
|
||||
|
||||
typedef struct afatfsDeleteFile_t {
|
||||
|
@ -323,7 +323,7 @@ typedef enum {
|
|||
AFATFS_FILE_OPERATION_LOCKED,
|
||||
#endif
|
||||
AFATFS_FILE_OPERATION_APPEND_FREE_CLUSTER,
|
||||
AFATFS_FILE_OPERATION_EXTEND_SUBDIRECTORY,
|
||||
AFATFS_FILE_OPERATION_EXTEND_SUBDIRECTORY
|
||||
} afatfsFileOperation_e;
|
||||
|
||||
typedef struct afatfsFileOperation_t {
|
||||
|
|
|
@ -28,13 +28,13 @@ typedef enum {
|
|||
AFATFS_FILESYSTEM_STATE_UNKNOWN,
|
||||
AFATFS_FILESYSTEM_STATE_FATAL,
|
||||
AFATFS_FILESYSTEM_STATE_INITIALIZATION,
|
||||
AFATFS_FILESYSTEM_STATE_READY,
|
||||
AFATFS_FILESYSTEM_STATE_READY
|
||||
} afatfsFilesystemState_e;
|
||||
|
||||
typedef enum {
|
||||
AFATFS_OPERATION_IN_PROGRESS,
|
||||
AFATFS_OPERATION_SUCCESS,
|
||||
AFATFS_OPERATION_FAILURE,
|
||||
AFATFS_OPERATION_FAILURE
|
||||
} afatfsOperationStatus_e;
|
||||
|
||||
typedef enum {
|
||||
|
@ -54,7 +54,7 @@ typedef afatfsDirEntryPointer_t afatfsFinder_t;
|
|||
typedef enum {
|
||||
AFATFS_SEEK_SET,
|
||||
AFATFS_SEEK_CUR,
|
||||
AFATFS_SEEK_END,
|
||||
AFATFS_SEEK_END
|
||||
} afatfsSeek_e;
|
||||
|
||||
typedef void (*afatfsFileCallback_t)(afatfsFilePtr_t file);
|
||||
|
|
|
@ -54,7 +54,7 @@ typedef enum {
|
|||
FAT_FILESYSTEM_TYPE_INVALID,
|
||||
FAT_FILESYSTEM_TYPE_FAT12,
|
||||
FAT_FILESYSTEM_TYPE_FAT16,
|
||||
FAT_FILESYSTEM_TYPE_FAT32,
|
||||
FAT_FILESYSTEM_TYPE_FAT32
|
||||
} fatFilesystemType_e;
|
||||
|
||||
typedef struct mbrPartitionEntry_t {
|
||||
|
|
|
@ -43,7 +43,7 @@ typedef enum {
|
|||
BEEPER_USB, // Some boards have beeper powered USB connected
|
||||
|
||||
BEEPER_ALL, // Turn ON or OFF all beeper conditions
|
||||
BEEPER_PREFERENCE, // Save preferred beeper configuration
|
||||
BEEPER_PREFERENCE // Save preferred beeper configuration
|
||||
// BEEPER_ALL and BEEPER_PREFERENCE must remain at the bottom of this enum
|
||||
} beeperMode_e;
|
||||
|
||||
|
|
|
@ -503,7 +503,7 @@ int flashfsIdentifyStartOfFreeSpace()
|
|||
|
||||
/* We don't expect valid data to ever contain this many consecutive uint32_t's of all 1 bits: */
|
||||
FREE_BLOCK_TEST_SIZE_INTS = 4, // i.e. 16 bytes
|
||||
FREE_BLOCK_TEST_SIZE_BYTES = FREE_BLOCK_TEST_SIZE_INTS * sizeof(uint32_t),
|
||||
FREE_BLOCK_TEST_SIZE_BYTES = FREE_BLOCK_TEST_SIZE_INTS * sizeof(uint32_t)
|
||||
};
|
||||
|
||||
union {
|
||||
|
|
|
@ -175,7 +175,7 @@ typedef enum {
|
|||
GPS_CHANGE_BAUD,
|
||||
GPS_CONFIGURE,
|
||||
GPS_RECEIVING_DATA,
|
||||
GPS_LOST_COMMUNICATION,
|
||||
GPS_LOST_COMMUNICATION
|
||||
} gpsState_e;
|
||||
|
||||
gpsData_t gpsData;
|
||||
|
|
|
@ -51,7 +51,7 @@ typedef enum {
|
|||
|
||||
typedef enum {
|
||||
GPS_AUTOCONFIG_OFF = 0,
|
||||
GPS_AUTOCONFIG_ON,
|
||||
GPS_AUTOCONFIG_ON
|
||||
} gpsAutoConfig_e;
|
||||
|
||||
typedef enum {
|
||||
|
@ -78,11 +78,9 @@ typedef enum {
|
|||
GPS_MESSAGE_STATE_IDLE = 0,
|
||||
GPS_MESSAGE_STATE_INIT,
|
||||
GPS_MESSAGE_STATE_SBAS,
|
||||
GPS_MESSAGE_STATE_MAX = GPS_MESSAGE_STATE_SBAS
|
||||
GPS_MESSAGE_STATE_ENTRY_COUNT
|
||||
} gpsMessageState_e;
|
||||
|
||||
#define GPS_MESSAGE_STATE_ENTRY_COUNT (GPS_MESSAGE_STATE_MAX + 1)
|
||||
|
||||
typedef struct gpsData_s {
|
||||
uint8_t state; // GPS thread state. Used for detecting cable disconnects and configuring attached devices
|
||||
uint8_t baudrateIndex; // index into auto-detecting or current baudrate
|
||||
|
|
|
@ -114,7 +114,7 @@ typedef enum {
|
|||
COLOR_BLUE,
|
||||
COLOR_DARK_VIOLET,
|
||||
COLOR_MAGENTA,
|
||||
COLOR_DEEP_PINK,
|
||||
COLOR_DEEP_PINK
|
||||
} colorId_e;
|
||||
|
||||
const hsvColor_t hsv[] = {
|
||||
|
|
|
@ -108,7 +108,7 @@ typedef enum {
|
|||
LED_FUNCTION_BATTERY,
|
||||
LED_FUNCTION_RSSI,
|
||||
LED_FUNCTION_GPS,
|
||||
LED_FUNCTION_THRUST_RING,
|
||||
LED_FUNCTION_THRUST_RING
|
||||
} ledBaseFunctionId_e;
|
||||
|
||||
typedef enum {
|
||||
|
@ -117,7 +117,7 @@ typedef enum {
|
|||
LED_OVERLAY_BLINK,
|
||||
LED_OVERLAY_LANDING_FLASH,
|
||||
LED_OVERLAY_INDICATOR,
|
||||
LED_OVERLAY_WARNING,
|
||||
LED_OVERLAY_WARNING
|
||||
} ledOverlayId_e;
|
||||
|
||||
typedef struct modeColorIndexes_s {
|
||||
|
|
|
@ -37,7 +37,7 @@ typedef enum {
|
|||
FUNCTION_BLACKBOX = (1 << 7), // 128
|
||||
|
||||
FUNCTION_TELEMETRY_MAVLINK = (1 << 9), // 512
|
||||
FUNCTION_TELEMETRY_ESC = (1 << 10), // 1024
|
||||
FUNCTION_TELEMETRY_ESC = (1 << 10) // 1024
|
||||
} serialPortFunction_e;
|
||||
|
||||
typedef enum {
|
||||
|
@ -74,8 +74,7 @@ typedef enum {
|
|||
SERIAL_PORT_USART8,
|
||||
SERIAL_PORT_USB_VCP = 20,
|
||||
SERIAL_PORT_SOFTSERIAL1 = 30,
|
||||
SERIAL_PORT_SOFTSERIAL2,
|
||||
SERIAL_PORT_IDENTIFIER_MAX = SERIAL_PORT_SOFTSERIAL2
|
||||
SERIAL_PORT_SOFTSERIAL2
|
||||
} serialPortIdentifier_e;
|
||||
|
||||
extern const serialPortIdentifier_e serialPortIdentifiers[SERIAL_PORT_COUNT];
|
||||
|
|
|
@ -210,7 +210,7 @@ typedef enum {
|
|||
DUMP_ALL = (1 << 3),
|
||||
DO_DIFF = (1 << 4),
|
||||
SHOW_DEFAULTS = (1 << 5),
|
||||
HIDE_UNUSED = (1 << 6),
|
||||
HIDE_UNUSED = (1 << 6)
|
||||
} dumpFlags_e;
|
||||
|
||||
static const char* const emptyName = "-";
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
enum {
|
||||
RATE_LOW = 0,
|
||||
RATE_MID = 1,
|
||||
RATE_HIGH= 2,
|
||||
RATE_HIGH= 2
|
||||
};
|
||||
|
||||
#define FLAG_FLIP 0x10 // goes to rudder channel
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
enum {
|
||||
RATE_LOW = 0,
|
||||
RATE_MID = 1,
|
||||
RATE_HIGH = 2,
|
||||
RATE_HIGH = 2
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -97,7 +97,7 @@ enum {
|
|||
FLAG_PICTURE = 0x02,
|
||||
FLAG_VIDEO = 0x04,
|
||||
FLAG_RTH = 0x08,
|
||||
FLAG_HEADLESS = 0x10,
|
||||
FLAG_HEADLESS = 0x10
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
enum {
|
||||
RATE_LOW = 0,
|
||||
RATE_MID = 1,
|
||||
RATE_HIGH= 2,
|
||||
RATE_HIGH= 2
|
||||
};
|
||||
|
||||
#define FLAG_PICTURE 0x40
|
||||
|
|
|
@ -55,9 +55,7 @@ typedef enum {
|
|||
SERIALRX_XBUS_MODE_B_RJ01 = 6,
|
||||
SERIALRX_IBUS = 7,
|
||||
SERIALRX_JETIEXBUS = 8,
|
||||
SERIALRX_CRSF = 9,
|
||||
SERIALRX_PROVIDER_COUNT,
|
||||
SERIALRX_PROVIDER_MAX = SERIALRX_PROVIDER_COUNT - 1
|
||||
SERIALRX_CRSF = 9
|
||||
} SerialRXType;
|
||||
|
||||
#define MAX_SUPPORTED_RC_PPM_CHANNEL_COUNT 12
|
||||
|
@ -89,14 +87,14 @@ typedef enum {
|
|||
RX_FAILSAFE_MODE_AUTO = 0,
|
||||
RX_FAILSAFE_MODE_HOLD,
|
||||
RX_FAILSAFE_MODE_SET,
|
||||
RX_FAILSAFE_MODE_INVALID,
|
||||
RX_FAILSAFE_MODE_INVALID
|
||||
} rxFailsafeChannelMode_e;
|
||||
|
||||
#define RX_FAILSAFE_MODE_COUNT 3
|
||||
|
||||
typedef enum {
|
||||
RX_FAILSAFE_TYPE_FLIGHT = 0,
|
||||
RX_FAILSAFE_TYPE_AUX,
|
||||
RX_FAILSAFE_TYPE_AUX
|
||||
} rxFailsafeChannelType_e;
|
||||
|
||||
#define RX_FAILSAFE_TYPE_COUNT 2
|
||||
|
|
|
@ -32,8 +32,7 @@ typedef enum {
|
|||
ACC_MPU6000 = 7,
|
||||
ACC_MPU6500 = 8,
|
||||
ACC_ICM20689 = 9,
|
||||
ACC_FAKE = 10,
|
||||
ACC_MAX = ACC_FAKE
|
||||
ACC_FAKE = 10
|
||||
} accelerationSensor_e;
|
||||
|
||||
typedef struct acc_s {
|
||||
|
|
|
@ -24,8 +24,7 @@ typedef enum {
|
|||
BARO_NONE = 1,
|
||||
BARO_BMP085 = 2,
|
||||
BARO_MS5611 = 3,
|
||||
BARO_BMP280 = 4,
|
||||
BARO_MAX = BARO_BMP280
|
||||
BARO_BMP280 = 4
|
||||
} baroSensor_e;
|
||||
|
||||
#define BARO_SAMPLE_COUNT_MAX 48
|
||||
|
|
|
@ -31,15 +31,13 @@ typedef enum {
|
|||
CURRENT_SENSOR_NONE = 0,
|
||||
CURRENT_SENSOR_ADC,
|
||||
CURRENT_SENSOR_VIRTUAL,
|
||||
CURRENT_SENSOR_ESC,
|
||||
CURRENT_SENSOR_MAX = CURRENT_SENSOR_ESC
|
||||
CURRENT_SENSOR_ESC
|
||||
} currentSensor_e;
|
||||
|
||||
typedef enum {
|
||||
BATTERY_SENSOR_NONE = 0,
|
||||
BATTERY_SENSOR_ADC,
|
||||
BATTERY_SENSOR_ESC,
|
||||
BATTERY_SENSOR_MAX = BATTERY_SENSOR_ESC
|
||||
BATTERY_SENSOR_ESC
|
||||
} batterySensor_e;
|
||||
|
||||
typedef struct batteryConfig_s {
|
||||
|
|
|
@ -28,8 +28,7 @@ typedef enum {
|
|||
MAG_NONE = 1,
|
||||
MAG_HMC5883 = 2,
|
||||
MAG_AK8975 = 3,
|
||||
MAG_AK8963 = 4,
|
||||
MAG_MAX = MAG_AK8963
|
||||
MAG_AK8963 = 4
|
||||
} magSensor_e;
|
||||
|
||||
typedef struct mag_s {
|
||||
|
|
|
@ -31,8 +31,7 @@ typedef enum {
|
|||
GYRO_MPU6500,
|
||||
GYRO_MPU9250,
|
||||
GYRO_ICM20689,
|
||||
GYRO_FAKE,
|
||||
GYRO_MAX = GYRO_FAKE
|
||||
GYRO_FAKE
|
||||
} gyroSensor_e;
|
||||
|
||||
typedef struct gyro_s {
|
||||
|
|
|
@ -49,7 +49,7 @@ typedef enum {
|
|||
SENSOR_MAG = 1 << 3,
|
||||
SENSOR_SONAR = 1 << 4,
|
||||
SENSOR_GPS = 1 << 5,
|
||||
SENSOR_GPSMAG = 1 << 6,
|
||||
SENSOR_GPSMAG = 1 << 6
|
||||
} sensors_e;
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -36,8 +36,7 @@
|
|||
|
||||
typedef enum BSTDevice {
|
||||
BSTDEV_1,
|
||||
BSTDEV_2,
|
||||
BSTDEV_MAX = BSTDEV_2,
|
||||
BSTDEV_2
|
||||
} BSTDevice;
|
||||
|
||||
void bstInit(BSTDevice index);
|
||||
|
|
|
@ -196,13 +196,13 @@ void crsfFrameBatterySensor(sbuf_t *dst)
|
|||
|
||||
typedef enum {
|
||||
CRSF_ACTIVE_ANTENNA1 = 0,
|
||||
CRSF_ACTIVE_ANTENNA2 = 1,
|
||||
CRSF_ACTIVE_ANTENNA2 = 1
|
||||
} crsfActiveAntenna_e;
|
||||
|
||||
typedef enum {
|
||||
CRSF_RF_MODE_4_HZ = 0,
|
||||
CRSF_RF_MODE_50_HZ = 1,
|
||||
CRSF_RF_MODE_150_HZ = 2,
|
||||
CRSF_RF_MODE_150_HZ = 2
|
||||
} crsrRfMode_e;
|
||||
|
||||
typedef enum {
|
||||
|
@ -212,7 +212,7 @@ typedef enum {
|
|||
CRSF_RF_POWER_100_mW = 3,
|
||||
CRSF_RF_POWER_500_mW = 4,
|
||||
CRSF_RF_POWER_1000_mW = 5,
|
||||
CRSF_RF_POWER_2000_mW = 6,
|
||||
CRSF_RF_POWER_2000_mW = 6
|
||||
} crsrRfPower_e;
|
||||
|
||||
/*
|
||||
|
|
|
@ -26,8 +26,7 @@ typedef enum {
|
|||
CRSF_FRAME_ATTITUDE = CRSF_FRAME_START,
|
||||
CRSF_FRAME_BATTERY_SENSOR,
|
||||
CRSF_FRAME_FLIGHT_MODE,
|
||||
CRSF_FRAME_GPS,
|
||||
CRSF_FRAME_COUNT
|
||||
CRSF_FRAME_GPS
|
||||
} crsfFrameType_e;
|
||||
|
||||
void initCrsfTelemetry(void);
|
||||
|
|
|
@ -75,7 +75,7 @@ typedef enum {
|
|||
typedef enum {
|
||||
ESC_TLM_TRIGGER_WAIT = 0,
|
||||
ESC_TLM_TRIGGER_READY = 1 << 0, // 1
|
||||
ESC_TLM_TRIGGER_PENDING = 1 << 1, // 2
|
||||
ESC_TLM_TRIGGER_PENDING = 1 << 1 // 2
|
||||
} escTlmTriggerState_t;
|
||||
|
||||
#define ESC_TLM_BAUDRATE 115200
|
||||
|
|
|
@ -127,7 +127,7 @@ typedef enum {
|
|||
GPS_FIX_CHAR_NONE = '-',
|
||||
GPS_FIX_CHAR_2D = '2',
|
||||
GPS_FIX_CHAR_3D = '3',
|
||||
GPS_FIX_CHAR_DGPS = 'D',
|
||||
GPS_FIX_CHAR_DGPS = 'D'
|
||||
} gpsFixChar_e;
|
||||
|
||||
static void initialiseGPSMessage(HOTT_GPS_MSG_t *msg, size_t size)
|
||||
|
|
|
@ -55,7 +55,7 @@ typedef enum {
|
|||
HOTT_EAM_ALARM1_FLAG_TEMPERATURE_2 = (1 << 4),
|
||||
HOTT_EAM_ALARM1_FLAG_ALTITUDE = (1 << 5),
|
||||
HOTT_EAM_ALARM1_FLAG_CURRENT = (1 << 6),
|
||||
HOTT_EAM_ALARM1_FLAG_MAIN_VOLTAGE = (1 << 7),
|
||||
HOTT_EAM_ALARM1_FLAG_MAIN_VOLTAGE = (1 << 7)
|
||||
} hottEamAlarm1Flag_e;
|
||||
|
||||
typedef enum {
|
||||
|
@ -67,7 +67,7 @@ typedef enum {
|
|||
HOTT_EAM_ALARM2_FLAG_M3S_DUPLICATE = (1 << 4),
|
||||
HOTT_EAM_ALARM2_FLAG_UNKNOWN_1 = (1 << 5),
|
||||
HOTT_EAM_ALARM2_FLAG_UNKNOWN_2 = (1 << 6),
|
||||
HOTT_EAM_ALARM2_FLAG_ON_SIGN_OR_TEXT_ACTIVE = (1 << 7),
|
||||
HOTT_EAM_ALARM2_FLAG_ON_SIGN_OR_TEXT_ACTIVE = (1 << 7)
|
||||
} hottEamAlarm2Flag_e;
|
||||
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ enum
|
|||
SPSTATE_UNINITIALIZED,
|
||||
SPSTATE_INITIALIZED,
|
||||
SPSTATE_WORKING,
|
||||
SPSTATE_TIMEDOUT,
|
||||
SPSTATE_TIMEDOUT
|
||||
};
|
||||
|
||||
enum
|
||||
|
@ -83,7 +83,7 @@ enum
|
|||
FSSP_SENSOR_ID1 = 0x1B,
|
||||
FSSP_SENSOR_ID2 = 0x0D,
|
||||
FSSP_SENSOR_ID3 = 0x34,
|
||||
FSSP_SENSOR_ID4 = 0x67,
|
||||
FSSP_SENSOR_ID4 = 0x67
|
||||
// there are 32 ID's polled by smartport master
|
||||
// remaining 3 bits are crc (according to comments in openTx code)
|
||||
};
|
||||
|
@ -112,7 +112,7 @@ enum
|
|||
FSSP_DATAID_T2 = 0x0410 ,
|
||||
FSSP_DATAID_GPS_ALT = 0x0820 ,
|
||||
FSSP_DATAID_A3 = 0x0900 ,
|
||||
FSSP_DATAID_A4 = 0x0910 ,
|
||||
FSSP_DATAID_A4 = 0x0910
|
||||
};
|
||||
|
||||
const uint16_t frSkyDataIdTable[] = {
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
typedef enum
|
||||
{
|
||||
Mode_TEST = 0x0,
|
||||
Mode_Out_PP = 0x10,
|
||||
Mode_Out_PP = 0x10
|
||||
} GPIO_Mode;
|
||||
|
||||
typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
|
||||
|
|
Loading…
Reference in New Issue