src/lib/jtag.c
inline u_long msbit(u_long bits)
{
    if (bits & 0x80000000)
        PIO_SODR = MASK(TDI_BIT);
    else
        PIO_CODR = MASK(TDI_BIT);

    CLK_HIGH;
    bits <<= 1;
        
    if( PIO_PDSR & MASK(TDO_BIT) ) {
        bits |= 1;
    }
    CLK_LOW;

    return bits;
}
// Shift the MSB of bits into the JTAG scan chain, shift bits left,
// and put the JTAG scan chain output into the LSB of bits
Shift the MSB of bits into the JTAG scan chain, shift bits left,
and put the JTAG scan chain output into the LSB of bits
Shift the MSB of bits into the JTAG scan chain shift bits left and put the JTAG scan chain output into the LSB of bits
inline u_long msbit(u_long bits)
{
    if (bits & 0x80000000)
        PIO_SODR = MASK(TDI_BIT);
    else
        PIO_CODR = MASK(TDI_BIT);
    CLK_HIGH;
    bits <<= 1;
    if( PIO_PDSR & MASK(TDO_BIT) ) {
        bits |= 1;
    }
    CLK_LOW;
    return bits;
}
inline u_long msbit ( u_long bits ) { if ( bits & 0x80000000 ) PIO_SODR = MASK ( TDI_BIT ) ; else PIO_CODR = MASK ( TDI_BIT ) ; CLK_HIGH ; bits <<= 1 ; if ( PIO_PDSR & MASK ( TDO_BIT ) ) { bits |= 1 ; } CLK_LOW ; return bits ; }
Shift the MSB of bits into the JTAG scan chain, shift bits left,
and put the JTAG scan chain output into the LSB of bits
Shift the MSB of bits into the JTAG scan chain shift bits left and put the JTAG scan chain output into the LSB of bits