summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeeto1970 <[email protected]>2026-07-14 15:12:58 +0800
committerRbb666 <[email protected]>2026-07-14 19:55:12 +0800
commitaff47231e665d142667e5de73b199d30b6a56097 (patch)
tree53994eb3ad4c0dca13d4c9c0f7f2b28ca1b94ec4
parentd513da02db889d1925edd8a579e90bca382c85cc (diff)
[HC32] Format files by newer clang-format.
-rw-r--r--bsp/hc32/libraries/hc32_drivers/drv_can.c24
-rw-r--r--bsp/hc32/libraries/hc32_drivers/drv_mcan.c8
-rw-r--r--bsp/hc32/tests/test_soft_i2c.c45
3 files changed, 56 insertions, 21 deletions
diff --git a/bsp/hc32/libraries/hc32_drivers/drv_can.c b/bsp/hc32/libraries/hc32_drivers/drv_can.c
index 1a6dd68aeb..4ed40ad309 100644
--- a/bsp/hc32/libraries/hc32_drivers/drv_can.c
+++ b/bsp/hc32/libraries/hc32_drivers/drv_can.c
@@ -71,18 +71,18 @@
#define NUM_TQ_MAX_FOR_CANFD_DATA (TSEG1_MAX_FOR_CANFD_DATA + TSEG2_MAX_FOR_CANFD_DATA)
#define IS_VALID_BAUD_RATE_CANFD_ARBITRATION(baud) IS_VALID_BAUD_RATE_CAN2_0(baud)
-#define IS_VALID_BAUD_RATE_CANFD_DATA(baud) (baud == (CAN10kBaud) || baud == (CAN20kBaud) || \
- baud == (CAN50kBaud) || baud == (CAN100kBaud) || \
- baud == (CAN125kBaud) || baud == (CAN250kBaud) || \
- baud == (CAN500kBaud) || baud == (CAN800kBaud) || \
- baud == (CAN1MBaud) || \
- baud == (CANFD_DATA_BAUD_2M) || \
- baud == (CANFD_DATA_BAUD_4M) || \
- baud == (CANFD_DATA_BAUD_5M) || \
- baud == (CANFD_DATA_BAUD_8M))
-#define IS_CAN_FRAME(frame) ((frame) == CAN_FRAME_CLASSIC || \
- (frame) == CAN_FRAME_ISO_FD || \
- (frame) == CAN_FRAME_NON_ISO_FD)
+#define IS_VALID_BAUD_RATE_CANFD_DATA(baud) (baud == (CAN10kBaud) || baud == (CAN20kBaud) || \
+ baud == (CAN50kBaud) || baud == (CAN100kBaud) || \
+ baud == (CAN125kBaud) || baud == (CAN250kBaud) || \
+ baud == (CAN500kBaud) || baud == (CAN800kBaud) || \
+ baud == (CAN1MBaud) || \
+ baud == (CANFD_DATA_BAUD_2M) || \
+ baud == (CANFD_DATA_BAUD_4M) || \
+ baud == (CANFD_DATA_BAUD_5M) || \
+ baud == (CANFD_DATA_BAUD_8M))
+#define IS_CAN_FRAME(frame) ((frame) == CAN_FRAME_CLASSIC || \
+ (frame) == CAN_FRAME_ISO_FD || \
+ (frame) == CAN_FRAME_NON_ISO_FD)
#define CAN_BIT_TIMING_CANFD_ARBITRATION (1U << 1)
#define CAN_BIT_TIMING_CANFD_DATA (1U << 2)
diff --git a/bsp/hc32/libraries/hc32_drivers/drv_mcan.c b/bsp/hc32/libraries/hc32_drivers/drv_mcan.c
index 1279c6b592..01de0aba57 100644
--- a/bsp/hc32/libraries/hc32_drivers/drv_mcan.c
+++ b/bsp/hc32/libraries/hc32_drivers/drv_mcan.c
@@ -79,10 +79,10 @@ typedef struct mcan_baud_rate_struct
/****************************************************************************************
* Interrupt definitions
****************************************************************************************/
-#define MCAN_RX_INT (MCAN_INT_RX_FIFO0_NEW_MSG | MCAN_INT_RX_FIFO1_NEW_MSG | MCAN_INT_RX_BUF_NEW_MSG)
-#define MCAN_TX_INT (MCAN_INT_TX_CPLT)
-#define MCAN_ERR_INT (MCAN_INT_ARB_PHASE_ERROR | MCAN_INT_DATA_PHASE_ERROR | MCAN_INT_ERR_LOG_OVF | \
- MCAN_INT_ERR_PASSIVE | MCAN_INT_ERR_WARNING | MCAN_INT_BUS_OFF)
+#define MCAN_RX_INT (MCAN_INT_RX_FIFO0_NEW_MSG | MCAN_INT_RX_FIFO1_NEW_MSG | MCAN_INT_RX_BUF_NEW_MSG)
+#define MCAN_TX_INT (MCAN_INT_TX_CPLT)
+#define MCAN_ERR_INT (MCAN_INT_ARB_PHASE_ERROR | MCAN_INT_DATA_PHASE_ERROR | MCAN_INT_ERR_LOG_OVF | \
+ MCAN_INT_ERR_PASSIVE | MCAN_INT_ERR_WARNING | MCAN_INT_BUS_OFF)
#define MCAN_INT0_SEL (MCAN_RX_INT | MCAN_TX_INT | MCAN_ERR_INT)
/****************************************************************************************
diff --git a/bsp/hc32/tests/test_soft_i2c.c b/bsp/hc32/tests/test_soft_i2c.c
index b8e0b24701..fd2b3b8127 100644
--- a/bsp/hc32/tests/test_soft_i2c.c
+++ b/bsp/hc32/tests/test_soft_i2c.c
@@ -292,11 +292,46 @@ rt_uint8_t ssd_init_array[] = {
rt_uint8_t logo_array[][SYM_BYTE_SIZE] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x44, 0x44, 0x6C, 0x74, 0x54, 0x6C, 0x44, 0x44, /*"X"*/
- 0x44, 0x7C, 0x54, 0x10, 0x10, 0x54, 0x7C, 0x44, /*"H"*/
- 0x00, 0x68, 0x54, 0x54, 0x54, 0x54, 0x24, 0x00, /*"S"*/
- 0x38, 0x6C, 0x44, 0x44, 0x44, 0x44, 0x24, 0x00, /*"C"*/
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x44,
+ 0x44,
+ 0x6C,
+ 0x74,
+ 0x54,
+ 0x6C,
+ 0x44,
+ 0x44, /*"X"*/
+ 0x44,
+ 0x7C,
+ 0x54,
+ 0x10,
+ 0x10,
+ 0x54,
+ 0x7C,
+ 0x44, /*"H"*/
+ 0x00,
+ 0x68,
+ 0x54,
+ 0x54,
+ 0x54,
+ 0x54,
+ 0x24,
+ 0x00, /*"S"*/
+ 0x38,
+ 0x6C,
+ 0x44,
+ 0x44,
+ 0x44,
+ 0x44,
+ 0x24,
+ 0x00, /*"C"*/
};
MSH_CMD_EXPORT(sw_i2c_sample, soft i2c sample);