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

Include refactoring #121

Merged
merged 4 commits into from
Aug 20, 2024

Conversation

andreagilardoni
Copy link
Contributor

This PR aims to split the entrypoint for this library into definitions of macro config values, connectionHandlerInterface. This allows to avoid cyclic includes in the extension of functionalities of this library.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

@andreagilardoni andreagilardoni force-pushed the include-refactoring branch 2 times, most recently from d8586b2 to 6569c17 Compare June 5, 2024 13:27

This comment was marked as outdated.

This comment was marked as outdated.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jun 5, 2024
Copy link
Contributor

@pennam pennam left a comment

Choose a reason for hiding this comment

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

@andreagilardoni I've got two proposals to improve this PR:

  • Add #ifdef BOARD_HAS_XXX also in the various Connectionhandler .h files. This would allow us to add something like
#ifdef BOARD_HAS_XXX
...
#else
#error Board do not support NBConnectionHandler
#endif

and this should trigger a nice error if you build for example a sketch for Portenta H7 including Arduino_NBConnectionHandler.h

  • Remove Arduino_ from all ConnectionHandlers implementation *.h *.cpp files to make more clear that the official entrypoint of the library is only Arduino_ConnectionHandler.h
    This would not prevent the users to include directly NBConnectionHandler.h, but would be a strong suggestion and we can leave in place also the #ifdef BOARD_HAS_XXX check

Removing Arduino_ from the implementation files will also free the names so we can reuse them to make some ifdef magic and configure the library from an external library.

@andreagilardoni

This comment was marked as resolved.

Copy link

Memory usage change @ bc9691b

Board flash % RAM for global variables %
arduino:esp32:nano_nora 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed:envie_m7 N/A N/A N/A N/A
arduino:mbed_edge:edge_control 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_giga:giga 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nicla:nicla_vision 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_opta:opta 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:renesas_uno:unor4wifi 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp32:esp32:esp32 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/ConnectionHandlerDemo
flash
% examples/ConnectionHandlerDemo
RAM for global variables
%
arduino:esp32:nano_nora 0 0.0 0 0.0
arduino:mbed:envie_m7 N/A N/A N/A N/A
arduino:mbed_edge:edge_control 0 0.0 0 0.0
arduino:mbed_giga:giga 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect 0 0.0 0 0.0
arduino:mbed_nicla:nicla_vision 0 0.0 0 0.0
arduino:mbed_opta:opta 0 0.0 0 0.0
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 0 0.0 0 0.0
arduino:renesas_uno:unor4wifi 0 0.0 0 0.0
arduino:samd:mkr1000 0 0.0 0 0.0
arduino:samd:mkrgsm1400 0 0.0 0 0.0
arduino:samd:mkrnb1500 0 0.0 0 0.0
arduino:samd:mkrwan1300 0 0.0 0 0.0
arduino:samd:mkrwan1310 0 0.0 0 0.0
arduino:samd:mkrwifi1010 0 0.0 0 0.0
arduino:samd:nano_33_iot 0 0.0 0 0.0
esp32:esp32:esp32 0 0.0 0 0.0
esp8266:esp8266:huzzah 0 0.0 0 0.0
Click for full report CSV
Board,examples/ConnectionHandlerDemo<br>flash,%,examples/ConnectionHandlerDemo<br>RAM for global variables,%
arduino:esp32:nano_nora,0,0.0,0,0.0
arduino:mbed:envie_m7,N/A,N/A,N/A,N/A
arduino:mbed_edge:edge_control,0,0.0,0,0.0
arduino:mbed_giga:giga,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,0,0.0,0,0.0
arduino:mbed_nicla:nicla_vision,0,0.0,0,0.0
arduino:mbed_opta:opta,0,0.0,0,0.0
arduino:mbed_portenta:envie_m7,N/A,N/A,N/A,N/A
arduino:renesas_portenta:portenta_c33,0,0.0,0,0.0
arduino:renesas_uno:unor4wifi,0,0.0,0,0.0
arduino:samd:mkr1000,0,0.0,0,0.0
arduino:samd:mkrgsm1400,0,0.0,0,0.0
arduino:samd:mkrnb1500,0,0.0,0,0.0
arduino:samd:mkrwan1300,0,0.0,0,0.0
arduino:samd:mkrwan1310,0,0.0,0,0.0
arduino:samd:mkrwifi1010,0,0.0,0,0.0
arduino:samd:nano_33_iot,0,0.0,0,0.0
esp32:esp32:esp32,0,0.0,0,0.0
esp8266:esp8266:huzzah,0,0.0,0,0.0

@arduino-libraries arduino-libraries deleted a comment from github-actions bot Aug 20, 2024
@arduino-libraries arduino-libraries deleted a comment from github-actions bot Aug 20, 2024
@pennam pennam self-requested a review August 20, 2024 14:23
@pennam pennam merged commit 4419df1 into arduino-libraries:master Aug 20, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants