Increase timeout for when the camera is capturing/compressing.

master
Philip Heron 2010-06-29 19:05:17 +01:00
rodzic ea5763b005
commit 7d83c22f1f
1 zmienionych plików z 4 dodań i 1 usunięć

5
c328.c
Wyświetl plik

@ -8,6 +8,9 @@
/* >10ms timeout at 300 hz */
#define CMD_TIMEOUT (4)
/* Wait longer for the camera to take the image and return DATA response */
#define PIC_TIMEOUT (200)
#define RXREADY (UCSR0A & (1 << RXC0))
/* Receive buffer */
@ -141,7 +144,7 @@ char c3_get_picture(uint8_t pt, uint16_t *length)
if(c3_cmd(CMD_GET_PICTURE, pt, 0, 0, 0) != 0) return(-1);
/* The camera should now send a DATA message */
if(c3_rx(CMD_TIMEOUT) != CMD_DATA) return(-1);
if(c3_rx(PIC_TIMEOUT) != CMD_DATA) return(-1);
/* Get the file size from the DATA args */
*length = rxbuf[9] + (rxbuf[10] << 8);