From 94418fd7e78670a04ae7e5e3072f2eda80095a8f Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 20 Sep 2024 16:50:17 -0700 Subject: [PATCH 1/3] more --- board/drivers/gpio.h | 1 - board/drivers/usb_declarations.h | 17 ----------------- board/faults_declarations.h | 15 --------------- 3 files changed, 33 deletions(-) diff --git a/board/drivers/gpio.h b/board/drivers/gpio.h index 0b8fc091b1..386debe347 100644 --- a/board/drivers/gpio.h +++ b/board/drivers/gpio.h @@ -7,7 +7,6 @@ #define PULL_UP 1 #define PULL_DOWN 2 -#define OUTPUT_TYPE_PUSH_PULL 0U #define OUTPUT_TYPE_OPEN_DRAIN 1U typedef struct { diff --git a/board/drivers/usb_declarations.h b/board/drivers/usb_declarations.h index 77f6f5e816..d034d21459 100644 --- a/board/drivers/usb_declarations.h +++ b/board/drivers/usb_declarations.h @@ -30,16 +30,10 @@ void refresh_can_tx_slots_available(void); // **** supporting defines **** #define USB_REQ_GET_STATUS 0x00 -#define USB_REQ_CLEAR_FEATURE 0x01 -#define USB_REQ_SET_FEATURE 0x03 #define USB_REQ_SET_ADDRESS 0x05 #define USB_REQ_GET_DESCRIPTOR 0x06 -#define USB_REQ_SET_DESCRIPTOR 0x07 -#define USB_REQ_GET_CONFIGURATION 0x08 #define USB_REQ_SET_CONFIGURATION 0x09 -#define USB_REQ_GET_INTERFACE 0x0A #define USB_REQ_SET_INTERFACE 0x0B -#define USB_REQ_SYNCH_FRAME 0x0C #define USB_DESC_TYPE_DEVICE 0x01 #define USB_DESC_TYPE_CONFIGURATION 0x02 @@ -47,7 +41,6 @@ void refresh_can_tx_slots_available(void); #define USB_DESC_TYPE_INTERFACE 0x04 #define USB_DESC_TYPE_ENDPOINT 0x05 #define USB_DESC_TYPE_DEVICE_QUALIFIER 0x06 -#define USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION 0x07 #define USB_DESC_TYPE_BINARY_OBJECT_STORE 0x0f // offsets for configuration strings @@ -56,22 +49,12 @@ void refresh_can_tx_slots_available(void); #define STRING_OFFSET_IPRODUCT 0x02 #define STRING_OFFSET_ISERIAL 0x03 #define STRING_OFFSET_ICONFIGURATION 0x04 -#define STRING_OFFSET_IINTERFACE 0x05 - -// WebUSB requests -#define WEBUSB_REQ_GET_URL 0x02 - -// WebUSB types -#define WEBUSB_DESC_TYPE_URL 0x03 -#define WEBUSB_URL_SCHEME_HTTPS 0x01 -#define WEBUSB_URL_SCHEME_HTTP 0x00 // WinUSB requests #define WINUSB_REQ_GET_COMPATID_DESCRIPTOR 0x04 #define WINUSB_REQ_GET_EXT_PROPS_OS 0x05 #define WINUSB_REQ_GET_DESCRIPTOR 0x07 -#define STS_GOUT_NAK 1 #define STS_DATA_UPDT 2 #define STS_XFER_COMP 3 #define STS_SETUP_COMP 4 diff --git a/board/faults_declarations.h b/board/faults_declarations.h index 4ef03087ba..19cab4748c 100644 --- a/board/faults_declarations.h +++ b/board/faults_declarations.h @@ -11,26 +11,11 @@ #define FAULT_INTERRUPT_RATE_CAN_2 (1UL << 3) #define FAULT_INTERRUPT_RATE_CAN_3 (1UL << 4) #define FAULT_INTERRUPT_RATE_TACH (1UL << 5) -#define FAULT_INTERRUPT_RATE_GMLAN (1UL << 6) // deprecated #define FAULT_INTERRUPT_RATE_INTERRUPTS (1UL << 7) #define FAULT_INTERRUPT_RATE_SPI_DMA (1UL << 8) -#define FAULT_INTERRUPT_RATE_SPI_CS (1UL << 9) -#define FAULT_INTERRUPT_RATE_UART_1 (1UL << 10) -#define FAULT_INTERRUPT_RATE_UART_2 (1UL << 11) -#define FAULT_INTERRUPT_RATE_UART_3 (1UL << 12) -#define FAULT_INTERRUPT_RATE_UART_5 (1UL << 13) -#define FAULT_INTERRUPT_RATE_UART_DMA (1UL << 14) #define FAULT_INTERRUPT_RATE_USB (1UL << 15) -#define FAULT_INTERRUPT_RATE_TIM1 (1UL << 16) -#define FAULT_INTERRUPT_RATE_TIM3 (1UL << 17) #define FAULT_REGISTER_DIVERGENT (1UL << 18) -#define FAULT_INTERRUPT_RATE_KLINE_INIT (1UL << 19) -#define FAULT_INTERRUPT_RATE_CLOCK_SOURCE (1UL << 20) #define FAULT_INTERRUPT_RATE_TICK (1UL << 21) -#define FAULT_INTERRUPT_RATE_EXTI (1UL << 22) -#define FAULT_INTERRUPT_RATE_SPI (1UL << 23) -#define FAULT_INTERRUPT_RATE_UART_7 (1UL << 24) -#define FAULT_SIREN_MALFUNCTION (1UL << 25) #define FAULT_HEARTBEAT_LOOP_WATCHDOG (1UL << 26) // Permanent faults From 2b148c003d21dd9e970431a35953f81f701dd06c Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 20 Sep 2024 16:54:14 -0700 Subject: [PATCH 2/3] remove that --- board/faults_declarations.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/board/faults_declarations.h b/board/faults_declarations.h index 19cab4748c..4ef03087ba 100644 --- a/board/faults_declarations.h +++ b/board/faults_declarations.h @@ -11,11 +11,26 @@ #define FAULT_INTERRUPT_RATE_CAN_2 (1UL << 3) #define FAULT_INTERRUPT_RATE_CAN_3 (1UL << 4) #define FAULT_INTERRUPT_RATE_TACH (1UL << 5) +#define FAULT_INTERRUPT_RATE_GMLAN (1UL << 6) // deprecated #define FAULT_INTERRUPT_RATE_INTERRUPTS (1UL << 7) #define FAULT_INTERRUPT_RATE_SPI_DMA (1UL << 8) +#define FAULT_INTERRUPT_RATE_SPI_CS (1UL << 9) +#define FAULT_INTERRUPT_RATE_UART_1 (1UL << 10) +#define FAULT_INTERRUPT_RATE_UART_2 (1UL << 11) +#define FAULT_INTERRUPT_RATE_UART_3 (1UL << 12) +#define FAULT_INTERRUPT_RATE_UART_5 (1UL << 13) +#define FAULT_INTERRUPT_RATE_UART_DMA (1UL << 14) #define FAULT_INTERRUPT_RATE_USB (1UL << 15) +#define FAULT_INTERRUPT_RATE_TIM1 (1UL << 16) +#define FAULT_INTERRUPT_RATE_TIM3 (1UL << 17) #define FAULT_REGISTER_DIVERGENT (1UL << 18) +#define FAULT_INTERRUPT_RATE_KLINE_INIT (1UL << 19) +#define FAULT_INTERRUPT_RATE_CLOCK_SOURCE (1UL << 20) #define FAULT_INTERRUPT_RATE_TICK (1UL << 21) +#define FAULT_INTERRUPT_RATE_EXTI (1UL << 22) +#define FAULT_INTERRUPT_RATE_SPI (1UL << 23) +#define FAULT_INTERRUPT_RATE_UART_7 (1UL << 24) +#define FAULT_SIREN_MALFUNCTION (1UL << 25) #define FAULT_HEARTBEAT_LOOP_WATCHDOG (1UL << 26) // Permanent faults From b1ffee7abc9d076b0336c057b87b065e7694f5e2 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 20 Sep 2024 18:10:02 -0700 Subject: [PATCH 3/3] enum --- board/drivers/gpio.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/board/drivers/gpio.h b/board/drivers/gpio.h index 386debe347..236a746746 100644 --- a/board/drivers/gpio.h +++ b/board/drivers/gpio.h @@ -7,7 +7,10 @@ #define PULL_UP 1 #define PULL_DOWN 2 -#define OUTPUT_TYPE_OPEN_DRAIN 1U +enum { + OUTPUT_TYPE_PUSH_PULL = 0U, + OUTPUT_TYPE_OPEN_DRAIN = 1U, +}; typedef struct { GPIO_TypeDef * const bank;