magiclantern_simplified icon indicating copy to clipboard operation
magiclantern_simplified copied to clipboard

Fix ugly / dangerous guards for raw.c consts

Open reticulatedpines opened this issue 1 year ago • 0 comments

In raw.c we have:

 228 #ifdef CONFIG_DIGIC_V
 229 #define RAW_TYPE_REGISTER 0xC0F37014
 230 #define PREFERRED_RAW_TYPE 0x10         /* CCD; also valid for DIGIC 6 */
 231 #else
 232 #define RAW_TYPE_REGISTER 0xC0F08114    /* PACK32_ISEL */
 233 #define PREFERRED_RAW_TYPE 0x5          /* DIGIC 4: CCD */
 234 #endif

This is definitely wrong for D678X, which don't use the 0xc0fX_YYYY range for these things. The obvious quick fix of marking the second case digic 4 and erroring in a new "else" case breaks all D678X builds. Hopefully we don't try to access the register, given the limited features enabled.

We should get a clean fix here by finding the reg (probably not hard), but we should also audit for other similar ugly version checks and create issues / fix.

reticulatedpines avatar Jan 13 '24 15:01 reticulatedpines