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

Feat/ads7138 delayed init #113

Merged
merged 2 commits into from
Oct 18, 2023
Merged

Feat/ads7138 delayed init #113

merged 2 commits into from
Oct 18, 2023

Conversation

finger563
Copy link
Contributor

Description

  • Store Config in Ads7138 class
  • Add initialize() function which calls protected init(config_)
  • Update Config to have auto_init bool (default=true)
  • Only call initialize() in constructor if config.auto_init is true

Motivation and Context

Sometimes (e.g. when you control power to various chips on the bus to enable ultra-low power modes for your device) you need to be able to separate the class construction from the device initialization. This PR adds support for that, enabling the user to both delay initialization if they choose to do so, as well as to call initialize() whenever they want (e.g. after power cycling the bus).

How has this been tested?

Building the example.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

* Store Config in Ads7138 class
* Add initialize() function which calls protected init(config_)
* Update Config to have auto_init bool (default=true)
* Only call initialize() in constructor if config.auto_init is true
@finger563 finger563 added ads7138 enhancement New feature or request labels Oct 18, 2023
@finger563 finger563 merged commit f37dc95 into main Oct 18, 2023
39 checks passed
@finger563 finger563 deleted the feat/ads7138-delayed-init branch October 18, 2023 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ads7138 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant