A scripting environment used to define precise output/input temporal relationships.
Dependencies: SMARTWAV mbed HelloWorld
Dependents: perturbRoom_legacy
Fork of HelloWorld by
Diff: main.cpp
- Revision:
- 4:34aca2142df9
- Parent:
- 3:ae33b7f5a7c1
--- a/main.cpp Sat Jul 19 03:03:36 2014 +0000 +++ b/main.cpp Thu Sep 25 23:42:30 2014 +0000 @@ -14,7 +14,7 @@ //static char buf1[0x2000] __attribute__((section("AHBSRAM0"))); __attribute((section("AHBSRAM0"),aligned)) outputStream textDisplay(512); -__attribute((section("AHBSRAM0"),aligned)) char buffer[128]; +__attribute((section("AHBSRAM0"),aligned)) char buffer[256]; __attribute((section("AHBSRAM1"),aligned)) event eventBlock[NUMEVENTS]; @@ -61,6 +61,9 @@ DigitalOut clockOutSignal(p7); InterruptIn clockExternalIncrement(p8); +//Camera trigger signal +//DigitalOut camera30Hz(p27); + //Pins for digital ports. Each port has 1 out and 1 in //DigitalOut out1(LED1); //route to LED for debugging @@ -197,6 +200,7 @@ currentBroadcastBit = 0; } + //Every second, we broadcast out the current time if ((timeKeeper % 1000) == 0) { currentBroadcastTime = timeKeeper; @@ -336,7 +340,7 @@ //Set up input buffer for the serial port //char buffer[128]; int bufferPos = 0; - eraseBuffer(buffer,128); + eraseBuffer(buffer,256); ostringstream timeConvert; // stream used for the conversion ostringstream stateConvert; @@ -359,14 +363,14 @@ if ((tmpChar == 13) || (tmpChar == 10)) { //carrriage return parser.addLineToCurrentBlock(buffer); bufferPos = 0; - eraseBuffer(buffer,128); + eraseBuffer(buffer,256); } //pc.putc(tmpChar); } while (tmpChar != EOF); buffer[bufferPos] = 59; parser.addLineToCurrentBlock(buffer); - eraseBuffer(buffer,128); + eraseBuffer(buffer,256); fclose(fp); } else { pc.printf("No startup script found.\r\n");