diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-10-07 04:40:56 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-10-07 04:40:56 +0000 |
| commit | 670e65a7933ff4031ef6fdd66184de725f0d6f08 (patch) | |
| tree | 29e1e695f2ed4dcb58db7055dd84ea27bf08bd6c /Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c | |
| parent | bff738bbe889cdca166e88ee2083882a1157578a (diff) | |
Added reliability patches to the AVRISP-MKII Clone project's ISP and PDI/TPI protocols (thanks to Justin Mattair).
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1937 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c')
| -rw-r--r-- | Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c index af0cc010..065cd096 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c +++ b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c @@ -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); |
