Version 3: Trying to interleave capture and read

Dependencies:   ov7670_lib Project_test

Revision:
5:4135ec0f88e6
Parent:
4:d0d4760d32b2
Child:
6:c7450b320c30
--- a/main.cpp	Sat Feb 15 15:01:55 2014 +0000
+++ b/main.cpp	Mon Apr 06 10:09:18 2020 +0000
@@ -9,24 +9,44 @@
 #define VGA     307200         //640*480
 #define QVGA    76800          //320*240
 #define QQVGA   19200          //160*120
-
+//FileSystem local("local");
 static char format = ' ';
 static int resolution = 0;
 
 
-void rxCallback(MODSERIAL_IRQ_INFO *q) 
-{
-     new_send = true;
-}
+
 
 int main() 
-{  
+{   
+//FILE *wrt=fopen("/local/out.txt","w");
+    int pixel[QQVGA];
+    int pixel2[QQVGA];
+    camera.Init('y', QQVGA);
+    pc.printf("Camera initiated");
+    //camera.CaptureNext();
+    //while(camera.CaptureDone() == false);  
+    camera.ReadStart();  
+        t1 = t.read_ms();
+        t.start();
+        for(int x = 0; x<QQVGA; x++)
+        {
+               pixel[x]=camera.ReadOnebyte();
+               //fprintf(fp,"%i", pixel[x]);
+               //pixel2[x]=camera.ReadOnebyte();
+               //fprintf(fp,"%i/n", pixel2[x]);
+               pc.putc(camera.ReadOnebyte());       
+        }
+       
+        camera.ReadStop();
+        pc.printf("done in %f\r\n",t.read());
+        //fclose(fp);
+ /*   
     pc.baud(921600);       
     pc.printf("SystemCoreClock: %dMHz\r\n", SystemCoreClock/1000000);       // print the clock frequency
     led4 = 0;
   
     t.start();
-    pc.attach(&rxCallback, MODSERIAL::RxIrq);
+    //pc.attach(&rxCallback, MODSERIAL::RxIrq);
 
     while(1) 
     { 
@@ -135,7 +155,7 @@
             }else
             if(strcmp("reset", word) == 0)              
             {
-                    mbed_reset();        
+                    //mbed_reset();        
             }else
             if(strcmp("time", word) == 0)              
             {
@@ -197,5 +217,5 @@
         while(camera.CaptureDone() == false);             
         
         pc.printf("Snap_done\r\n");   
-        led4 = 0;
+        led4 = 0;*/
 }
\ No newline at end of file