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

Use interrupt-based USB power detection #25

Open
stoffera opened this issue Jul 18, 2017 · 0 comments
Open

Use interrupt-based USB power detection #25

stoffera opened this issue Jul 18, 2017 · 0 comments
Assignees
Milestone

Comments

@stoffera
Copy link
Contributor

The Power System IC controls the battery charging and USB power supply. We use I2C to communicate with it, regularly asking about the current charge status.

The charge status is needed to enable or disable the USB UART (CDC) stack.

Problem

The run loop polls the power IC for the USB charge status too often. This triggers I2C communication on every run loop iteration, significantly slowing down the app execution. The CPU spends most of it cycles polling the power IC about the charging status - which is a waste.

Solution

We should utilize the power IC capability to send the CPU interrupt upon charging changes. This will eliminate the need for run loop polling.

Note: We will still need to poll the power IC on system POR and wake from sleep.

@stoffera stoffera added this to the 2.0 milestone Jul 18, 2017
@stoffera stoffera self-assigned this Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant