Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uncrustify: update config file and run uncrustify #183

Merged
merged 6 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions include/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@
#define ACCESS_ONCE(x) (*(volatile __typeof(x) *)&(x))

#define WRITE_ONCE(x,v) \
do { \
barrier(); \
ACCESS_ONCE(x) = (v); \
barrier(); \
} while (0)
do { \
barrier(); \
ACCESS_ONCE(x) = (v); \
barrier(); \
} while (0)

#define READ_ONCE(x) \
({ \
({ \
__typeof(x) __var = ({ \
barrier(); \
ACCESS_ONCE(x); \
Expand All @@ -77,21 +77,21 @@
#define sizeof_field(_s, _m) sizeof(((_s *)0)->_m)

#define container_of(ptr, type, member) \
({ \
({ \
__typeof(((type *)0)->member) *_p = (ptr); \
(type *)((char *)_p - offsetof(type, member)); \
})

#define struct_size(ptr, field, num) \
(offsetof(__typeof(*(ptr)), field) + sizeof((ptr)->field[0]) * (num))
(offsetof(__typeof(*(ptr)), field) + sizeof((ptr)->field[0]) * (num))

#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))

#define DECLARE_FLEX_ARRAY(_t, _n) \
struct { \
struct { } __dummy_ ## _n; \
_t _n[0]; \
}
struct { \
struct { } __dummy_ ## _n; \
_t _n[0]; \
}

#define min(x, y) ((x) < (y) ? (x) : (y))
#define max(x, y) ((x) > (y) ? (x) : (y))
Expand Down
258 changes: 115 additions & 143 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,15 @@ THE SOFTWARE.
#define CAN_CLOCK_SPEED 48000000
#define NUM_CAN_CHANNEL 1

// SILENT pin not connected

#define LEDRX_GPIO_Port GPIOA
#define LEDRX_Pin GPIO_PIN_1
#define LEDRX_Mode GPIO_MODE_OUTPUT_OD
#define LEDRX_Active_High 0
#define LEDRX_GPIO_Port GPIOA
#define LEDRX_Pin GPIO_PIN_1
#define LEDRX_Mode GPIO_MODE_OUTPUT_OD
#define LEDRX_Active_High 0

#define LEDTX_GPIO_Port GPIOA
#define LEDTX_Pin GPIO_PIN_0
#define LEDTX_Mode GPIO_MODE_OUTPUT_OD
#define LEDTX_Active_High 0
#define LEDTX_GPIO_Port GPIOA
#define LEDTX_Pin GPIO_PIN_0
#define LEDTX_Mode GPIO_MODE_OUTPUT_OD
#define LEDTX_Active_High 0

#elif defined(BOARD_CONVERTDEVICE_xCAN)
#define USBD_PRODUCT_STRING_FS (uint8_t*) "ConvertDevice xCAN"
Expand All @@ -106,17 +104,15 @@ THE SOFTWARE.
#define CAN_CLOCK_SPEED 48000000
#define NUM_CAN_CHANNEL 1

// SILENT pin not connected

#define LEDRX_GPIO_Port GPIOA
#define LEDRX_Pin GPIO_PIN_0
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 0
#define LEDRX_GPIO_Port GPIOA
#define LEDRX_Pin GPIO_PIN_0
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 0

#define LEDTX_GPIO_Port GPIOA
#define LEDTX_Pin GPIO_PIN_1
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 0
#define LEDTX_GPIO_Port GPIOA
#define LEDTX_Pin GPIO_PIN_1
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 0

#elif defined(BOARD_CONVERTDEVICE_xCANFD)
#define USBD_PRODUCT_STRING_FS (uint8_t*) "ConvertDevice xCANFD"
Expand All @@ -128,21 +124,21 @@ THE SOFTWARE.
#define CAN_INTERFACE FDCAN1
#define CAN_CLOCK_SPEED 64000000
#define NUM_CAN_CHANNEL 1
#define CONFIG_CANFD
#define CONFIG_CANFD 1

#define LEDRX_GPIO_Port GPIOA
#define LEDRX_Pin GPIO_PIN_0
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 0
#define LEDRX_GPIO_Port GPIOA
#define LEDRX_Pin GPIO_PIN_0
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 0

#define LEDTX_GPIO_Port GPIOA
#define LEDTX_Pin GPIO_PIN_1
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 0
#define LEDTX_GPIO_Port GPIOA
#define LEDTX_Pin GPIO_PIN_1
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 0

#define USB_GPIO_Port GPIOA
#define USB_Pin_DM GPIO_PIN_11
#define USB_Pin_DP GPIO_PIN_12
#define USB_GPIO_Port GPIOA
#define USB_Pin_DM GPIO_PIN_11
#define USB_Pin_DP GPIO_PIN_12

#elif defined(BOARD_DSD_TECH_SH_C30A)
#define USBD_PRODUCT_STRING_FS (uint8_t*) "SH-C30A USB to CAN adapter"
Expand All @@ -155,17 +151,15 @@ THE SOFTWARE.
#define CAN_CLOCK_SPEED 48000000
#define NUM_CAN_CHANNEL 1

// SILENT pin not connected

#define LEDRX_GPIO_Port GPIOB
#define LEDRX_Pin GPIO_PIN_1
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 0
#define LEDRX_GPIO_Port GPIOB
#define LEDRX_Pin GPIO_PIN_1
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 0

#define LEDTX_GPIO_Port GPIOB
#define LEDTX_Pin GPIO_PIN_0
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 0
#define LEDTX_GPIO_Port GPIOB
#define LEDTX_Pin GPIO_PIN_0
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 0

#elif defined(BOARD_FYSETC_UCAN)
#define USBD_PRODUCT_STRING_FS (uint8_t*) "UCAN USB to CAN adapter"
Expand All @@ -178,17 +172,15 @@ THE SOFTWARE.
#define CAN_CLOCK_SPEED 48000000
#define NUM_CAN_CHANNEL 1

// SILENT pin not connected

#define LEDRX_GPIO_Port GPIOA
#define LEDRX_Pin GPIO_PIN_1
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 1
#define LEDRX_GPIO_Port GPIOA
#define LEDRX_Pin GPIO_PIN_1
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 1

#define LEDTX_GPIO_Port GPIOA
#define LEDTX_Pin GPIO_PIN_0
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 1
#define LEDTX_GPIO_Port GPIOA
#define LEDTX_Pin GPIO_PIN_0
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 1

#elif defined(BOARD_cantact)
#define USBD_PRODUCT_STRING_FS (uint8_t*) "cantact gs_usb"
Expand All @@ -201,17 +193,15 @@ THE SOFTWARE.
#define CAN_CLOCK_SPEED 48000000
#define NUM_CAN_CHANNEL 1

// SILENT pin not connected
#define LEDRX_GPIO_Port GPIOB
#define LEDRX_Pin GPIO_PIN_0 /* green */
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 1

#define LEDRX_GPIO_Port GPIOB
#define LEDRX_Pin GPIO_PIN_0 /* green */
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 1

#define LEDTX_GPIO_Port GPIOB
#define LEDTX_Pin GPIO_PIN_1 /* red */
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 1
#define LEDTX_GPIO_Port GPIOB
#define LEDTX_Pin GPIO_PIN_1 /* red */
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 1

#elif defined(BOARD_canable)
#define USBD_PRODUCT_STRING_FS (uint8_t*) "canable gs_usb"
Expand All @@ -224,17 +214,15 @@ THE SOFTWARE.
#define CAN_CLOCK_SPEED 48000000
#define NUM_CAN_CHANNEL 1

// SILENT pin not connected

#define LEDRX_GPIO_Port GPIOB
#define LEDRX_Pin GPIO_PIN_0 /* green */
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 1
#define LEDRX_GPIO_Port GPIOB
#define LEDRX_Pin GPIO_PIN_0 /* green */
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 1

#define LEDTX_GPIO_Port GPIOB
#define LEDTX_Pin GPIO_PIN_1 /* blue */
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 0
#define LEDTX_GPIO_Port GPIOB
#define LEDTX_Pin GPIO_PIN_1 /* blue */
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 0

#elif defined(BOARD_usb2can)
#define USBD_PRODUCT_STRING_FS (uint8_t*) "USB2CAN RCA gs_usb"
Expand All @@ -247,27 +235,15 @@ THE SOFTWARE.
#define CAN_CLOCK_SPEED 48000000
#define NUM_CAN_CHANNEL 1

// SILENT pin not connected

#define LED4_GPIO_Port GPIOA
#define LED4_Pin GPIO_PIN_0 /* white */
#define LED4_Mode GPIO_MODE_OUTPUT_OD
#define LED4_Active_Low

#define LEDTX_GPIO_Port GPIOA
#define LEDTX_Pin GPIO_PIN_1 /* blue */
#define LEDTX_Mode GPIO_MODE_OUTPUT_OD
#define LEDTX_Active_High 0

#define LED3_GPIO_Port GPIOA
#define LED3_Pin GPIO_PIN_2 /* red */
#define LED3_Mode GPIO_MODE_OUTPUT_OD
#define LED3_Active_Low
#define LEDTX_GPIO_Port GPIOA
#define LEDTX_Pin GPIO_PIN_1 /* blue */
#define LEDTX_Mode GPIO_MODE_OUTPUT_OD
#define LEDTX_Active_High 0

#define LEDRX_GPIO_Port GPIOB
#define LEDRX_Pin GPIO_PIN_3 /* green */
#define LEDRX_Mode GPIO_MODE_OUTPUT_OD
#define LEDRX_Active_High 0
#define LEDRX_GPIO_Port GPIOB
#define LEDRX_Pin GPIO_PIN_3 /* green */
#define LEDRX_Mode GPIO_MODE_OUTPUT_OD
#define LEDRX_Active_High 0

#elif defined(BOARD_canalyze)
#define USBD_PRODUCT_STRING_FS (uint8_t*) "CANAlyze gs_usb"
Expand All @@ -280,17 +256,15 @@ THE SOFTWARE.
#define CAN_CLOCK_SPEED 48000000
#define NUM_CAN_CHANNEL 1

// SILENT pin not connected

#define LEDRX_GPIO_Port GPIOB
#define LEDRX_Pin GPIO_PIN_0 /* green */
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 1
#define LEDRX_GPIO_Port GPIOB
#define LEDRX_Pin GPIO_PIN_0 /* green */
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 1

#define LEDTX_GPIO_Port GPIOB
#define LEDTX_Pin GPIO_PIN_1 /* red */
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 1
#define LEDTX_GPIO_Port GPIOB
#define LEDTX_Pin GPIO_PIN_1 /* red */
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 1

#elif defined(BOARD_cannette)
#define USBD_PRODUCT_STRING_FS (uint8_t*) "cannette gs_usb"
Expand All @@ -303,27 +277,25 @@ THE SOFTWARE.
#define CAN_CLOCK_SPEED 48000000
#define NUM_CAN_CHANNEL 1

// SILENT pin not connected

#define LEDRX_GPIO_Port GPIOA
#define LEDRX_Pin GPIO_PIN_9 /* RX: green */
#define LEDRX_Mode GPIO_MODE_OUTPUT_OD
#define LEDRX_Active_High 0
#define LEDRX_GPIO_Port GPIOA
#define LEDRX_Pin GPIO_PIN_9 /* RX: green */
#define LEDRX_Mode GPIO_MODE_OUTPUT_OD
#define LEDRX_Active_High 0

#define LEDTX_GPIO_Port GPIOA
#define LEDTX_Pin GPIO_PIN_8 /* TX: red */
#define LEDTX_Mode GPIO_MODE_OUTPUT_OD
#define LEDTX_Active_High 0
#define LEDTX_GPIO_Port GPIOA
#define LEDTX_Pin GPIO_PIN_8 /* TX: red */
#define LEDTX_Mode GPIO_MODE_OUTPUT_OD
#define LEDTX_Active_High 0

#define nCANSTBY_Port GPIOC
#define nCANSTBY_Pin GPIO_PIN_14 /* control xceiver standby, active low */
#define nCANSTBY_Active_High 1
#define nCANSTBY_Port GPIOC
#define nCANSTBY_Pin GPIO_PIN_14 /* control xceiver standby, active low */
#define nCANSTBY_Active_High 1

#define nSI86EN_Port GPIOC
#define nSI86EN_Pin GPIO_PIN_13 /* enable power to Si86xx isolater, active low */
#define nSI86EN_Port GPIOC
#define nSI86EN_Pin GPIO_PIN_13 /* enable power to Si86xx isolater, active low */

#define DCDCEN_Port GPIOC
#define DCDCEN_Pin GPIO_PIN_15 /* activate DCDC converter, active high */
#define DCDCEN_Port GPIOC
#define DCDCEN_Pin GPIO_PIN_15 /* activate DCDC converter, active high */

#elif defined(BOARD_budgetcan)
#define USBD_PRODUCT_STRING_FS (uint8_t*) "budgetcan gs_usb"
Expand All @@ -336,30 +308,30 @@ THE SOFTWARE.
#define CAN_INTERFACE2 FDCAN2
#define CAN_CLOCK_SPEED 64000000
#define NUM_CAN_CHANNEL 2
#define CONFIG_CANFD

#define nCANSTBY_Port GPIOA
#define nCANSTBY_Pin GPIO_PIN_0 /* control xceiver standby, active low */
#define nCANSTBY_Active_High 0

#define LEDRX_GPIO_Port GPIOB
#define LEDRX_Pin GPIO_PIN_4
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 1

#define LEDTX_GPIO_Port GPIOB
#define LEDTX_Pin GPIO_PIN_3
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 1

#define USB_GPIO_Port GPIOA
#define USB_Pin_DM GPIO_PIN_11
#define USB_Pin_DP GPIO_PIN_12

#define TERM_GPIO_Port GPIOA
#define TERM_Pin GPIO_PIN_1
#define TERM_Mode GPIO_MODE_OUTPUT_PP
#define TERM_Active_High 1
#define CONFIG_CANFD 1

#define nCANSTBY_Port GPIOA
#define nCANSTBY_Pin GPIO_PIN_0 /* control xceiver standby, active low */
#define nCANSTBY_Active_High 0

#define LEDRX_GPIO_Port GPIOB
#define LEDRX_Pin GPIO_PIN_4
#define LEDRX_Mode GPIO_MODE_OUTPUT_PP
#define LEDRX_Active_High 1

#define LEDTX_GPIO_Port GPIOB
#define LEDTX_Pin GPIO_PIN_3
#define LEDTX_Mode GPIO_MODE_OUTPUT_PP
#define LEDTX_Active_High 1

#define USB_GPIO_Port GPIOA
#define USB_Pin_DM GPIO_PIN_11
#define USB_Pin_DP GPIO_PIN_12

#define TERM_GPIO_Port GPIOA
#define TERM_Pin GPIO_PIN_1
#define TERM_Mode GPIO_MODE_OUTPUT_PP
#define TERM_Active_High 1

#elif defined(BOARD_STM32F4_DevBoard)
#define USBD_PRODUCT_STRING_FS (uint8_t*) "STM32F4VE Dev Board"
Expand Down
Loading
Loading