Powering off unpowered but active cores/relays

This commit is contained in:
TDSSS
2020-10-30 10:48:08 +01:00
parent f086341668
commit 7dc4fc9c70
2 changed files with 10 additions and 2 deletions
+5 -1
View File
@@ -156,7 +156,11 @@
continue
// If another core is active, return FALSE
if(C.active)
return FALSE
if(C.stat & NOPOWER) // If another core has no power but is supposed to be on, we shut it down so we can continue.
C.active = FALSE // Since only one active core is allowed per z level, give priority to the one actually working.
C.update_icon()
else
return FALSE
// If we got here there isnt an active core on this Z-level. So return true
return TRUE
+5 -1
View File
@@ -88,7 +88,11 @@
continue
// If another relay is active, return FALSE
if(R.active)
return FALSE
if(R.stat & NOPOWER) // If another relay has no power but is supposed to be on, we shut it down so we can continue.
R.active = FALSE // Since only one active relay is allowed per z level, give priority to the one that's actually working.
R.update_icon()
else
return FALSE
// If we got here there isnt an active relay on this Z-level. So return TRUE
return TRUE