From f3e950c81b23eabed11e5f8ede4ea1542a9b633d Mon Sep 17 00:00:00 2001 From: Alden Hart Date: Mon, 10 Apr 2017 15:19:43 -0400 Subject: [PATCH] stuff --- g2core/controller.cpp | 28 ++++++++++++++-------------- g2core/plan_exec.cpp | 3 +-- g2core/planner.cpp | 6 ++---- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/g2core/controller.cpp b/g2core/controller.cpp index 5fa01e97..bd60a7a8 100644 --- a/g2core/controller.cpp +++ b/g2core/controller.cpp @@ -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 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 diff --git a/g2core/plan_exec.cpp b/g2core/plan_exec.cpp index 84ea6211..3fbed2cf 100644 --- a/g2core/plan_exec.cpp +++ b/g2core/plan_exec.cpp @@ -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)) { diff --git a/g2core/planner.cpp b/g2core/planner.cpp index e1849591..fd72aa18 100644 --- a/g2core/planner.cpp +++ b/g2core/planner.cpp @@ -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); }