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

platformio configs #30

Merged
merged 1 commit into from
Dec 14, 2024
Merged

platformio configs #30

merged 1 commit into from
Dec 14, 2024

Conversation

vortigont
Copy link
Contributor

allow disabling AQUESTALK/BT via build flags without hacking device_config
allow user to have it's own platformio configs

platformio.ini Show resolved Hide resolved
include/device_config.h Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
@@ -28,17 +28,21 @@
// #define HAS_BALANCE_BOARD_INTEGRATION

// Enable the yukkuri voice talking clock
#ifndef WITHOUT_AQUESTALK
Copy link
Owner

Choose a reason for hiding this comment

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

The aquestalk binary detection script sets a flag AQUESTALK_FOUND, so it may be a good idea to wrap this into that instead of a separate flag.

In such case also change the error down below in the file to a warning to warn the user if the library wasn't found (and move this feature flag down there I guess)

Creating a feature flag for a feature flag as done here is a pattern I would really be against of.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not get how to use that script? For me the project just fails to build until I comment AQUESTALK in device_config.h. And it annoys git of a changed file every time I switch the branches.

Copy link
Owner

@vladkorotnev vladkorotnev Dec 14, 2024

Choose a reason for hiding this comment

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

The error you're getting is most likely not a linker failure but a sanity check coming from here:

#error libaquestalk was not found. See `./lib/nonfree-aquestalk/README.md` on how to add it correctly, or disable `HAS_AQUESTALK` feature flag.
that fails when this pre build script doesn't find the library and thus doesn't set the AQUESTALK_FOUND flag: https://github.com/vladkorotnev/plasma-clock/blob/develop/helper/aquestalk-detect.py

This originally was done to prevent enabling the AquesTalk feature flag when the library file is missing. But now that I think of it, it makes sense to just automatically enable the HAS_AQUESTALK flag when the library is present and disable it otherwise, hence the suggestion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should this work?

#ifdef LIBAQUESTALK_FOUND
#define HAS_AQUESTALK
#endif

Copy link
Owner

Choose a reason for hiding this comment

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

I think so, and add a #warning in #else for good measure, that should fix it for good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes output a bit noisy )

Copy link
Owner

Choose a reason for hiding this comment

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

Logging is never enough, especially in embedded and CI both of which we have :P

allow disabling AQUESTALK/BT via build flags without hacking device_config
@vladkorotnev vladkorotnev changed the base branch from main to develop December 14, 2024 13:49
@vladkorotnev vladkorotnev merged commit 4669723 into vladkorotnev:develop Dec 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

Successfully merging this pull request may close these issues.

2 participants