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:
parent
017e61feb4
commit
bd93b83f1b
|
@ -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)
|
||||
{
|
||||
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,
|
||||
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 */
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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 */
|
||||
command[idx++] = SEQ_WR | (32 + 1);
|
||||
command[idx++] = seq_wr | (32 + 1);
|
||||
h_u32_to_le(command + idx, instance_id);
|
||||
idx += 4;
|
||||
command[idx++] = parity_u32(instance_id);
|
||||
|
|
|
@ -461,14 +461,14 @@ static int jtag_vpi_stableclocks(unsigned int num_cycles)
|
|||
unsigned int cycles_remain = num_cycles;
|
||||
int nb_bits;
|
||||
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 */
|
||||
memset(&tms_bits, (tap_get_state() == TAP_RESET) ? 0xff : 0x00, sizeof(tms_bits));
|
||||
|
||||
/* send the TMS bits */
|
||||
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);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
|
|
@ -1887,7 +1887,7 @@ static int xds110_speed(int speed)
|
|||
|
||||
} else {
|
||||
|
||||
const double XDS110_TCK_PULSE_INCREMENT = 66.0;
|
||||
const double xds110_tck_pulse_increment = 66.0;
|
||||
freq_to_use = speed * 1000; /* Hz */
|
||||
delay_count = 0;
|
||||
|
||||
|
@ -1908,7 +1908,7 @@ static int xds110_speed(int speed)
|
|||
double current_value = max_freq_pulse_duration;
|
||||
|
||||
while (current_value < freq_to_pulse_width_in_ns) {
|
||||
current_value += XDS110_TCK_PULSE_INCREMENT;
|
||||
current_value += xds110_tck_pulse_increment;
|
||||
++delay_count;
|
||||
}
|
||||
|
||||
|
@ -1919,9 +1919,9 @@ static int xds110_speed(int speed)
|
|||
if (delay_count) {
|
||||
double diff_freq_1 = freq_to_use -
|
||||
(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 +
|
||||
(XDS110_TCK_PULSE_INCREMENT * (delay_count - 1)))) -
|
||||
(xds110_tck_pulse_increment * (delay_count - 1)))) -
|
||||
freq_to_use;
|
||||
|
||||
/* One less count value yields a better match */
|
||||
|
|
Loading…
Reference in New Issue