Update all demos, projects and bootloaders to indent all function parameters, one...
[pub/USBasp.git] / Projects / AVRISP-MKII / Lib / XPROG / XPROGTarget.c
index 5598791..2e52005 100644 (file)
@@ -138,9 +138,6 @@ void XPROGTarget_SendByte(const uint8_t Byte)
        while (!(UCSR1A & (1 << UDRE1)));
        UCSR1A |= (1 << TXC1);
        UDR1    = Byte;
        while (!(UCSR1A & (1 << UDRE1)));
        UCSR1A |= (1 << TXC1);
        UDR1    = Byte;
-
-    if (TimeoutMSRemaining)
-         TimeoutMSRemaining = COMMAND_TIMEOUT_MS;
 }
 
 /** Receives a byte via the software USART, blocking until data is received.
 }
 
 /** Receives a byte via the software USART, blocking until data is received.
@@ -154,10 +151,7 @@ uint8_t XPROGTarget_ReceiveByte(void)
          XPROGTarget_SetRxMode();
 
        /* Wait until a byte has been received before reading */
          XPROGTarget_SetRxMode();
 
        /* Wait until a byte has been received before reading */
-       while (!(UCSR1A & (1 << RXC1)) && TimeoutMSRemaining);
-       
-       if (TimeoutMSRemaining)
-         TimeoutMSRemaining = COMMAND_TIMEOUT_MS;
+       while (!(UCSR1A & (1 << RXC1)) && TimeoutTicksRemaining);
 
        return UDR1;
 }
 
        return UDR1;
 }
@@ -176,9 +170,6 @@ void XPROGTarget_SendBreak(void)
                while (PIND & (1 << 5));
                while (!(PIND & (1 << 5)));
        }
                while (PIND & (1 << 5));
                while (!(PIND & (1 << 5)));
        }
-
-    if (TimeoutMSRemaining)
-         TimeoutMSRemaining = COMMAND_TIMEOUT_MS;
 }
 
 static void XPROGTarget_SetTxMode(void)
 }
 
 static void XPROGTarget_SetTxMode(void)
@@ -192,11 +183,6 @@ static void XPROGTarget_SetTxMode(void)
 
        UCSR1B &= ~(1 << RXEN1);
        UCSR1B |=  (1 << TXEN1);
 
        UCSR1B &= ~(1 << RXEN1);
        UCSR1B |=  (1 << TXEN1);
-               
-       IsSending = true;
-
-    if (TimeoutMSRemaining)
-         TimeoutMSRemaining = COMMAND_TIMEOUT_MS;
 
        IsSending = true;
 }
 
        IsSending = true;
 }
@@ -212,9 +198,6 @@ static void XPROGTarget_SetRxMode(void)
        DDRD   &= ~(1 << 3);
        PORTD  &= ~(1 << 3);
 
        DDRD   &= ~(1 << 3);
        PORTD  &= ~(1 << 3);
 
-    if (TimeoutMSRemaining)
-         TimeoutMSRemaining = COMMAND_TIMEOUT_MS;
-
        IsSending = false;
 }
 
        IsSending = false;
 }