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

Description
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:
- Utilise the error pin (which is connected to the led) to indicate an error state
- 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.
- 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.
- CAN msgs can be built from structs, so that other users/devs can use that struct to deconstruct your CAN frame. Its cleaner too.
- 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.