Commits

a1ex committed 25cc534

5D3: enabled DotTune AFMA

Comments (3)

  1. One Percent

    Should work on 6d too: PROP_AF_MICROADJUSTMENT is the same.

    Usually get "too much data" and adjustments don't show up in canon menu. If you wake the camera up from the screen going to sleep (should it?) it returns a value. I looked and have W and T, will have to browse the property to find right offsets.

    1. a1ex author

      Yeah, the algorithm needs some fine-tuning. Looks like I should consider only long confirmations (and filter out the short ones), but this is tricky in artificial light.

      What returns a value? the property handler? All of them are fired at startup.

Files changed (2)

platform/5D3.113/cfn.c

     some_cfn[9] = COERCE(value, 0, 2);
     prop_request_change(0x80010007, some_cfn, 0x2f);
 }
+
+// 5D3 only; other cameras have different offsets, buffer size etc
+#define PROP_AFMA_CFN 0x80040027
+static int8_t afma_buf[0x10];
+#define AFMA_MODE       afma_buf[0x0]
+#define AFMA_PER_LENS_A afma_buf[0x2]
+#define AFMA_PER_LENS_B afma_buf[0x3]
+#define AFMA_ALL_LENSES afma_buf[0x5]
+
+PROP_HANDLER(PROP_AFMA_CFN)
+{
+    ASSERT(len == sizeof(afma_buf));
+    my_memcpy(afma_buf, buf, sizeof(afma_buf));
+}
+
+int get_afma(int per_lens)
+{
+    if (per_lens == -1) per_lens = (AFMA_MODE == 2 ? 1 : 0);
+    
+    if (per_lens)
+        return AFMA_PER_LENS_A;
+    else
+        return AFMA_ALL_LENSES;
+}
+
+void set_afma(int value, int per_lens)
+{
+    if (ml_shutdown_requested) return;
+
+    if (per_lens == -1) per_lens = (AFMA_MODE == 2 ? 1 : 0);
+    
+    value = COERCE(value, -20, 20);
+    if (per_lens)
+    {
+        AFMA_PER_LENS_A = AFMA_PER_LENS_B = value;
+        AFMA_MODE = 2;
+    }
+    else
+    {
+        AFMA_ALL_LENSES = value;
+        AFMA_MODE = 1;
+    }
+    prop_request_change(PROP_AFMA_CFN, afma_buf, sizeof(afma_buf));
+}

platform/5D3.113/features.h

 #undef FEATURE_LV_ZOOM_AUTO_EXPOSURE // seems to cause black pictures
 
 //~ #define FEATURE_VIDEO_HACKS
+
+#define FEATURE_AFMA_TUNING