Separate load and USB out, improve state handling

Identified issues:
- The load output and USB charging port shared the same state machine,
  which did not allow to set different switch-off thresholds.
- Load error codes were global, so it was not possible to have multiple
  load instances.

This commit introduces load-specific error_flags, makes the LoadOutput
class inherit from PowerPort (to improve code readability), separates
the load driver better from higher level implementation and adds a
second LoadOutput object for the USB charging port.
This commit is contained in:
Martin Jäger
2020-02-21 18:27:36 +01:00
parent 3c0bc41164
commit fa9d15e796
18 changed files with 341 additions and 474 deletions
+1 -1
View File
@@ -17,7 +17,6 @@
extern DcBus lv_bus;
extern PowerPort lv_terminal;
extern PowerPort load_terminal;
#if CONFIG_HAS_DCDC_CONVERTER
extern DcBus hv_bus;
@@ -40,6 +39,7 @@ extern BatConf bat_conf;
extern BatConf bat_conf_user;
extern LoadOutput load;
extern LoadOutput usb_pwr;
extern ThingSet ts; // defined in data_objects.cpp