X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/92adb00f8eebab41853f95bbc0de8a2006c6df3d..73801c73a1684a88bff33aefe3c5aa89bc66c414:/Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.h diff --git a/Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.h b/Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.h index 847770c7b..6dce59d6c 100644 --- a/Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.h +++ b/Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.h @@ -48,16 +48,28 @@ #include "V2ProtocolParams.h" /* Macros: */ - #define TARGET_BUSY_TIMEOUT_MS 100 - + /** Total number of allowable ISP programming speeds supported by the device */ + #define TOTAL_PROGRAMMING_SPEEDS 7 + + /** Timeout in milliseconds of target busy-wait loops waiting for a command to complete */ + #define TARGET_BUSY_TIMEOUT_MS 150 + /* External Variables: */ extern uint32_t CurrentAddress; + /* Inline Functions: */ + static inline void V2Protocol_DelayMS(uint8_t MS) + { + TCNT0 = 0; + while (TCNT0 < MS); + } + /* Function Prototypes: */ uint8_t V2Protocol_GetSPIPrescalerMask(void); void V2Protocol_ChangeTargetResetLine(bool ResetTarget); void V2Protocol_DelayMS(uint8_t MS); - uint8_t V2Protocol_WaitForProgrammingComplete(uint16_t PollAddress, uint8_t ProgrammingMode); + uint8_t V2Protocol_WaitForProgComplete(uint8_t ProgrammingMode, uint16_t PollAddress, uint8_t PollValue, + uint8_t DelayMS, uint8_t ReadMemCommand); uint8_t V2Protocol_WaitWhileTargetBusy(void); void V2Protocol_LoadExtendedAddress(void);