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

pijuice driver uses status_set() unidiomatically #2436

Open
jimklimov opened this issue May 10, 2024 · 0 comments
Open

pijuice driver uses status_set() unidiomatically #2436

jimklimov opened this issue May 10, 2024 · 0 comments
Labels
GPIO Drivers talking to devices (or their chips) over GPIO interface raspberry refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings
Milestone

Comments

@jimklimov
Copy link
Member

The method is intended to set individual statuses and takes care of concatenating them into the ultimate ups.status string when flushed, so the logic should be:

  • start new update loop: status_init()
  • collect info from device: occasionally status_set("TOKEN")
  • finally: status_commit() to finalize the ups.status

In this driver I see "manual" preparation of a status_buf[] and then passing it to status_set(), which is not idiomatic and can forfeit some sanity checks done in these methods.

@jimklimov jimklimov added refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings raspberry GPIO Drivers talking to devices (or their chips) over GPIO interface labels May 10, 2024
@jimklimov jimklimov added this to the 2.8.4 milestone May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GPIO Drivers talking to devices (or their chips) over GPIO interface raspberry refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings
Projects
None yet
Development

No branches or pull requests

1 participant