Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
reticulatedpines opened this issue Jan 13, 2024 · 0 comments
Open

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

reticulatedpines opened this issue Jan 13, 2024 · 0 comments

Comments

@reticulatedpines
Copy link
Owner

reticulatedpines commented Jan 13, 2024

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 reticulatedpines changed the title Ugly / dangerous guards for raw.c consts Fix ugly / dangerous guards for raw.c consts Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant