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

Header file conflict with BQ24195 library #3

Closed
aliphys opened this issue Aug 8, 2022 · 2 comments · Fixed by #20
Closed

Header file conflict with BQ24195 library #3

aliphys opened this issue Aug 8, 2022 · 2 comments · Fixed by #20
Labels
conclusion: resolved Issue was resolved topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project

Comments

@aliphys
Copy link
Contributor

aliphys commented Aug 8, 2022

In the example BasicUsage.ino, we call the Arduino_PMIC.h header file.

#include "Arduino_PMIC.h"


This is problematic for two main reasons:

  • Firstly, the naming implies that there is a single unified interface for dealing with PMIC across the Arduino ecosystem. Which there isn't: we have four in active use AFAIK. This leads to confusion from a documentation point of view.
  • Secondly, given the way files are arranged library conflicts may occur between the BQ24195 and PF1550 library since both have a Arduino_PMIC.h file. Depending upon which library is loaded first, it can block the other library from loading.

Possible Solutions

  • Quick fix: In our examples, we directly call the relevant library. So instead of Arduino_PMIC.h we would use BQ24195.h or PF1550.h. This should be possible. Users are then advised to check which board they have and select the PMIC library accordingly. This would slightly reduce the portability of the code, but ensure that it runs correctly
  • Intensive Fix: Have a wrapper library, which contains Arduino_PMIC.h that calls the relevant PMIC library based on the board selected in the IDE or (optionally) an option in the sketch directly. I assume this would require more work (and potentially break things). Yet it would make the user experience more fluid.
  • The third option would be to integrate the PMIC library directly into the core variant. @giulcioffi and @facchinm have done this for the https://github.com/arduino/ArduinoCore-mbed/blob/master/libraries/Nicla_System/src/BQ25120A.h

Until a solution is decided upon & delivered, is it safe to use PF1550.h inside newly developed tutorials & app notes?

Related to: arduino-libraries/Arduino_BQ24195#23

@aliphys
Copy link
Contributor Author

aliphys commented Sep 16, 2022

The linter shows an error which seems to be related to the header naming issue:

WARNING: No header file found matching library name (Arduino_PF1550.h). Best practices are for primary header filename  
         to match library name.                                                                                         
         See: https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format         
         (Rule LS008)      

@sebromero
Copy link
Contributor

@aliphys When #20 gets merged, sketches should use the new Arduino_PF1550.h include instead. I already adjusted it in the example sketches.

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: documentation Related to documentation for the project labels Dec 11, 2023
@per1234 per1234 linked a pull request Dec 11, 2023 that will close this issue
@per1234 per1234 added the conclusion: resolved Issue was resolved label Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants