Merge pull request #160 from esden/jtagtap_next_params

Corrected jtagtap_next signature.
This commit is contained in:
Gareth McMullin 2016-10-19 14:26:27 -07:00 committed by GitHub
commit fe4bae7942
3 changed files with 9 additions and 9 deletions

View File

@ -185,11 +185,11 @@ jtagtap_tdi_tdo_seq(uint8_t *DO, const uint8_t final_tms, const uint8_t *DI, int
} }
#endif #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 ret;
uint8_t tmp[3] = "\x6B\x00\x00"; 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); // assert(ftdi_write_data(ftdic, tmp, 3) == 3);
// while(ftdi_read_data(ftdic, &ret, 1) != 1); // while(ftdi_read_data(ftdic, &ret, 1) != 1);
platform_buffer_write(tmp, 3); platform_buffer_write(tmp, 3);
@ -197,7 +197,7 @@ uint8_t jtagtap_next(uint8_t dTMS, uint8_t dTDO)
ret &= 0x80; 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; return ret;
} }

View File

@ -51,17 +51,17 @@ void jtagtap_reset(void)
jtagtap_soft_reset(); 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; uint16_t ret;
gpio_set_val(TMS_PORT, TMS_PIN, dTMS); 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); gpio_set(TCK_PORT, TCK_PIN);
ret = gpio_get(TDO_PORT, TDO_PIN); ret = gpio_get(TDO_PORT, TDO_PIN);
gpio_clear(TCK_PORT, TCK_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; return ret != 0;
} }

View File

@ -26,17 +26,17 @@ jtagtap_reset(void)
} }
uint8_t 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; uint16_t ret;
gpio_set_val(TMS_PORT, TMS_PIN, dTMS); 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); gpio_set(TCK_PORT, TCK_PIN);
ret = gpio_get(TDO_PORT, TDO_PIN); ret = gpio_get(TDO_PORT, TDO_PIN);
gpio_clear(TCK_PORT, TCK_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; return ret != 0;
} }