1
Archived scripts / Re: PicoC scripting API
« on: May 28, 2013, 06:06:42 AM »
So I tried adding PicoC functions so I could "press" the DOF preview on my T3 (that doesn't have a hardware DOF preview). This compiled fine previously, but I've been having other issues with my compiled binaries. I'm on a Mac with the yagarto compiler. It doesn't seem like it's my problem, but it makes it hard to figure out what's going on.
Here's my diff to
$ hg diff library_ml.c
diff -r 7fdfc08ac9ad picoc/library_ml.c
--- a/picoc/library_ml.c Mon May 27 23:01:29 2013 +0300
+++ b/picoc/library_ml.c Mon May 27 20:59:19 2013 -0700
@@ -6,6 +6,7 @@
#define UNPRESS -10000 // generic unpress code
#define NO_KEY -1
#define AF_ON 12345
+#define DOF_PREVIEW 23456 // making this up
static char camera_model[32];
static char firmware_version[32];
@@ -139,6 +140,13 @@
case BGMT_PRESS_FULLSHUTTER:
SW2(1,50);
return;
+ case DOF_PREVIEW:
+ {
+ int x = 1;
+ prop_request_change(PROP_DOF_PREVIEW_MAYBE, &x, 2);
+ msleep(50);
+ return;
+ }
default:
if (btn >= 0) fake_simple_button(btn);
}
@@ -200,6 +208,13 @@
unpress = BGMT_UNPRESS_DOWN;
break;
#endif
+ case DOF_PREVIEW:
+ {
+ int x = 0;
+ prop_request_change(PROP_DOF_PREVIEW_MAYBE, &x, 2);
+ msleep(50);
+ return;
+ }
default:
// this button does not have an unpress code
@@ -1347,6 +1362,7 @@
CONST0(UNPRESS)
CONST0(NO_KEY)
CONST0(AF_ON)
+ CONST0(DOF_PREVIEW)
CONST0(HALFSHUTTER_PRESSED)
/** Color codes */
Here's my diff to
$ hg diff library_ml.c
diff -r 7fdfc08ac9ad picoc/library_ml.c
--- a/picoc/library_ml.c Mon May 27 23:01:29 2013 +0300
+++ b/picoc/library_ml.c Mon May 27 20:59:19 2013 -0700
@@ -6,6 +6,7 @@
#define UNPRESS -10000 // generic unpress code
#define NO_KEY -1
#define AF_ON 12345
+#define DOF_PREVIEW 23456 // making this up
static char camera_model[32];
static char firmware_version[32];
@@ -139,6 +140,13 @@
case BGMT_PRESS_FULLSHUTTER:
SW2(1,50);
return;
+ case DOF_PREVIEW:
+ {
+ int x = 1;
+ prop_request_change(PROP_DOF_PREVIEW_MAYBE, &x, 2);
+ msleep(50);
+ return;
+ }
default:
if (btn >= 0) fake_simple_button(btn);
}
@@ -200,6 +208,13 @@
unpress = BGMT_UNPRESS_DOWN;
break;
#endif
+ case DOF_PREVIEW:
+ {
+ int x = 0;
+ prop_request_change(PROP_DOF_PREVIEW_MAYBE, &x, 2);
+ msleep(50);
+ return;
+ }
default:
// this button does not have an unpress code
@@ -1347,6 +1362,7 @@
CONST0(UNPRESS)
CONST0(NO_KEY)
CONST0(AF_ON)
+ CONST0(DOF_PREVIEW)
CONST0(HALFSHUTTER_PRESSED)
/** Color codes */