I messed up the merge, so pushing it over to another repo so I don't lose it. Will tidy up and remove later

Dependencies:   BufferedSerial FatFileSystemCpp mbed

Files at this revision

API Documentation at this revision

Comitter:
JamieB
Date:
Mon Sep 13 13:50:52 2021 +0000
Parent:
59:10ab123d3c7c
Child:
61:e734e86661b0
Commit message:
Added the option to Force the Fizbox to use PPF instead of Genlock Sync.

Changed in this revision

LTCApp.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
settings.txt Show annotated file Show diff for this revision Revisions of this file
--- a/LTCApp.h	Mon Sep 13 07:39:09 2021 +0000
+++ b/LTCApp.h	Mon Sep 13 13:50:52 2021 +0000
@@ -56,6 +56,7 @@
     int OffsetPitch;
     int OffsetYaw;
     int bypassBaud;
+    bool ForcePPF;
 } UserSettings_t;
 
 extern UserSettings_t UserSettings;
--- a/main.cpp	Mon Sep 13 07:39:09 2021 +0000
+++ b/main.cpp	Mon Sep 13 13:50:52 2021 +0000
@@ -1,4 +1,4 @@
-#define APP_VERSION 0.17
+#define APP_VERSION 0.18
 
 /*
 Settings file options
@@ -659,6 +659,7 @@
     UserSettings.OffsetPitch =0;
     UserSettings.OffsetYaw =0;
     UserSettings.bypassBaud = 0;
+    UserSettings.ForcePPF = 0;
 
     LocalFileSystem localFS("local");
     FILE *LSFile= fopen("/local/settings.txt","r");
@@ -778,6 +779,10 @@
                     pc.printf("Got OffsetYaw value from file of %d\r\n",valueIn);
                     UserSettings.OffsetYaw = valueIn;
                 }
+                if (sscanf(lineBuffer,"ForcePPF=%d",&valueIn) == 1) {
+                    pc.printf("Using Forced PPF\r\n",valueIn);
+                    UserSettings.ForcePPF = valueIn;
+                }
 
             }
         }
@@ -1008,7 +1013,7 @@
     pc.printf("Waiting for sync input clock\r\n");
 
 #ifdef enableFakePPF
-    FakePPF.attach(callback(&OnPPFInputStartup),1/24.0);
+    FakePPF.attach(callback(&OnPPFInputStartup),1/50.0);
 #endif
 
     PPFin.rise(callback(&OnPPFInputStartup));
@@ -1027,7 +1032,7 @@
         }
     }
 
-    if (LockToSync) {
+    if (LockToSync && !UserSettings.ForcePPF) {
         pc.printf("Using Genlock sync input\r\n");
         Syncin.rise(callback(&OnPPFInputStartup));
         PPFin.rise(NULL);
@@ -1079,7 +1084,7 @@
         PPFin.rise(callback(&OnPPFInput));
 
 #ifdef enableFakePPF
-    FakePPF.attach(callback(&OnPPFInput),1/24.0);
+    FakePPF.attach(callback(&OnPPFInput),1/50.0);
 #endif
 
     pc.printf("Current time is %02d:%02d:%02d %02d\r\n",movieTime.hours(),movieTime.minutes(),movieTime.seconds(),movieTime.frame());
--- a/settings.txt	Mon Sep 13 07:39:09 2021 +0000
+++ b/settings.txt	Mon Sep 13 13:50:52 2021 +0000
@@ -4,8 +4,9 @@
  #   The system will instead transparently connect the USB COM port to the radio com port
  #   Both ports will be set to the baud rate specified.
  #   When used this option should be first in the options file.
+ --------------------------------
 //RadioConfigPassthrough=115200
- 
+--------------------------------
 
 [Serial Output Format]
 # Sets the serial output format.
@@ -50,17 +51,22 @@
 #Filter order must be set to enable filters.
 #Frequency default is 10Hz
 #Rate default is 100Hz
+
+--------------------------------
 //FilterOrder=1
 //FilterFreq=7
 //FilterRate=100
+--------------------------------
 
+# Enable channels to low pass filter. All filters use the settings given above.
+# A value of 1 enables the filter. A value of 0 or skipping the line disables the filter.
+--------------------------------
 //FilterXY=0
 //FilterZ=0
 //FilterRoll=0
 //FilterPitch=1
 //FilterYaw=0
-# Enable channels to low pass filter. All filters use the settings given above.
-# A value of 1 enables the filter. A value of 0 or skipping the line disables the filter.
+--------------------------------
 
 # NOTE-The filter will add latency so a filtered channel will be delayed relative to an unfiltered one.
  
@@ -71,9 +77,11 @@
 # Setting this option to 1 allows additional fields to be passed through the FIZ box.
 # Currently supported fields are:
 #   Used Beacon List (mask value 0x1000)
+--------------------------------
 //ExtendedOutput=1
+--------------------------------
 
-
+[Frame Delay]
 # By default the FIZ output is sent as soon as possible after the sync pulse.
 # An optional delay can be added to this to either as time or as a proportion of a frame 
 # If both ms and frame delays are set then the frame one will be used.
@@ -81,31 +89,46 @@
 # BIG FLASHING NOTE IN BOLD: No additional buffering is provided so if delay is sufficently large
 #                            that the transmit doesn't complete until after the next frame starts 
 #                            then the message will get corrupted.
+--------------------------------
 #   Delay the serial by a fixed number of ms
 //DelaySerial=5.2
+
 #   Delay the serial by a fraction of a frame
 //DelaySerialFrame=0.3
+
 #   Delay the serial by a fixed number of ms
 //DelayUDP=5.2
+
 #   Delay the serial by a fraction of a frame
 //DelayUDPFrame=0.3
-
+--------------------------------
 
-# Orientation control 
+[Orientation control]
 #   These options allow an offset to be added to an orientation value and the direction of the axis to be reversed.
 #   Offsets are added BEFORE reversing the direction, if offsetting an inverted channel you may need the opposite direction.
 #   Offsets are integer values, inverts are 1 to flip the axis, any other value to maintain direction.
+--------------------------------
 //OffsetRoll=0
 //OffsetPitch=0
 //OffsetYaw=0
 //InvertRoll=1 
 //InvertPitch=1 
 //InvertYaw=1 
- 
-#  Autohypersmooth
+ --------------------------------
+[Autohypersmooth]
 #    A value of 1 will enable this, 0 will disable it.
 #    Default is enabled.
+--------------------------------
 //AutoHyperSmooth=0
+--------------------------------
+
+[Sync Options]
+#   Enable Force PPF option to force the Fixbox to use PPF instead of Genlock Sync (Tri/Bi Level)
+#   WARNING: This will stop the FIzbox from using Genlock Sync Completely, only enable if using a Lockit
+--------------------------------
+// ForcePPF=1
+--------------------------------
+
 
 [NOTES]
 - All settings are case sensitive.