Browse Source

Corrected jtagtap_next signature.

The parameter is TDI (as in input) not TDO. The header signature and
comment are correct.
pull/160/head
Piotr Esden-Tempski 8 years ago
parent
commit
8a009ca6ae
  1. 6
      src/platforms/libftdi/jtagtap.c
  2. 6
      src/platforms/stm32/jtagtap.c
  3. 6
      src/platforms/tm4c/jtagtap.c

6
src/platforms/libftdi/jtagtap.c

@ -185,11 +185,11 @@ jtagtap_tdi_tdo_seq(uint8_t *DO, const uint8_t final_tms, const uint8_t *DI, int
}
#endif
uint8_t jtagtap_next(uint8_t dTMS, uint8_t dTDO)
uint8_t jtagtap_next(uint8_t dTMS, uint8_t dTDI)
{
uint8_t ret;
uint8_t tmp[3] = "\x6B\x00\x00";
tmp[2] = (dTDO?0x80:0) | (dTMS?0x01:0);
tmp[2] = (dTDI?0x80:0) | (dTMS?0x01:0);
// assert(ftdi_write_data(ftdic, tmp, 3) == 3);
// while(ftdi_read_data(ftdic, &ret, 1) != 1);
platform_buffer_write(tmp, 3);
@ -197,7 +197,7 @@ uint8_t jtagtap_next(uint8_t dTMS, uint8_t dTDO)
ret &= 0x80;
// DEBUG("jtagtap_next(TMS = %d, TDO = %d) = %02X\n", dTMS, dTDO, ret);
// DEBUG("jtagtap_next(TMS = %d, TDI = %d) = %02X\n", dTMS, dTDI, ret);
return ret;
}

6
src/platforms/stm32/jtagtap.c

@ -51,17 +51,17 @@ void jtagtap_reset(void)
jtagtap_soft_reset();
}
inline uint8_t jtagtap_next(uint8_t dTMS, uint8_t dTDO)
inline uint8_t jtagtap_next(uint8_t dTMS, uint8_t dTDI)
{
uint16_t ret;
gpio_set_val(TMS_PORT, TMS_PIN, dTMS);
gpio_set_val(TDI_PORT, TDI_PIN, dTDO);
gpio_set_val(TDI_PORT, TDI_PIN, dTDI);
gpio_set(TCK_PORT, TCK_PIN);
ret = gpio_get(TDO_PORT, TDO_PIN);
gpio_clear(TCK_PORT, TCK_PIN);
//DEBUG("jtagtap_next(TMS = %d, TDO = %d) = %d\n", dTMS, dTDO, ret);
//DEBUG("jtagtap_next(TMS = %d, TDI = %d) = %d\n", dTMS, dTDI, ret);
return ret != 0;
}

6
src/platforms/tm4c/jtagtap.c

@ -26,17 +26,17 @@ jtagtap_reset(void)
}
uint8_t
jtagtap_next(const uint8_t dTMS, const uint8_t dTDO)
jtagtap_next(const uint8_t dTMS, const uint8_t dTDI)
{
uint16_t ret;
gpio_set_val(TMS_PORT, TMS_PIN, dTMS);
gpio_set_val(TDI_PORT, TDI_PIN, dTDO);
gpio_set_val(TDI_PORT, TDI_PIN, dTDI);
gpio_set(TCK_PORT, TCK_PIN);
ret = gpio_get(TDO_PORT, TDO_PIN);
gpio_clear(TCK_PORT, TCK_PIN);
DEBUG("jtagtap_next(TMS = %d, TDO = %d) = %d\n", dTMS, dTDO, ret);
DEBUG("jtagtap_next(TMS = %d, TDI = %d) = %d\n", dTMS, dTDI, ret);
return ret != 0;
}

Loading…
Cancel
Save