Added reliability patches to the AVRISP-MKII Clone project's ISP and PDI/TPI protocols (thanks to Justin Mattair).

This commit is contained in:
Dean Camera 2011-10-07 04:40:56 +00:00
parent 6553bf5bfb
commit db73b11244
3 changed files with 13 additions and 4 deletions

View file

@ -174,9 +174,14 @@ void XPROGTarget_SendIdle(void)
static void XPROGTarget_SetTxMode(void)
{
/* Wait for a full cycle of the clock */
while (PIND & (1 << 5));
while (!(PIND & (1 << 5)));
/* Need to do nothing for a full frame to send a BREAK - only one cycle should be needed, however
* there are reports that sometimes the interface will get stuck in some environments. */
for (uint8_t i = 0; i < BITS_IN_USART_FRAME; i++)
{
/* Wait for a full cycle of the clock */
while (PIND & (1 << 5));
while (!(PIND & (1 << 5)));
}
PORTD |= (1 << 3);
DDRD |= (1 << 3);