- Fixes '==' whitespace
- Replace ')\(==\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(==\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2371 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
@@ -189,7 +189,7 @@ static void bitbang_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int
|
||||
for (bit_cnt = 0; bit_cnt < scan_size; bit_cnt++)
|
||||
{
|
||||
int val=0;
|
||||
int tms=(bit_cnt==scan_size-1) ? 1 : 0;
|
||||
int tms=(bit_cnt == scan_size-1) ? 1 : 0;
|
||||
int tdi;
|
||||
int bytec=bit_cnt/8;
|
||||
int bcval=1 << (bit_cnt % 8);
|
||||
|
||||
@@ -51,7 +51,7 @@ void bitq_in_proc(void)
|
||||
while (bitq_in_state.cmd)
|
||||
{
|
||||
/* only JTAG_SCAN command may return data */
|
||||
if (bitq_in_state.cmd->type==JTAG_SCAN)
|
||||
if (bitq_in_state.cmd->type == JTAG_SCAN)
|
||||
{
|
||||
/* loop through the fields */
|
||||
while (bitq_in_state.field_idx<bitq_in_state.cmd->cmd.scan->num_fields)
|
||||
@@ -59,7 +59,7 @@ void bitq_in_proc(void)
|
||||
field = &bitq_in_state.cmd->cmd.scan->fields[bitq_in_state.field_idx];
|
||||
if (field->in_value)
|
||||
{
|
||||
if (bitq_in_state.bit_pos==0)
|
||||
if (bitq_in_state.bit_pos == 0)
|
||||
{
|
||||
/* initialize field scanning */
|
||||
in_mask = 0x01;
|
||||
@@ -83,7 +83,7 @@ void bitq_in_proc(void)
|
||||
bitq_in_bufsize *= 2;
|
||||
}
|
||||
/* if necessary, allocate buffer and check for malloc error */
|
||||
if (bitq_in_buffer==NULL && ( bitq_in_buffer = malloc(bitq_in_bufsize) )==NULL)
|
||||
if (bitq_in_buffer == NULL && ( bitq_in_buffer = malloc(bitq_in_bufsize) ) == NULL)
|
||||
{
|
||||
LOG_ERROR("malloc error");
|
||||
exit(-1);
|
||||
@@ -102,11 +102,11 @@ void bitq_in_proc(void)
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
if (in_mask==0x01)
|
||||
if (in_mask == 0x01)
|
||||
in_buff[in_idx] = 0;
|
||||
if (tdo)
|
||||
in_buff[in_idx] |= in_mask;
|
||||
if (in_mask==0x80)
|
||||
if (in_mask == 0x80)
|
||||
{
|
||||
in_mask = 0x01;
|
||||
in_idx++;
|
||||
@@ -226,7 +226,7 @@ void bitq_scan_field(scan_field_t* field, int pause)
|
||||
else
|
||||
tdo_req = 0;
|
||||
|
||||
if (field->out_value==NULL)
|
||||
if (field->out_value == NULL)
|
||||
{
|
||||
/* just send zeros and request data from TDO */
|
||||
for (bit_cnt = field->num_bits; bit_cnt>1; bit_cnt--)
|
||||
@@ -242,7 +242,7 @@ void bitq_scan_field(scan_field_t* field, int pause)
|
||||
for (bit_cnt = field->num_bits; bit_cnt>1; bit_cnt--)
|
||||
{
|
||||
bitq_io(0, ( (*out_ptr) & out_mask ) != 0, tdo_req);
|
||||
if (out_mask==0x80)
|
||||
if (out_mask == 0x80)
|
||||
{
|
||||
out_mask = 0x01;
|
||||
out_ptr++;
|
||||
@@ -257,9 +257,9 @@ void bitq_scan_field(scan_field_t* field, int pause)
|
||||
if (pause)
|
||||
{
|
||||
bitq_io(0, 0, 0);
|
||||
if (tap_get_state()==TAP_IRSHIFT)
|
||||
if (tap_get_state() == TAP_IRSHIFT)
|
||||
tap_set_state(TAP_IRPAUSE);
|
||||
else if (tap_get_state()==TAP_DRSHIFT)
|
||||
else if (tap_get_state() == TAP_DRSHIFT)
|
||||
tap_set_state(TAP_DRPAUSE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -508,9 +508,9 @@ int jtag_add_statemove(tap_state_t goal_state)
|
||||
tap_state_name(goal_state) );
|
||||
|
||||
|
||||
if (goal_state==cur_state )
|
||||
if (goal_state == cur_state )
|
||||
; /* nothing to do */
|
||||
else if ( goal_state==TAP_RESET )
|
||||
else if ( goal_state == TAP_RESET )
|
||||
{
|
||||
jtag_add_tlr();
|
||||
}
|
||||
@@ -576,7 +576,7 @@ void jtag_add_reset(int req_tlr_or_trst, int req_srst)
|
||||
*/
|
||||
if ((jtag_reset_config & RESET_HAS_SRST)&&
|
||||
(jtag_reset_config & RESET_HAS_TRST)&&
|
||||
((jtag_reset_config & RESET_SRST_PULLS_TRST)==0))
|
||||
((jtag_reset_config & RESET_SRST_PULLS_TRST) == 0))
|
||||
{
|
||||
if (((req_tlr_or_trst&&!jtag_trst)||
|
||||
(!req_tlr_or_trst && jtag_trst))&&
|
||||
@@ -746,7 +746,7 @@ void jtag_check_value_mask(scan_field_t *field, uint8_t *value, uint8_t *mask)
|
||||
{
|
||||
assert(field->in_value != NULL);
|
||||
|
||||
if (value==NULL)
|
||||
if (value == NULL)
|
||||
{
|
||||
/* no checking to do */
|
||||
return;
|
||||
@@ -1216,7 +1216,7 @@ int jtag_init_reset(struct command_context_s *cmd_ctx)
|
||||
if (jtag_reset_config & RESET_HAS_SRST)
|
||||
{
|
||||
jtag_add_reset(1, 1);
|
||||
if ((jtag_reset_config & RESET_SRST_PULLS_TRST)==0)
|
||||
if ((jtag_reset_config & RESET_SRST_PULLS_TRST) == 0)
|
||||
jtag_add_reset(0, 1);
|
||||
}
|
||||
jtag_add_reset(0, 0);
|
||||
@@ -1238,7 +1238,7 @@ int jtag_init(struct command_context_s *cmd_ctx)
|
||||
int retval;
|
||||
if ((retval=jtag_interface_init(cmd_ctx)) != ERROR_OK)
|
||||
return retval;
|
||||
if (jtag_init_inner(cmd_ctx)==ERROR_OK)
|
||||
if (jtag_init_inner(cmd_ctx) == ERROR_OK)
|
||||
{
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ void interface_jtag_add_callback4(jtag_callback_t callback, jtag_callback_data_t
|
||||
entry->data2=data2;
|
||||
entry->data3=data3;
|
||||
|
||||
if (jtag_callback_queue_head==NULL)
|
||||
if (jtag_callback_queue_head == NULL)
|
||||
{
|
||||
jtag_callback_queue_head=entry;
|
||||
jtag_callback_queue_tail=entry;
|
||||
|
||||
@@ -131,7 +131,7 @@ static void dummy_reset(int trst, int srst)
|
||||
|
||||
static int dummy_khz(int khz, int *jtag_speed)
|
||||
{
|
||||
if (khz==0)
|
||||
if (khz == 0)
|
||||
{
|
||||
*jtag_speed=0;
|
||||
}
|
||||
@@ -144,7 +144,7 @@ static int dummy_khz(int khz, int *jtag_speed)
|
||||
|
||||
static int dummy_speed_div(int speed, int *khz)
|
||||
{
|
||||
if (speed==0)
|
||||
if (speed == 0)
|
||||
{
|
||||
*khz = 0;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#if (BUILD_FT2232_FTD2XX==1 && BUILD_FT2232_LIBFTDI==1)
|
||||
#if (BUILD_FT2232_FTD2XX == 1 && BUILD_FT2232_LIBFTDI == 1)
|
||||
#error "BUILD_FT2232_FTD2XX && BUILD_FT2232_LIBFTDI are mutually exclusive"
|
||||
#elif (BUILD_FT2232_FTD2XX != 1 && BUILD_FT2232_LIBFTDI != 1)
|
||||
#error "BUILD_FT2232_FTD2XX || BUILD_FT2232_LIBFTDI must be chosen"
|
||||
@@ -274,7 +274,7 @@ static void clock_tms(uint8_t mpsse_cmd, int tms_bits, int tms_count, bool tdi_b
|
||||
*/
|
||||
++tms_ndx;
|
||||
|
||||
if (tms_ndx==7 || i==tms_count-1)
|
||||
if (tms_ndx == 7 || i == tms_count-1)
|
||||
{
|
||||
buffer_write(mpsse_cmd);
|
||||
buffer_write(tms_ndx - 1);
|
||||
@@ -498,7 +498,7 @@ static int ft2232_speed_div(int speed, int* khz)
|
||||
|
||||
static int ft2232_khz(int khz, int* jtag_speed)
|
||||
{
|
||||
if (khz==0)
|
||||
if (khz == 0)
|
||||
{
|
||||
#ifdef BUILD_FTD2XX_HIGHSPEED
|
||||
*jtag_speed = 0;
|
||||
@@ -2049,7 +2049,7 @@ static int ft2232_init(void)
|
||||
const ft2232_layout_t* cur_layout = ft2232_layouts;
|
||||
int i;
|
||||
|
||||
if (tap_get_tms_path_len(TAP_IRPAUSE,TAP_IRPAUSE)==7)
|
||||
if (tap_get_tms_path_len(TAP_IRPAUSE,TAP_IRPAUSE) == 7)
|
||||
{
|
||||
LOG_DEBUG("ft2232 interface using 7 step jtag state transitions");
|
||||
}
|
||||
|
||||
@@ -770,7 +770,7 @@ static int jlink_tap_execute(void)
|
||||
|
||||
/* JLink returns an extra NULL in packet when size of in message is a multiple of 64, creates problems with usb comms */
|
||||
/* WARNING This will interfere with tap state counting */
|
||||
while ((TAP_SCAN_BYTES(tap_length)%64)==0)
|
||||
while ((TAP_SCAN_BYTES(tap_length)%64) == 0)
|
||||
{
|
||||
jlink_tap_append_step((tap_get_state() == TAP_RESET)?1:0, 0);
|
||||
}
|
||||
@@ -932,7 +932,7 @@ static int jlink_usb_message(jlink_jtag_t *jlink_jtag, int out_length, int in_le
|
||||
if (1 != result2)
|
||||
{
|
||||
LOG_ERROR("jlink_usb_read_emu_result retried requested=1, result=%d, in_length=%i", result2,in_length);
|
||||
/* Try again once, should only happen if (in_length%64==0) */
|
||||
/* Try again once, should only happen if (in_length%64 == 0) */
|
||||
result2 = jlink_usb_read_emu_result(jlink_jtag);
|
||||
if (1 != result2)
|
||||
{
|
||||
|
||||
@@ -534,7 +534,7 @@ static int presto_sendbyte(int data)
|
||||
if (presto->buff_out_pos >= BUFFER_SIZE)
|
||||
#elif BUILD_PRESTO_LIBFTDI == 1
|
||||
/* libftdi does not do background read, be sure that USB IN buffer does not overflow (128 bytes only!) */
|
||||
if (presto->buff_out_pos >= BUFFER_SIZE || presto->buff_in_exp==128)
|
||||
if (presto->buff_out_pos >= BUFFER_SIZE || presto->buff_in_exp == 128)
|
||||
#endif
|
||||
return presto_flush();
|
||||
|
||||
|
||||
@@ -1208,7 +1208,7 @@ static int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, c
|
||||
for (i = 0; i < num_fields; i++)
|
||||
{
|
||||
tap = jtag_tap_by_string( args[i*2] );
|
||||
if (tap==NULL)
|
||||
if (tap == NULL)
|
||||
{
|
||||
command_print( cmd_ctx, "Tap: %s unknown", args[i*2] );
|
||||
return ERROR_FAIL;
|
||||
|
||||
@@ -591,7 +591,7 @@ static void usbprog_jtag_write_tdi(struct usbprog_jtag *usbprog_jtag, char * buf
|
||||
{
|
||||
send_bits = size;
|
||||
loops = size/8;
|
||||
/* if (loops==0) */
|
||||
/* if (loops == 0) */
|
||||
loops++;
|
||||
size = 0;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ static __inline__ void waitIdle(void)
|
||||
do
|
||||
{
|
||||
ZY1000_PEEK(ZY1000_JTAG_BASE+0x10, empty);
|
||||
} while ((empty & 0x100)==0);
|
||||
} while ((empty & 0x100) == 0);
|
||||
}
|
||||
|
||||
static __inline__ void waitQueue(void)
|
||||
@@ -64,7 +64,7 @@ static void setCurrentState(enum tap_state state)
|
||||
cyg_uint32 a;
|
||||
a=state;
|
||||
int repeat=0;
|
||||
if (state==TAP_RESET)
|
||||
if (state == TAP_RESET)
|
||||
{
|
||||
// The FPGA nor we know the current state of the CPU TAP
|
||||
// controller. This will move it to TAP for sure.
|
||||
@@ -92,7 +92,7 @@ static __inline__ void shiftValueInner(const enum tap_state state, const enum ta
|
||||
ZY1000_POKE(ZY1000_JTAG_BASE+0xc, value);
|
||||
#if 1
|
||||
#if TEST_MANUAL()
|
||||
if ((state==TAP_DRSHIFT) && (endState != TAP_DRSHIFT))
|
||||
if ((state == TAP_DRSHIFT) && (endState != TAP_DRSHIFT))
|
||||
{
|
||||
int i;
|
||||
setCurrentState(state);
|
||||
@@ -100,7 +100,7 @@ static __inline__ void shiftValueInner(const enum tap_state state, const enum ta
|
||||
{
|
||||
int tms;
|
||||
tms=0;
|
||||
if ((i==repeat-1) && (state != endState))
|
||||
if ((i == repeat-1) && (state != endState))
|
||||
{
|
||||
tms=1;
|
||||
}
|
||||
@@ -124,7 +124,7 @@ static __inline__ void shiftValueInner(const enum tap_state state, const enum ta
|
||||
#endif
|
||||
#else
|
||||
/* maximum debug version */
|
||||
if ((repeat>0) && ((state==TAP_DRSHIFT)||(state==TAP_SI)))
|
||||
if ((repeat>0) && ((state == TAP_DRSHIFT)||(state == TAP_SI)))
|
||||
{
|
||||
int i;
|
||||
/* sample shift register for every bit. */
|
||||
@@ -160,7 +160,7 @@ static __inline__ void interface_jtag_add_dr_out_core(jtag_tap_t *target_tap,
|
||||
for (tap = jtag_tap_next_enabled(NULL); tap!= NULL; tap=nextTap)
|
||||
{
|
||||
nextTap=jtag_tap_next_enabled(tap);
|
||||
if (nextTap==NULL)
|
||||
if (nextTap == NULL)
|
||||
{
|
||||
pause_state = end_state;
|
||||
}
|
||||
@@ -187,14 +187,14 @@ static __inline__ void interface_jtag_add_dr_out(jtag_tap_t *target_tap,
|
||||
enum tap_state end_state)
|
||||
{
|
||||
|
||||
int singletap=(jtag_tap_next_enabled(jtag_tap_next_enabled(NULL))==NULL);
|
||||
if ((singletap) && (num_fields==3))
|
||||
int singletap=(jtag_tap_next_enabled(jtag_tap_next_enabled(NULL)) == NULL);
|
||||
if ((singletap) && (num_fields == 3))
|
||||
{
|
||||
/* used by embeddedice_write_reg_inner() */
|
||||
shiftValueInner(TAP_DRSHIFT, TAP_DRSHIFT, num_bits[0], value[0]);
|
||||
shiftValueInner(TAP_DRSHIFT, TAP_DRSHIFT, num_bits[1], value[1]);
|
||||
shiftValueInner(TAP_DRSHIFT, end_state, num_bits[2], value[2]);
|
||||
} else if ((singletap) && (num_fields==2))
|
||||
} else if ((singletap) && (num_fields == 2))
|
||||
{
|
||||
/* used by arm7 code */
|
||||
shiftValueInner(TAP_DRSHIFT, TAP_DRSHIFT, num_bits[0], value[0]);
|
||||
|
||||
@@ -49,7 +49,7 @@ int zy1000_handle_zy1000_port_command(struct command_context_s *cmd_ctx, char *c
|
||||
|
||||
static int zy1000_khz(int khz, int *jtag_speed)
|
||||
{
|
||||
if (khz==0)
|
||||
if (khz == 0)
|
||||
{
|
||||
*jtag_speed=0;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ static int zy1000_khz(int khz, int *jtag_speed)
|
||||
|
||||
static int zy1000_speed_div(int speed, int *khz)
|
||||
{
|
||||
if (speed==0)
|
||||
if (speed == 0)
|
||||
{
|
||||
*khz = 0;
|
||||
}
|
||||
@@ -176,7 +176,7 @@ void zy1000_reset(int trst, int srst)
|
||||
alive_sleep(1);
|
||||
}
|
||||
|
||||
if (i==1000)
|
||||
if (i == 1000)
|
||||
{
|
||||
LOG_USER("SRST didn't deassert after %dms", i);
|
||||
} else if (i>1)
|
||||
@@ -439,7 +439,7 @@ static __inline void scanFields(int num_fields, const scan_field_t *fields, tap_
|
||||
tap_state_t pause_state;
|
||||
int l;
|
||||
k=num_bits-j;
|
||||
pause_state=(shiftState==TAP_DRSHIFT)?TAP_DRSHIFT:TAP_IRSHIFT;
|
||||
pause_state=(shiftState == TAP_DRSHIFT)?TAP_DRSHIFT:TAP_IRSHIFT;
|
||||
if (k>32)
|
||||
{
|
||||
k=32;
|
||||
@@ -498,7 +498,7 @@ int interface_jtag_add_ir_scan(int num_fields, const scan_field_t *fields, tap_s
|
||||
{
|
||||
nextTap=jtag_tap_next_enabled(tap);
|
||||
tap_state_t end_state;
|
||||
if (nextTap==NULL)
|
||||
if (nextTap == NULL)
|
||||
{
|
||||
end_state = state;
|
||||
} else
|
||||
@@ -568,7 +568,7 @@ int interface_jtag_add_dr_scan(int num_fields, const scan_field_t *fields, tap_s
|
||||
nextTap=jtag_tap_next_enabled(tap);
|
||||
int found=0;
|
||||
tap_state_t end_state;
|
||||
if (nextTap==NULL)
|
||||
if (nextTap == NULL)
|
||||
{
|
||||
end_state = state;
|
||||
} else
|
||||
@@ -732,7 +732,7 @@ void embeddedice_write_dcc(jtag_tap_t *tap, int reg_addr, uint8_t *buffer, int l
|
||||
{
|
||||
// static int const reg_addr=0x5;
|
||||
tap_state_t end_state=jtag_get_end_state();
|
||||
if (jtag_tap_next_enabled(jtag_tap_next_enabled(NULL))==NULL)
|
||||
if (jtag_tap_next_enabled(jtag_tap_next_enabled(NULL)) == NULL)
|
||||
{
|
||||
/* better performance via code duplication */
|
||||
if (little)
|
||||
|
||||
Reference in New Issue
Block a user