Switched to use power of 2 error numbers (#72)

In addition to the normal error flags we now have
ERR_ANY_ERROR which may be used to clear all errors
at once or to use in has_error to see if there is any error flag set.
This commit is contained in:
hogthrob
2019-11-04 09:19:06 +01:00
committed by Martin Jäger
parent fd474e5350
commit bec02cb25b
4 changed files with 65 additions and 44 deletions
+1 -1
View File
@@ -199,7 +199,7 @@ void Dcdc::control()
// what to do... (e.g. call dcdc_self_destruction)
current_debounce_counter++;
if (current_debounce_counter > CONTROL_FREQUENCY) { // waited 1s before setting the flag
dev_stat.error_flags |= (1 << ERR_DCDC_HS_MOSFET_SHORT);
dev_stat.set_error(ERR_DCDC_HS_MOSFET_SHORT);
}
}
else { // hardware is fine