jtag/swd: rename CamelCase macros
[openocd.git] / src / jtag / drivers / buspirate.c
index 020c4ce39025a713cde181ff59f9aa5711c7a302..616832ea76a746a20dbb7edb1cb3f23d90e30286 100644 (file)
@@ -214,7 +214,7 @@ static int buspirate_execute_queue(void)
 
                        break;
                case JTAG_SLEEP:
-                       LOG_DEBUG_IO("sleep %i", cmd->cmd.sleep->us);
+                       LOG_DEBUG_IO("sleep %" PRIu32, cmd->cmd.sleep->us);
                        buspirate_tap_execute();
                        jtag_sleep(cmd->cmd.sleep->us);
                                break;
@@ -352,10 +352,8 @@ static int buspirate_quit(void)
 
        buspirate_serial_close(buspirate_fd);
 
-       if (buspirate_port) {
-               free(buspirate_port);
-               buspirate_port = NULL;
-       }
+       free(buspirate_port);
+       buspirate_port = NULL;
        return ERROR_OK;
 }
 
@@ -1049,7 +1047,7 @@ static void buspirate_jtag_reset(int fd)
        tmp[0] = 0x00; /* exit OCD1 mode */
        buspirate_serial_write(fd, tmp, 1);
        usleep(10000);
-       /* We ignore the return value here purposly, nothing we can do */
+       /* We ignore the return value here on purpose, nothing we can do */
        buspirate_serial_read(fd, tmp, 5);
        if (strncmp((char *)tmp, "BBIO1", 5) == 0) {
                tmp[0] = 0x0F; /*  reset BP */
@@ -1367,7 +1365,7 @@ static uint8_t buspirate_swd_write_header(uint8_t cmd)
        tmp[5] = 0x07; /* write mode trn_1 */
        tmp[6] = 0x07; /* write mode trn_2 */
 
-       to_send = ((cmd & SWD_CMD_RnW) == 0) ? 7 : 5;
+       to_send = ((cmd & SWD_CMD_RNW) == 0) ? 7 : 5;
        buspirate_serial_write(buspirate_fd, tmp, to_send);
 
        /* read ack */
@@ -1413,7 +1411,7 @@ static void buspirate_swd_read_reg(uint8_t cmd, uint32_t *value, uint32_t ap_del
        uint8_t tmp[16];
 
        LOG_DEBUG("buspirate_swd_read_reg");
-       assert(cmd & SWD_CMD_RnW);
+       assert(cmd & SWD_CMD_RNW);
 
        if (queued_retval != ERROR_OK) {
                LOG_DEBUG("Skip buspirate_swd_read_reg because queued_retval=%d", queued_retval);
@@ -1443,8 +1441,8 @@ static void buspirate_swd_read_reg(uint8_t cmd, uint32_t *value, uint32_t ap_del
 
        LOG_DEBUG("%s %s %s reg %X = %08"PRIx32,
                        ack == SWD_ACK_OK ? "OK" : ack == SWD_ACK_WAIT ? "WAIT" : ack == SWD_ACK_FAULT ? "FAULT" : "JUNK",
-                       cmd & SWD_CMD_APnDP ? "AP" : "DP",
-                       cmd & SWD_CMD_RnW ? "read" : "write",
+                       cmd & SWD_CMD_APNDP ? "AP" : "DP",
+                       cmd & SWD_CMD_RNW ? "read" : "write",
                        (cmd & SWD_CMD_A32) >> 1,
                        data);
 
@@ -1457,7 +1455,7 @@ static void buspirate_swd_read_reg(uint8_t cmd, uint32_t *value, uint32_t ap_del
                }
                if (value)
                        *value = data;
-               if (cmd & SWD_CMD_APnDP)
+               if (cmd & SWD_CMD_APNDP)
                        buspirate_swd_idle_clocks(ap_delay_clk);
                return;
         case SWD_ACK_WAIT:
@@ -1480,7 +1478,7 @@ static void buspirate_swd_write_reg(uint8_t cmd, uint32_t value, uint32_t ap_del
        uint8_t tmp[16];
 
        LOG_DEBUG("buspirate_swd_write_reg");
-       assert(!(cmd & SWD_CMD_RnW));
+       assert(!(cmd & SWD_CMD_RNW));
 
        if (queued_retval != ERROR_OK) {
                LOG_DEBUG("Skip buspirate_swd_write_reg because queued_retval=%d", queued_retval);
@@ -1501,14 +1499,14 @@ static void buspirate_swd_write_reg(uint8_t cmd, uint32_t value, uint32_t ap_del
 
        LOG_DEBUG("%s %s %s reg %X = %08"PRIx32,
                        ack == SWD_ACK_OK ? "OK" : ack == SWD_ACK_WAIT ? "WAIT" : ack == SWD_ACK_FAULT ? "FAULT" : "JUNK",
-                       cmd & SWD_CMD_APnDP ? "AP" : "DP",
-                       cmd & SWD_CMD_RnW ? "read" : "write",
+                       cmd & SWD_CMD_APNDP ? "AP" : "DP",
+                       cmd & SWD_CMD_RNW ? "read" : "write",
                        (cmd & SWD_CMD_A32) >> 1,
                        value);
 
        switch (ack) {
         case SWD_ACK_OK:
-               if (cmd & SWD_CMD_APnDP)
+               if (cmd & SWD_CMD_APNDP)
                        buspirate_swd_idle_clocks(ap_delay_clk);
                return;
         case SWD_ACK_WAIT:
@@ -1538,5 +1536,3 @@ static int buspirate_swd_run_queue(void)
        LOG_DEBUG("SWD queue return value: %02x", retval);
        return retval;
 }
-
-

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)