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:
+2
-2
@@ -47,8 +47,8 @@ PwmSwitch pwm_switch(&lv_bus);
|
||||
#endif
|
||||
|
||||
#if CONFIG_HAS_LOAD_OUTPUT
|
||||
PowerPort load_terminal(&lv_bus); // load terminal (also connected to lv_bus)
|
||||
LoadOutput load(&load_terminal);
|
||||
LoadOutput load(&lv_bus, &load_out_set, &load_out_init);
|
||||
LoadOutput usb_pwr(&lv_bus, &usb_out_set, &usb_out_init);
|
||||
#endif
|
||||
|
||||
#if CONFIG_HV_TERMINAL_SOLAR
|
||||
|
||||
Reference in New Issue
Block a user