Merge branch 'devel' into Endstops

This commit is contained in:
Unknown
2018-10-06 13:33:21 -04:00
15 changed files with 381 additions and 101 deletions
+12 -3
View File
@@ -94,9 +94,14 @@ public:
bool check_PSU_brownout();
bool do_checks();
bool do_updates();
bool check_for_errors();
float get_temp();
// True if there are no errors
bool inline check_for_errors() {
return error_ == ERROR_NONE;
}
// @brief Runs the specified update handler at the frequency of the current measurements.
//
// The loop runs until one of the following conditions:
@@ -126,8 +131,12 @@ public:
// Note: updates run even if checks fail
bool updates_ok = do_updates();
if (!checks_ok || !updates_ok)
break;
if (!checks_ok || !updates_ok) {
// It's not useful to quit idle since that is the safe action
// Also leaving idle would rearm the motors
if (current_state_ != AXIS_STATE_IDLE)
break;
}
// Run main loop function, defer quitting for after wait
// TODO: change arming logic to arm after waiting