cancel _MAX for numed enum

This commit is contained in:
lyon 2022-11-21 19:07:31 +08:00
parent 33501dbb33
commit 7e3c43dfa9
2 changed files with 12 additions and 22 deletions

View File

@ -72,23 +72,20 @@ typedef enum {
PIKA_HAL_UART_BAUDRATE_115200 = 115200,
PIKA_HAL_UART_BAUDRATE_2000000 = 2000000,
PIKA_HAL_UART_BAUDRATE_10000000 = 10000000,
_PIKA_HAL_UART_BAUDRATE_MAX,
} PIKA_HAL_UART_BAUDRATE;
typedef enum {
_PIKA_HAL_UART_DATA_BITS_UNUSED = 0,
PIKA_HAL_UART_DATA_BITS_5,
PIKA_HAL_UART_DATA_BITS_6,
PIKA_HAL_UART_DATA_BITS_7,
PIKA_HAL_UART_DATA_BITS_8,
_PIKA_HAL_UART_DATA_BITS_MAX,
PIKA_HAL_UART_DATA_BITS_5 = 5,
PIKA_HAL_UART_DATA_BITS_6 = 6,
PIKA_HAL_UART_DATA_BITS_7 = 7,
PIKA_HAL_UART_DATA_BITS_8 = 8,
} PIKA_HAL_UART_DATA_BITS;
typedef enum {
_PIKA_HAL_UART_STOP_BITS_UNUSED = 0,
PIKA_HAL_UART_STOP_BITS_1,
PIKA_HAL_UART_STOP_BITS_2,
_PIKA_HAL_UART_STOP_BITS_MAX,
PIKA_HAL_UART_STOP_BITS_1 = 1,
PIKA_HAL_UART_STOP_BITS_2 = 2,
} PIKA_HAL_UART_STOP_BITS;
typedef enum {
@ -148,7 +145,6 @@ typedef enum {
_PIKA_HAL_SPI_DATA_UNUSED = 0,
PIKA_HAL_SPI_DATA_WIDTH_8BIT = 8,
PIKA_HAL_SPI_DATA_WIDTH_16BIT = 16,
_PIKA_HAL_SPI_DATA_WIDTH_MAX,
} PIKA_HAL_SPI_DATA_WIDTH;
typedef enum {
@ -188,7 +184,6 @@ typedef enum {
PIKA_HAL_ADC_RESOLUTION_12BIT = 12,
PIKA_HAL_ADC_RESOLUTION_14BIT = 14,
PIKA_HAL_ADC_RESOLUTION_16BIT = 16,
_PIKA_HAL_ADC_RESOLUTION_MAX,
} PIKA_HAL_ADC_RESOLUTION;
typedef enum {

View File

@ -72,23 +72,20 @@ typedef enum {
PIKA_HAL_UART_BAUDRATE_115200 = 115200,
PIKA_HAL_UART_BAUDRATE_2000000 = 2000000,
PIKA_HAL_UART_BAUDRATE_10000000 = 10000000,
_PIKA_HAL_UART_BAUDRATE_MAX,
} PIKA_HAL_UART_BAUDRATE;
typedef enum {
_PIKA_HAL_UART_DATA_BITS_UNUSED = 0,
PIKA_HAL_UART_DATA_BITS_5,
PIKA_HAL_UART_DATA_BITS_6,
PIKA_HAL_UART_DATA_BITS_7,
PIKA_HAL_UART_DATA_BITS_8,
_PIKA_HAL_UART_DATA_BITS_MAX,
PIKA_HAL_UART_DATA_BITS_5 = 5,
PIKA_HAL_UART_DATA_BITS_6 = 6,
PIKA_HAL_UART_DATA_BITS_7 = 7,
PIKA_HAL_UART_DATA_BITS_8 = 8,
} PIKA_HAL_UART_DATA_BITS;
typedef enum {
_PIKA_HAL_UART_STOP_BITS_UNUSED = 0,
PIKA_HAL_UART_STOP_BITS_1,
PIKA_HAL_UART_STOP_BITS_2,
_PIKA_HAL_UART_STOP_BITS_MAX,
PIKA_HAL_UART_STOP_BITS_1 = 1,
PIKA_HAL_UART_STOP_BITS_2 = 2,
} PIKA_HAL_UART_STOP_BITS;
typedef enum {
@ -148,7 +145,6 @@ typedef enum {
_PIKA_HAL_SPI_DATA_UNUSED = 0,
PIKA_HAL_SPI_DATA_WIDTH_8BIT = 8,
PIKA_HAL_SPI_DATA_WIDTH_16BIT = 16,
_PIKA_HAL_SPI_DATA_WIDTH_MAX,
} PIKA_HAL_SPI_DATA_WIDTH;
typedef enum {
@ -188,7 +184,6 @@ typedef enum {
PIKA_HAL_ADC_RESOLUTION_12BIT = 12,
PIKA_HAL_ADC_RESOLUTION_14BIT = 14,
PIKA_HAL_ADC_RESOLUTION_16BIT = 16,
_PIKA_HAL_ADC_RESOLUTION_MAX,
} PIKA_HAL_ADC_RESOLUTION;
typedef enum {