Changes to allow hardware camera trigger
Fork of GPS_Incremental by
Diff: main.cpp
- Revision:
- 10:078891935385
- Parent:
- 9:13724ed3f825
--- a/main.cpp Wed Apr 17 13:50:21 2013 +0000
+++ b/main.cpp Thu Apr 18 00:59:49 2013 +0000
@@ -14,7 +14,7 @@
DigitalOut ppsled(LED1); //blink an LED at the 1PPS
DigitalOut trig1led(LED2); //blink an LED at the camera trigger detection
DigitalOut recordDataled(LED4); //set the led when the record is on
-InterruptIn camera1Int(p30); // camera interrupt in
+//InterruptIn camera1Int(p30); // camera interrupt in
DigitalOut camera2Pin(p29); // We dont use the second camera interrupt
//USB serial data stream back to the PC
Serial toPC(USBTX, USBRX); //connect the GPS TX, RX to p9 and p10
@@ -65,15 +65,15 @@
};
//ISR for detection of the hotshoe trigger 1
-void camera1ISR(void)
-{
+//void camera1ISR(void)
+//{
//GPSTime is from POS message header
//PPSTimeOffset is an even sec to account for Time becoming known AFTER the 1PPS
//PPSTimeOffset + timeFromPPS.read() can be as large as 1.02 secs
- camera1Time = GPSTime + PPSTimeOffset + timeFromPPS.read();
- camera1EventDetected = true; //reset to false in main after processing the image detection
- trig1led = !trig1led; //blink an LEWD at the camera event detection
-};
+// camera1Time = GPSTime + PPSTimeOffset + timeFromPPS.read();
+// camera1EventDetected = true; //reset to false in main after processing the image detection
+// trig1led = !trig1led; //blink an LEWD at the camera event detection
+//};
///////////////////////////////////////////////////////
//set up the USB port and the GPS COM port
@@ -171,10 +171,10 @@
void setupTriggers()
{
- camera1Int.mode(PullUp);
+// camera1Int.mode(PullUp);
camera2Pin = 1;
//establish Trigger ISR
- camera1Int.rise(&camera1ISR);
+// camera1Int.rise(&camera1ISR);
};
@@ -352,7 +352,14 @@
if (camera1EventDetected) //we have detected a camera trigger event
{
+ camera2Pin=0;
+ wait(.25);
+ camera2Pin=1;
+ wait(.50);
+ camera2Pin=0;
+ camera1Time = GPSTime + PPSTimeOffset + timeFromPPS.read();
toPC.printf("WMsg TRIGGERTIME %5.3lf\n", camera1Time);
+ camera2Pin=1;
camera1EventDetected = false;
}
