Skip to content

Include a target's config.h before common_pre.h. #13439

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

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

hydra
Copy link
Contributor

@hydra hydra commented Mar 11, 2024

Some gating in common_pre.h requires the target's #defines to be present, such as #if defined(USE_LED_STRIP)...

Fixes #13438.

Some gating in `common_pre.h` requires the target's `#define`s to be present, such as `#if defined(USE_LED_STRIP)`...
Copy link

Do you want to test this code? You can flash it directly from Betaflight Configurator:

  • Simply put #13439 (this pull request number) in the Select commit field of the Configurator firmware flasher tab (you need to Enable expert mode, Show release candidates and Development).

WARNING: It may be unstable. Use only for testing!

@haslinghuis haslinghuis added this to the 4.5 milestone Mar 11, 2024
@hydra
Copy link
Contributor Author

hydra commented Mar 11, 2024

Additionally, for those following along, I understand that there should be no logic in any target's config.h file because:
a) there's no tests for this logic in the target's repo from where the files come from.
b) the files are used by the build system/.mk files, which does not understand code gating / logic (see mk\config.mk's use of grep)

Copy link
Member

@haslinghuis haslinghuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested cloud build with AIRBOTG4AIO and builds with

make MATEKH743
make MATEKH743 EXTRA_FLAGS="-DCORE_BUILD"
make MATEKH743 EXTRA_FLAGS="-DCLOUD_BUILD"

@nerdCopter
Copy link
Member

nerdCopter commented Mar 11, 2024

no compile errors with:
make FOXEERF405
make FOXEERF405 EXTRA_FLAGS="-DCORE_BUILD"
make FOXEERF405 EXTRA_FLAGS="-D'BUILD_KEY=0a2a83e811eb1440ce59540f90f2e1bd' -D'RELEASE_NAME=4.5.0-dev' -DCLOUD_BUILD -DUSE_CAMERA_CONTROL -DUSE_DSHOT -DUSE_EMFAT_AUTORUN -DUSE_EMFAT_ICON -DUSE_EMFAT_TOOLS -DUSE_GPS -DUSE_GPS_PLUS_CODES -DUSE_LED_STRIP -DUSE_MAG -DUSE_OSD -DUSE_OSD_HD -DUSE_OSD_SD -DUSE_PINIO -DUSE_SERIALRX -DUSE_SERIALRX_CRSF -DUSE_TELEMETRY -DUSE_TELEMETRY_CRSF -DUSE_VTX" (and without -DUSE_LED_STRIP) (Flashing both of these resulted in expected results.)

@ledvinap
Copy link
Contributor

@haslinghuis: Looks quite safe, but I don't know this part of code

@ledvinap
Copy link
Contributor

(@haslinghuis: Notification mail is sent before you delete comment and it's confusing when you can't find it)

@haslinghuis haslinghuis merged commit ecef09f into betaflight:master Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: COMPLETED
Development

Successfully merging this pull request may close these issues.

Compilation error when target's config.h defines USE_LED_STRIP.
4 participants