This commit is contained in:
Alden Hart
2017-04-10 15:19:43 -04:00
parent 1278b0b824
commit f3e950c81b
3 changed files with 17 additions and 20 deletions
+14 -14
View File
@@ -52,15 +52,15 @@
#include "marlin_compatibility.h"
#endif
/***********************************************************************************
**** STRUCTURE ALLOCATIONS *********************************************************
***********************************************************************************/
/****************************************************************************************
**** STRUCTURE ALLOCATIONS *************************************************************
****************************************************************************************/
controller_t cs; // controller state structure
/***********************************************************************************
**** STATICS AND LOCALS ***********************************************************
***********************************************************************************/
/****************************************************************************************
**** STATICS AND LOCALS ****************************************************************
****************************************************************************************/
static void _controller_HSM(void);
static stat_t _led_indicator(void); // twiddle the LED indicator
@@ -81,9 +81,9 @@ static stat_t _controller_state(void); // manage controller state trans
static Motate::OutputPin<Motate::kOutputSAFE_PinNumber> safe_pin;
/***********************************************************************************
**** CODE *************************************************************************
***********************************************************************************/
/****************************************************************************************
**** CODE ******************************************************************************
****************************************************************************************/
/*
* controller_init() - controller init
*/
@@ -187,7 +187,7 @@ static void _controller_HSM()
DISPATCH(_dispatch_command()); // MUST BE LAST - read and execute next command
}
/*****************************************************************************
/****************************************************************************************
* command dispatchers
* _dispatch_control - entry point for control-only dispatches
* _dispatch_command - entry point for control and data dispatches
@@ -319,8 +319,7 @@ static void _dispatch_kernel(const devflags_t flags)
}
}
/**** Local Functions ********************************************************/
/**** Local Functions ******************************************************************/
/*
* _reset_comms_mode() - reset the communications mode (and other effected settings) after connection or disconnection
@@ -461,7 +460,8 @@ static stat_t _sync_to_planner()
return (STAT_OK);
}
/* ALARM STATE HANDLERS
/****************************************************************************************
* ALARM STATE HANDLERS
*
* _shutdown_handler() - put system into shutdown state
* _limit_switch_handler() - shut down system if limit switch fired
@@ -526,7 +526,7 @@ static stat_t _interlock_handler(void)
return(STAT_OK);
}
/*
/****************************************************************************************
* _init_assertions() - initialize controller memory integrity assertions
* _test_assertions() - check controller memory integrity assertions
* _test_system_assertions() - check assertions for entire system
+1 -2
View File
@@ -265,8 +265,7 @@ stat_t mp_exec_move()
return (STAT_NOOP);
}
if (bf->block_type == BLOCK_TYPE_ALINE) { // cycle auto-start for lines only
// if ((bf->block_type == BLOCK_TYPE_ALINE) || (bf->block_type == BLOCK_TYPE_COMMAND)) {
if (bf->block_type == BLOCK_TYPE_ALINE) { // cycle auto-start for lines only
// first-time operations
if (bf->buffer_state != MP_BUFFER_RUNNING) {
if ((bf->buffer_state < MP_BUFFER_BACK_PLANNED) && (cm->motion_state == MOTION_RUN)) {
+2 -4
View File
@@ -344,7 +344,7 @@ stat_t mp_runtime_command(mpBuf_t *bf)
static void _exec_json_command(float *value, bool *flag)
{
char *json_string = jc.read_buffer();
json_parse_for_exec(json_string, true); // process it
json_parse_for_exec(json_string, true); // process it
jc.free_buffer();
}
@@ -377,11 +377,9 @@ static stat_t _exec_json_wait(mpBuf_t *bf)
while ((nv != NULL) && (nv->valuetype != TYPE_EMPTY)) {
// For now we ignore non-BOOL
if (nv->valuetype == TYPE_BOOLEAN) {
// bool old_value = !fp_ZERO(nv->value); // force it to bool
bool old_value = (bool)nv->value_int; // force it to bool
nv_get_nvObj(nv);
// bool new_value = !fp_ZERO(nv->value);
bool new_value = (bool)nv->value_int;
if (old_value != new_value) {
st_prep_dwell((uint32_t)(0.1 * 1000000.0));// 1ms converted to uSec
@@ -444,7 +442,7 @@ static stat_t _exec_dwell(mpBuf_t *bf)
{
st_prep_dwell((uint32_t)(bf->block_time * 1000000.0));// convert seconds to uSec
if (mp_free_run_buffer()) {
cm_cycle_end(); // free buffer & perform cycle_end if planner is empty
cm_cycle_end(); // free buffer & perform cycle_end if planner is empty
}
return (STAT_OK);
}