From 7d83c22f1f74c95ca6341992634228050c59659f Mon Sep 17 00:00:00 2001 From: Philip Heron Date: Tue, 29 Jun 2010 19:05:17 +0100 Subject: [PATCH] Increase timeout for when the camera is capturing/compressing. --- c328.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/c328.c b/c328.c index 7ef3746..d7de6f6 100644 --- a/c328.c +++ b/c328.c @@ -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);