jtag: update constant names to follow code style guidelines

Change-Id: Ib081433c67f3be0e5be0b39469680bcce079e0cc
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8485
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Parshintsev Anatoly 2024-09-10 06:53:17 +03:00 committed by Antonio Borneo
parent 017e61feb4
commit bd93b83f1b
3 changed files with 10 additions and 10 deletions

View File

@ -563,7 +563,7 @@ static int cmsis_dap_cmd_dap_delay(uint16_t delay_us)
static int cmsis_dap_metacmd_targetsel(uint32_t instance_id) static int cmsis_dap_metacmd_targetsel(uint32_t instance_id)
{ {
uint8_t *command = cmsis_dap_handle->command; uint8_t *command = cmsis_dap_handle->command;
const uint32_t SEQ_RD = 0x80, SEQ_WR = 0x00; const uint32_t seq_rd = 0x80, seq_wr = 0x00;
/* SWD multi-drop requires a transfer ala CMD_DAP_TFER, /* SWD multi-drop requires a transfer ala CMD_DAP_TFER,
but with no expectation of an SWD ACK response. In but with no expectation of an SWD ACK response. In
@ -579,14 +579,14 @@ static int cmsis_dap_metacmd_targetsel(uint32_t instance_id)
command[idx++] = 3; /* sequence count */ command[idx++] = 3; /* sequence count */
/* sequence 0: packet request for TARGETSEL */ /* sequence 0: packet request for TARGETSEL */
command[idx++] = SEQ_WR | 8; command[idx++] = seq_wr | 8;
command[idx++] = SWD_CMD_START | swd_cmd(false, false, DP_TARGETSEL) | SWD_CMD_STOP | SWD_CMD_PARK; command[idx++] = SWD_CMD_START | swd_cmd(false, false, DP_TARGETSEL) | SWD_CMD_STOP | SWD_CMD_PARK;
/* sequence 1: read Trn ACK Trn, no expectation for target to ACK */ /* sequence 1: read Trn ACK Trn, no expectation for target to ACK */
command[idx++] = SEQ_RD | 5; command[idx++] = seq_rd | 5;
/* sequence 2: WDATA plus parity */ /* sequence 2: WDATA plus parity */
command[idx++] = SEQ_WR | (32 + 1); command[idx++] = seq_wr | (32 + 1);
h_u32_to_le(command + idx, instance_id); h_u32_to_le(command + idx, instance_id);
idx += 4; idx += 4;
command[idx++] = parity_u32(instance_id); command[idx++] = parity_u32(instance_id);

View File

@ -461,14 +461,14 @@ static int jtag_vpi_stableclocks(unsigned int num_cycles)
unsigned int cycles_remain = num_cycles; unsigned int cycles_remain = num_cycles;
int nb_bits; int nb_bits;
int retval; int retval;
const unsigned int CYCLES_ONE_BATCH = sizeof(tms_bits) * 8; const unsigned int cycles_one_batch = sizeof(tms_bits) * 8;
/* use TMS=1 in TAP RESET state, TMS=0 in all other stable states */ /* use TMS=1 in TAP RESET state, TMS=0 in all other stable states */
memset(&tms_bits, (tap_get_state() == TAP_RESET) ? 0xff : 0x00, sizeof(tms_bits)); memset(&tms_bits, (tap_get_state() == TAP_RESET) ? 0xff : 0x00, sizeof(tms_bits));
/* send the TMS bits */ /* send the TMS bits */
while (cycles_remain > 0) { while (cycles_remain > 0) {
nb_bits = (cycles_remain < CYCLES_ONE_BATCH) ? cycles_remain : CYCLES_ONE_BATCH; nb_bits = (cycles_remain < cycles_one_batch) ? cycles_remain : cycles_one_batch;
retval = jtag_vpi_tms_seq(tms_bits, nb_bits); retval = jtag_vpi_tms_seq(tms_bits, nb_bits);
if (retval != ERROR_OK) if (retval != ERROR_OK)
return retval; return retval;

View File

@ -1887,7 +1887,7 @@ static int xds110_speed(int speed)
} else { } else {
const double XDS110_TCK_PULSE_INCREMENT = 66.0; const double xds110_tck_pulse_increment = 66.0;
freq_to_use = speed * 1000; /* Hz */ freq_to_use = speed * 1000; /* Hz */
delay_count = 0; delay_count = 0;
@ -1908,7 +1908,7 @@ static int xds110_speed(int speed)
double current_value = max_freq_pulse_duration; double current_value = max_freq_pulse_duration;
while (current_value < freq_to_pulse_width_in_ns) { while (current_value < freq_to_pulse_width_in_ns) {
current_value += XDS110_TCK_PULSE_INCREMENT; current_value += xds110_tck_pulse_increment;
++delay_count; ++delay_count;
} }
@ -1919,9 +1919,9 @@ static int xds110_speed(int speed)
if (delay_count) { if (delay_count) {
double diff_freq_1 = freq_to_use - double diff_freq_1 = freq_to_use -
(one_giga / (max_freq_pulse_duration + (one_giga / (max_freq_pulse_duration +
(XDS110_TCK_PULSE_INCREMENT * delay_count))); (xds110_tck_pulse_increment * delay_count)));
double diff_freq_2 = (one_giga / (max_freq_pulse_duration + double diff_freq_2 = (one_giga / (max_freq_pulse_duration +
(XDS110_TCK_PULSE_INCREMENT * (delay_count - 1)))) - (xds110_tck_pulse_increment * (delay_count - 1)))) -
freq_to_use; freq_to_use;
/* One less count value yields a better match */ /* One less count value yields a better match */