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/ISP | |
| 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/ISP')
| -rw-r--r-- | Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c b/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c index e9e92f99..797fa365 100644 --- a/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c +++ b/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c @@ -69,10 +69,11 @@ void ISPProtocol_EnterISPMode(void) ISPTarget_EnableTargetISP(); ISPTarget_ChangeTargetResetLine(true); + ISPProtocol_DelayMS(Enter_ISP_Params.PinStabDelayMS); /* Continuously attempt to synchronize with the target until either the number of attempts specified * by the host has exceeded, or the the device sends back the expected response values */ - while (Enter_ISP_Params.SynchLoops-- && (ResponseStatus != STATUS_CMD_OK) && !(TimeoutExpired)) + while (Enter_ISP_Params.SynchLoops-- && !(TimeoutExpired)) { uint8_t ResponseBytes[4]; @@ -86,12 +87,14 @@ void ISPProtocol_EnterISPMode(void) if (!(Enter_ISP_Params.PollIndex) || (ResponseBytes[Enter_ISP_Params.PollIndex - 1] == Enter_ISP_Params.PollValue)) { ResponseStatus = STATUS_CMD_OK; + break; } else { ISPTarget_ChangeTargetResetLine(false); ISPProtocol_DelayMS(Enter_ISP_Params.PinStabDelayMS); ISPTarget_ChangeTargetResetLine(true); + ISPProtocol_DelayMS(Enter_ISP_Params.PinStabDelayMS); } } |
