X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/258a6a01777afadbf6913246f12a7106b421b795..df31b1fd5b0bfbf02a766d32e23a7af075bf4911:/Projects/AVRISP/Lib/V2Protocol.h diff --git a/Projects/AVRISP/Lib/V2Protocol.h b/Projects/AVRISP/Lib/V2Protocol.h index 8a0ac2f7d..1777e0fe1 100644 --- a/Projects/AVRISP/Lib/V2Protocol.h +++ b/Projects/AVRISP/Lib/V2Protocol.h @@ -47,8 +47,8 @@ #include "PDIProtocol.h" /* Preprocessor Checks: */ - #if BOARD == BOARD_XPLAIN - #undef ENABLE_ISP_PROTOCOL + #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1)) + #undef ENABLE_ISP_PROTOCOL #if !defined(ENABLE_PDI_PROTOCOL) #define ENABLE_PDI_PROTOCOL @@ -57,7 +57,7 @@ /* Macros: */ /** Programmer ID string, returned to the host during the CMD_SIGN_ON command processing */ - #define PROGRAMMER_ID "AVRISP_MK2" + #define PROGRAMMER_ID "AVRISP_MK2" /** Timeout in milliseconds of target busy-wait loops waiting for a command to complete */ #define TARGET_BUSY_TIMEOUT_MS 240 @@ -70,7 +70,16 @@ static inline void V2Protocol_DelayMS(uint8_t DelayMS) { TCNT0 = 0; - while (TCNT0 < DelayMS); + TIFR0 = (1 << OCF1A); + + while (DelayMS) + { + if (TIFR0 & (1 << OCF1A)) + { + TIFR0 = (1 << OCF1A); + DelayMS--; + } + } } /* External Variables: */