From dd0e99b0e6fe0237c8eba94260bda17a58113adb Mon Sep 17 00:00:00 2001 From: dragonmux Date: Tue, 9 Aug 2022 02:08:39 +0100 Subject: [PATCH] remote: Run clang-format on the JTAG and SWD protocol header definitions --- src/remote.c | 1 - src/remote.h | 62 ++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 46 insertions(+), 17 deletions(-) diff --git a/src/remote.c b/src/remote.c index 086daa8..750f262 100644 --- a/src/remote.c +++ b/src/remote.c @@ -117,7 +117,6 @@ static ADIv5_DP_t remote_dp = { .mem_write_sized = firmware_mem_write_sized, }; - static void remotePacketProcessSWD(unsigned i, char *packet) { uint8_t ticks; diff --git a/src/remote.h b/src/remote.h index f65d811..ac36f43 100644 --- a/src/remote.h +++ b/src/remote.h @@ -116,32 +116,61 @@ /* SWDP protocol elements */ #define REMOTE_SWDP_PACKET 'S' -#define REMOTE_SWDP_INIT_STR (char []){ REMOTE_SOM, REMOTE_SWDP_PACKET, REMOTE_INIT, REMOTE_EOM, 0 } +#define REMOTE_SWDP_INIT_STR \ + (char[]) \ + { \ + REMOTE_SOM, REMOTE_SWDP_PACKET, REMOTE_INIT, REMOTE_EOM, 0 \ + } -#define REMOTE_SWDP_IN_PAR_STR (char []){ REMOTE_SOM, REMOTE_SWDP_PACKET, REMOTE_IN_PAR, \ - '%','0','2','x',REMOTE_EOM, 0 } +#define REMOTE_SWDP_IN_PAR_STR \ + (char[]) \ + { \ + REMOTE_SOM, REMOTE_SWDP_PACKET, REMOTE_IN_PAR, '%', '0', '2', 'x', REMOTE_EOM, 0 \ + } -#define REMOTE_SWDP_IN_STR (char []){ REMOTE_SOM, REMOTE_SWDP_PACKET, REMOTE_IN, \ - '%','0','2','x',REMOTE_EOM, 0 } +#define REMOTE_SWDP_IN_STR \ + (char[]) \ + { \ + REMOTE_SOM, REMOTE_SWDP_PACKET, REMOTE_IN, '%', '0', '2', 'x', REMOTE_EOM, 0 \ + } -#define REMOTE_SWDP_OUT_STR (char []){ REMOTE_SOM, REMOTE_SWDP_PACKET, REMOTE_OUT, \ - '%','0','2','x','%','x',REMOTE_EOM, 0 } +#define REMOTE_SWDP_OUT_STR \ + (char[]) \ + { \ + REMOTE_SOM, REMOTE_SWDP_PACKET, REMOTE_OUT, '%', '0', '2', 'x', '%', 'x', REMOTE_EOM, 0 \ + } -#define REMOTE_SWDP_OUT_PAR_STR (char []){ REMOTE_SOM, REMOTE_SWDP_PACKET, REMOTE_OUT_PAR, \ - '%','0','2','x','%','x',REMOTE_EOM, 0 } +#define REMOTE_SWDP_OUT_PAR_STR \ + (char[]) \ + { \ + REMOTE_SOM, REMOTE_SWDP_PACKET, REMOTE_OUT_PAR, '%', '0', '2', 'x', '%', 'x', REMOTE_EOM, 0 \ + } /* JTAG protocol elements */ #define REMOTE_JTAG_PACKET 'J' +#define REMOTE_JTAG_INIT_STR \ + (char[]) \ + { \ + '+', REMOTE_EOM, REMOTE_SOM, REMOTE_JTAG_PACKET, REMOTE_INIT, REMOTE_EOM, 0 \ + } -#define REMOTE_JTAG_INIT_STR (char []){ '+',REMOTE_EOM, REMOTE_SOM, REMOTE_JTAG_PACKET, REMOTE_INIT, REMOTE_EOM, 0 } +#define REMOTE_JTAG_RESET_STR \ + (char[]) \ + { \ + '+', REMOTE_EOM, REMOTE_SOM, REMOTE_JTAG_PACKET, REMOTE_RESET, REMOTE_EOM, 0 \ + } -#define REMOTE_JTAG_RESET_STR (char []){ '+',REMOTE_EOM, REMOTE_SOM, REMOTE_JTAG_PACKET, REMOTE_RESET, REMOTE_EOM, 0 } +#define REMOTE_JTAG_TMS_STR \ + (char[]) \ + { \ + REMOTE_SOM, REMOTE_JTAG_PACKET, REMOTE_TMS, '%', '0', '2', 'x', '%', 'x', REMOTE_EOM, 0 \ + } -#define REMOTE_JTAG_TMS_STR (char []){ REMOTE_SOM, REMOTE_JTAG_PACKET, REMOTE_TMS, \ - '%','0','2','x','%','x',REMOTE_EOM, 0 } - -#define REMOTE_JTAG_TDIDO_STR (char []){ REMOTE_SOM, REMOTE_JTAG_PACKET, '%', 'c', \ - '%','0','2','x','%','l', 'x', REMOTE_EOM, 0 } +#define REMOTE_JTAG_TDIDO_STR \ + (char[]) \ + { \ + REMOTE_SOM, REMOTE_JTAG_PACKET, '%', 'c', '%', '0', '2', 'x', '%', 'l', 'x', REMOTE_EOM, 0 \ + } #define REMOTE_JTAG_CYCLE_STR \ (char[]) \ @@ -154,6 +183,7 @@ { \ REMOTE_SOM, REMOTE_JTAG_PACKET, REMOTE_NEXT, '%', 'u', '%', 'u', REMOTE_EOM, 0 \ } + /* HL protocol elements */ #define HEX '%', '0', '2', 'x' #define HEX_U32(x) '%', '0', '8', 'x'