specify timeout in milliseconds
This commit is contained in:
@@ -49,8 +49,9 @@ uint8_t wait_receive(uint8_t len, uint16_t dest[], uint8_t timeout){
|
|||||||
uint8_t breaker = timeout;
|
uint8_t breaker = timeout;
|
||||||
while(!receiveOkay && breaker) { //wait for client response, time out after 1s
|
while(!receiveOkay && breaker) { //wait for client response, time out after 1s
|
||||||
breaker--;
|
breaker--;
|
||||||
_delay_ms(10);
|
_delay_ms(1);
|
||||||
}
|
}
|
||||||
|
printf("breaker: %d\n\r", breaker);
|
||||||
|
|
||||||
if(receiveOkay) { //if this fails, there was either no response or a crc error
|
if(receiveOkay) { //if this fails, there was either no response or a crc error
|
||||||
if(rxbuffer[1]&0x80) { //client responded with an error code
|
if(rxbuffer[1]&0x80) { //client responded with an error code
|
||||||
|
|||||||
Reference in New Issue
Block a user