From 6d1adf7339b71952d1ba8616af9422fbc7333eb1 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Tue, 25 Aug 2009 08:09:49 +0000 Subject: Updated Benito project -- added hardware interrupt and software buffering for serial data reception to prevent missed characters, condensed pulse generation counters into a struct for clarity. Added check to CDC_Device_BytesReceived() to ensure 0 is returned when device is not enumerated to a host. Move AVRISP project's V2Protocol_DelayMS() function to be static inline, as it is now very minimal. Added extra project doxygen documentation. --- Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.c') diff --git a/Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.c b/Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.c index d259917a6..e23885bb3 100644 --- a/Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.c +++ b/Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.c @@ -40,7 +40,7 @@ uint32_t CurrentAddress; uint8_t V2Protocol_GetSPIPrescalerMask(void) { - static const uint8_t SPIMaskFromSCKDuration[] = + static const uint8_t SPIMaskFromSCKDuration[TOTAL_PROGRAMMING_SPEEDS] = { #if (F_CPU == 8000000) SPI_SPEED_FCPU_DIV_2, @@ -76,12 +76,6 @@ void V2Protocol_ChangeTargetResetLine(bool ResetTarget) } } -void V2Protocol_DelayMS(uint8_t MS) -{ - TCNT0 = 0; - while (TCNT0 < MS); -} - uint8_t V2Protocol_WaitForProgComplete(uint8_t ProgrammingMode, uint16_t PollAddress, uint8_t PollValue, uint8_t DelayMS, uint8_t ReadMemCommand) { @@ -96,7 +90,7 @@ uint8_t V2Protocol_WaitForProgComplete(uint8_t ProgrammingMode, uint16_t PollAdd break; case PROG_MODE_WORD_VALUE_MASK: case PROG_MODE_PAGED_VALUE_MASK: - TCNT0 = 0; + TCNT0 = 0; do { @@ -121,7 +115,7 @@ uint8_t V2Protocol_WaitForProgComplete(uint8_t ProgrammingMode, uint16_t PollAdd uint8_t V2Protocol_WaitWhileTargetBusy(void) { - TCNT0 = 0; + TCNT0 = 0; do { -- cgit v1.2.3