int ndx;
- switch( astate )
+ switch ( astate )
{
case TAP_RESET: ndx = 0; break;
case TAP_DRSHIFT: ndx = 2; break;
*/
struct tms_sequences
{
- u8 bits;
- u8 bit_count;
+ uint8_t bits;
+ uint8_t bit_count;
};
+(((x) & 0x0F000000LU)?(1<<6):0) \
+(((x) & 0xF0000000LU)?(1<<7):0)
-#define B8(bits,count) { ((u8)B8__(HEX__(bits))), (count) }
+#define B8(bits,count) { ((uint8_t)B8__(HEX__(bits))), (count) }
static const struct tms_sequences old_tms_seqs[6][6] = /* [from_state_ndx][to_state_ndx] */
{
{
bool is_stable;
- /* A switch() is used because it is symbol dependent
+ /* A switch () is used because it is symbol dependent
(not value dependent like an array), and can also check bounds.
*/
- switch( astate )
+ switch ( astate )
{
case TAP_RESET:
case TAP_IDLE:
{
const char* ret;
- switch( state )
+ switch ( state )
{
case TAP_RESET: ret = "RESET"; break;
case TAP_IDLE: ret = "RUN/IDLE"; break;
{
tap_state_t x;
- for( x = 0 ; x < TAP_NUM_STATES ; x++ ){
+ for ( x = 0 ; x < TAP_NUM_STATES ; x++ ){
/* be nice to the human */
- if( 0 == strcasecmp( name, tap_state_name(x) ) ){
+ if ( 0 == strcasecmp( name, tap_state_name(x) ) ){
return x;
}
}
#ifdef _DEBUG_JTAG_IO_
#define JTAG_DEBUG_STATE_APPEND(buf, len, bit) \
- do { buf[len] = bit ? '1' : '0'; } while(0)
+ do { buf[len] = bit ? '1' : '0'; } while (0)
#define JTAG_DEBUG_STATE_PRINT(a, b, astr, bstr) \
DEBUG_JTAG_IO("TAP/SM: %9s -> %5s\tTMS: %s\tTDI: %s", \
tap_state_name(a), tap_state_name(b), astr, bstr)
tap_state_t jtag_debug_state_machine(const void *tms_buf, const void *tdi_buf,
unsigned tap_bits, tap_state_t next_state)
{
- const u8 *tms_buffer;
- const u8 *tdi_buffer;
+ const uint8_t *tms_buffer;
+ const uint8_t *tdi_buffer;
unsigned tap_bytes;
unsigned cur_byte;
unsigned cur_bit;
last_state = next_state;
DEBUG_JTAG_IO("TAP/SM: START state: %s", tap_state_name(next_state));
- tms_buffer = (const u8 *)tms_buf;
- tdi_buffer = (const u8 *)tdi_buf;
+ tms_buffer = (const uint8_t *)tms_buf;
+ tdi_buffer = (const uint8_t *)tdi_buf;
tap_bytes = TAP_SCAN_BYTES(tap_bits);
DEBUG_JTAG_IO("TAP/SM: TMS bits: %u (bytes: %u)", tap_bits, tap_bytes);
tap_out_bits = 0;
- for(cur_byte = 0; cur_byte < tap_bytes; cur_byte++)
+ for (cur_byte = 0; cur_byte < tap_bytes; cur_byte++)
{
- for(cur_bit = 0; cur_bit < 8; cur_bit++)
+ for (cur_bit = 0; cur_bit < 8; cur_bit++)
{
// make sure we do not run off the end of the buffers
unsigned tap_bit = cur_byte * 8 + cur_bit;