target: cortex_m: Fix a typo VECTRESET
[fw/openocd] / src / jtag / commands.c
index e88a3b74f669dd3ba2c93973441001e5b09768a7..206c5e8f5290f1f2ac7b9f5b1c1327721b321c8a 100644 (file)
@@ -66,8 +66,8 @@ void jtag_queue_command(struct jtag_command *cmd)
        cmd->next = NULL;
 
        struct jtag_command **last_cmd = next_command_pointer;
-       assert(NULL != last_cmd);
-       assert(NULL == *last_cmd);
+       assert(last_cmd);
+       assert(!*last_cmd);
        *last_cmd = cmd;
 
        /* store location where the next command pointer will be stored */
@@ -214,10 +214,10 @@ int jtag_build_buffer(const struct scan_command *cmd, uint8_t **buffer)
        for (i = 0; i < cmd->num_fields; i++) {
                if (cmd->fields[i].out_value) {
                        if (LOG_LEVEL_IS(LOG_LVL_DEBUG_IO)) {
-                               char *char_buf = buf_to_str(cmd->fields[i].out_value,
+                               char *char_buf = buf_to_hex_str(cmd->fields[i].out_value,
                                                (cmd->fields[i].num_bits > DEBUG_JTAG_IOZ)
                                                ? DEBUG_JTAG_IOZ
-                                                               : cmd->fields[i].num_bits, 16);
+                                                               : cmd->fields[i].num_bits);
 
                                LOG_DEBUG("fields[%i].out_value[%i]: 0x%s", i,
                                                cmd->fields[i].num_bits, char_buf);
@@ -257,10 +257,10 @@ int jtag_read_buffer(uint8_t *buffer, const struct scan_command *cmd)
                                        malloc(DIV_ROUND_UP(num_bits, 8)), 0, num_bits);
 
                        if (LOG_LEVEL_IS(LOG_LVL_DEBUG_IO)) {
-                               char *char_buf = buf_to_str(captured,
+                               char *char_buf = buf_to_hex_str(captured,
                                                (num_bits > DEBUG_JTAG_IOZ)
                                                ? DEBUG_JTAG_IOZ
-                                                               : num_bits, 16);
+                                                               : num_bits);
 
                                LOG_DEBUG("fields[%i].in_value[%i]: 0x%s",
                                                i, num_bits, char_buf);