Skip to content

zephyr: fuel-gauge: Implement async wrapper #27

Description

@kurtjd

Depends on #26

What

Implement and upstream a safe, idiomatic async Rust wrapper over the raw Rust bindings to the blocking fuel gauge API.

Why

The battery-service needs proper fuel gauge async support to not block the entire executor when reading from fuel gauges. We need to wrap the blocking API (even though we wrapped it in the blocking implementation) because Zephyr does not provide any non-blocking fuel gauge API that I am aware of. However, a naive wrapping like the blocking implementation will not work, since the API inherently will block the entire thread (and hence, executor). So, will need to investigate a safe and performant way to have some worker threads which an async call and push a blocking fuel gauge call to, then be woken again from the worker thread when the transaction completes. Likely overlaps with other subsystems that have this same issue (e.g. sensor).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions