Isolate atomic bit flag for execution.

- Denoted bit_true_atomic only for sys.execute bit settings. All other
bit_true type calls are for local variables only and don’t need atomic
access. Still looking into other ways of setting these flags without
requiring atomic access, but this is a patch for now.
This commit is contained in:
Sonny Jeon
2014-07-06 19:05:12 -06:00
parent a20d3e9855
commit 87c5703200
7 changed files with 28 additions and 26 deletions

View File

@ -192,7 +192,7 @@ void protocol_execute_runtime()
if (rt_exec & EXEC_ALARM) { report_alarm_message(ALARM_LIMIT_ERROR); }
else { report_alarm_message(ALARM_PROBE_FAIL); }
report_feedback_message(MESSAGE_CRITICAL_EVENT);
bit_false(sys.execute,EXEC_RESET); // Disable any existing reset
bit_false_atomic(sys.execute,EXEC_RESET); // Disable any existing reset
do {
// Nothing. Block EVERYTHING until user issues reset or power cycles. Hard limits
// typically occur while unattended or not paying attention. Gives the user time
@ -208,7 +208,7 @@ void protocol_execute_runtime()
// to indicate the possible severity of the problem.
report_alarm_message(ALARM_ABORT_CYCLE);
}
bit_false(sys.execute,(EXEC_ALARM | EXEC_CRIT_EVENT));
bit_false_atomic(sys.execute,(EXEC_ALARM | EXEC_CRIT_EVENT));
}
// Execute system abort.
@ -220,7 +220,7 @@ void protocol_execute_runtime()
// Execute and serial print status
if (rt_exec & EXEC_STATUS_REPORT) {
report_realtime_status();
bit_false(sys.execute,EXEC_STATUS_REPORT);
bit_false_atomic(sys.execute,EXEC_STATUS_REPORT);
}
// Execute a feed hold with deceleration, only during cycle.
@ -233,7 +233,7 @@ void protocol_execute_runtime()
st_prep_buffer();
sys.auto_start = false; // Disable planner auto start upon feed hold.
}
bit_false(sys.execute,EXEC_FEED_HOLD);
bit_false_atomic(sys.execute,EXEC_FEED_HOLD);
}
// Execute a cycle start by starting the stepper interrupt begin executing the blocks in queue.
@ -248,7 +248,7 @@ void protocol_execute_runtime()
sys.auto_start = false; // Reset auto start per settings.
}
}
bit_false(sys.execute,EXEC_CYCLE_START);
bit_false_atomic(sys.execute,EXEC_CYCLE_START);
}
// Reinitializes the cycle plan and stepper system after a feed hold for a resume. Called by
@ -259,7 +259,7 @@ void protocol_execute_runtime()
if (rt_exec & EXEC_CYCLE_STOP) {
if ( plan_get_current_block() ) { sys.state = STATE_QUEUED; }
else { sys.state = STATE_IDLE; }
bit_false(sys.execute,EXEC_CYCLE_STOP);
bit_false_atomic(sys.execute,EXEC_CYCLE_STOP);
}
}
@ -296,4 +296,4 @@ void protocol_buffer_synchronize()
// NOTE: This function is called from the main loop and mc_line() only and executes when one of
// two conditions exist respectively: There are no more blocks sent (i.e. streaming is finished,
// single commands), or the planner buffer is full and ready to go.
void protocol_auto_cycle_start() { if (sys.auto_start) { bit_true(sys.execute, EXEC_CYCLE_START); } }
void protocol_auto_cycle_start() { if (sys.auto_start) { bit_true_atomic(sys.execute, EXEC_CYCLE_START); } }