Compare commits

...

3 Commits

Author SHA1 Message Date
ole00 998b1329c8 jtag: improve detection of power switch being turned off 2024-04-24 23:16:14 +01:00
ole00 a3e6f11b0f jtag: added debugging pp symbol to ignore failed matches
This can help printing data register when a mismatch
occurs.
2024-04-24 23:12:20 +01:00
ole00 7c0a32cba3 jtag: fix compilation warning 2024-04-24 23:09:01 +01:00
1 changed files with 12 additions and 3 deletions

View File

@ -45,6 +45,7 @@ Arduino usage:
#define XSVF_DEBUG 0
#define XSVF_CALC_CSUM 1
#define XSVF_IGNORE_NOMATCH 0
#define XCOMPLETE 0
#define XTDOMASK 1
@ -372,7 +373,7 @@ static uint32_t xsvf_player_get_next_long(void) {
return i;
}
static uint32_t xsvf_player_get_next_bytes(uint8_t* data, uint32_t count) {
static void xsvf_player_get_next_bytes(uint8_t* data, uint32_t count) {
while(count--) {
*data++ = xsvf_player_next_byte();
}
@ -583,17 +584,19 @@ static uint8_t xsvf_jtag_is_tdo_as_expected(uint8_t use_mask)
expected &= mask;
actual &= mask;
}
#if XSVF_IGNORE_NOMATCH != 1
if (expected != actual) {
#if XSVF_DEBUG
Serial.println(F("D...NO MATCH!"));
#endif
#endif
return 0;
}
#endif
}
#if XSVF_DEBUG
Serial.println(F("D...match!"));
#endif
#endif
return 1;
}
@ -976,6 +979,12 @@ static void jtag_play_xsvf(jtag_port_t* port)
if (xsvf->xcomplete) {
Serial.println(F("Q-0,OK"));
}
//the 3 pins must be low or else the vref might be triggered next time
digitalWrite(port->tms, 0);
digitalWrite(port->tdi, 0);
digitalWrite(port->tck, 0);
delay(100);
// put the jtag port pins into High-Z (vref already is input)
pinMode(port->tms, INPUT);
pinMode(port->tdi, INPUT);