reticulatedpines / magiclantern_simplified

A Git based version of Magic Lantern, for those unwilling or unable to work using Mercurial. The vast majority of branches have been removed, with those thought to be important brought in individually and merged.
GNU General Public License v2.0
149 stars 51 forks source link

Fix ugly / dangerous guards for raw.c consts #126

Open reticulatedpines opened 8 months ago

reticulatedpines commented 8 months ago

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.