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

I2C multi-boss bug #3

Open
epccs opened this issue Jul 16, 2020 · 0 comments
Open

I2C multi-boss bug #3

epccs opened this issue Jul 16, 2020 · 0 comments

Comments

@epccs
Copy link
Owner

epccs commented Jul 16, 2020

Three Little Daemons

Actually, they are three state machines running. The day-night daemon (again it's a state machine) tracks the status of the alternate power input which could go to a solar panel. The battery-manager (bm) charges during the DAY and disconnects at other day-night states. The bm has some charging modes and trips the host shutdown if the battery is low. The host shutdown daemon enables the manual switch 90 seconds after powerup or after bringing the host UP from shutdown. When a shutdown occurs by software or manual switch the current is monitored to be stable for 90 seconds and then a 40-second delay occurs before removing power. The 90-second wait can be skipped if the application will stop alternating current usage (blinking LEDs) to cause current usage to be stable.

The daemons are done so that they can report state changes over I2C to the manager. This is done by changing the roles of the I2C devices, normally the application plays the role of boss, and sends things to the peon. But today the peon gets to become the new boss and send daemon events to the old demoted boss. Unfortunately, if the old boss tries to access things again the promoted peon can at times defecate on his ostentation (a bug I have not tied to fix, it seems appropriate for the times).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant