You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that the settings should be able to be defined in other places than just the settings header file, so adding guard clauses around them could be an improvement. It also allows these settings to be configured in other libraries.
The text was updated successfully, but these errors were encountered:
So I found that this is a long standing issue with Arduino libraries since the sketches are compiled separately from libraries. Adding the guard clauses then will not allow the settings to be adjusted through sketch #DEFINEs, but it does still have some advantages:
With arduino-cli, you can pass defines while compiling. For example, to change the sample rate: arduino-cli compile ... --build-property "compiler.cpp.extra_flags=-DSAMPLE_RATE=4096 -MMD -c"
The extra options here are platform specific, as some platforms such as esp32 have used the extra_flags property which was originally meant to be reserved for the user. This issue from arduino-cli hopes to create a definitive user namespace for compile flags, which would allow for easier ways to set these flags in the future and possibly GUI ways implemented in Arduino-IDE.
These guard clauses allow other libraries (specifically AudioPrism and Vibrosonics) to use SAMPLE_RATE and WINDOW_SIZE defines as well, either inheriting AudioLab's property or setting their own based on include order.
I think that the settings should be able to be defined in other places than just the settings header file, so adding guard clauses around them could be an improvement. It also allows these settings to be configured in other libraries.
The text was updated successfully, but these errors were encountered: