Skip to content
This repository was archived by the owner on Nov 23, 2025. It is now read-only.
This repository was archived by the owner on Nov 23, 2025. It is now read-only.

PMB improvements #33

@pipipipi2002

Description

@pipipipi2002

Although #23 fixed most of the ambiguous code used in PMB, it aint clean and there are still useless code that may cause confusion. Some improvements that can be done:

  1. Utilise the error pin (which is connected to the led) to indicate an error state
  2. Remove consumption and soc read from BQ. If i read correctly, the soc and consumption can only be useful if the BQ chip is constantly powered such that it can measure leakage and maintain number of charge cycles to determine health.
  3. With soc and consumption removed, combine the pmb and battery stats to one CAN msg frame. The other frame shall be an error frame which can be used to send warnings to the SBC.
  4. CAN msgs can be built from structs, so that other users/devs can use that struct to deconstruct your CAN frame. Its cleaner too.
  5. Header file containing the port declarations / other macros need to be consolidated and make neater. Some of them are declared but not used at all, see pmb_define.h. Add header guard too.

Metadata

Metadata

Assignees

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