diff --git a/src/load.cpp b/src/load.cpp index 8d6f8c6..6ccb2b9 100644 --- a/src/load.cpp +++ b/src/load.cpp @@ -125,6 +125,10 @@ void LoadOutput::control() flags_clear(&error_flags, ERR_LOAD_OVERVOLTAGE); } + if (flags_check(&error_flags, ERR_LOAD_BUS_SRC_CURRENT) && bus->src_current_margin < 0) { + flags_clear(&error_flags, ERR_LOAD_BUS_SRC_CURRENT); + } + if (flags_check(&error_flags, ERR_LOAD_SHORT_CIRCUIT) && enable == false) { // stay here until the charge controller is reset or load is manually switched off flags_clear(&error_flags, ERR_LOAD_SHORT_CIRCUIT); diff --git a/src/power_port.h b/src/power_port.h index 0bc0233..2c26e23 100644 --- a/src/power_port.h +++ b/src/power_port.h @@ -84,6 +84,10 @@ public: /** * Available additional current from the DC bus until limits of the connected ports are reached * (has a negative sign) + * + * If for example a battery connected to the bus is not allowed to be discharged anymore, but + * we still get power via solar, current up to the amount of solar input can be diverted into + * the load (until the margin gets 0 and the battery would be discharged). */ float src_current_margin;