diff --git a/TinyG2/encoder.cpp b/TinyG2/encoder.cpp index f0aef275..692c1ed0 100755 --- a/TinyG2/encoder.cpp +++ b/TinyG2/encoder.cpp @@ -27,11 +27,7 @@ #include "tinyg2.h" #include "config.h" -#include "planner.h" -#include "stepper.h" #include "encoder.h" -#include "kinematics.h" -#include "hardware.h" #ifdef __cplusplus extern "C"{ @@ -98,10 +94,9 @@ void en_set_encoder_steps(uint8_t motor, float steps) float en_read_encoder(uint8_t motor) { - return((float)en.en[motor].encoder_steps + ENCODER_STEP_ROUNDING); + return((float)en.en[motor].encoder_steps); } - /*********************************************************************************** * CONFIGURATION AND INTERFACE FUNCTIONS * Functions to get and set variables from the cfgArray table diff --git a/TinyG2/encoder.h b/TinyG2/encoder.h index e6fae375..877489fd 100755 --- a/TinyG2/encoder.h +++ b/TinyG2/encoder.h @@ -94,9 +94,6 @@ extern "C"{ /**** Configs and Constants ****/ -//#define ENCODER_STEP_ROUNDING (float)0.5 // round steps for more accurate following error computation -#define ENCODER_STEP_ROUNDING (float)0.0 // round steps for more accurate following error computation - /**** Macros ****/ // used to abstract the encoder code out of the stepper so it can be managed in one place diff --git a/TinyG2/gcode_parser.cpp b/TinyG2/gcode_parser.cpp index 2ee26b88..9e8adbf3 100755 --- a/TinyG2/gcode_parser.cpp +++ b/TinyG2/gcode_parser.cpp @@ -460,7 +460,7 @@ static stat_t _execute_gcode_block() case NEXT_ACTION_SET_ABSOLUTE_ORIGIN: { status = cm_set_absolute_origin(cm.gn.target, cm.gf.target); break;}// G28.3 case NEXT_ACTION_HOMING_NO_SET: { status = cm_homing_cycle_start_no_set(); break;} // G28.4 - case NEXT_ACTION_STRAIGHT_PROBE: { status = cm_straight_probe(cm.gn.target, cm.gf.target); break;} // G38.2 + case NEXT_ACTION_STRAIGHT_PROBE: { status = cm_straight_probe(cm.gn.target, cm.gf.target); break;} // G38.2 case NEXT_ACTION_SET_COORD_DATA: { status = cm_set_coord_offsets(cm.gn.parameter, cm.gn.target, cm.gf.target); break;} case NEXT_ACTION_SET_ORIGIN_OFFSETS: { status = cm_set_origin_offsets(cm.gn.target, cm.gf.target); break;} diff --git a/TinyG2/json_parser.cpp b/TinyG2/json_parser.cpp index b999e874..267f08ae 100755 --- a/TinyG2/json_parser.cpp +++ b/TinyG2/json_parser.cpp @@ -452,6 +452,9 @@ static stat_t _get_nv_pair_strict(cmdObj_t *cmd, char_t **pstr, int8_t *depth) uint16_t json_serialize(cmdObj_t *cmd, char_t *out_buf, uint16_t size) { +#ifdef __SILENCE_JSON_RESPONSES + return (0); +#else char_t *str = out_buf; char_t *str_max = out_buf + size - BUFFER_MARGIN; int8_t initial_depth = cmd->depth; @@ -518,6 +521,7 @@ uint16_t json_serialize(cmdObj_t *cmd, char_t *out_buf, uint16_t size) str += sprintf((char *)str, "}\n"); // using sprintf for this last one ensures a NUL termination if (str > out_buf + size) { return (-1);} return (str - out_buf); +#endif } /* @@ -594,7 +598,7 @@ void json_print_response(uint8_t status) cmd->objtype = TYPE_EMPTY; } -//+++++ } else if (cmd_type == CMD_TYPE_CONFIG) { // kill config echo if not enabled +//++++ } else if (cmd_type == CMD_TYPE_CONFIG) { // kill config echo if not enabled //fix me if (js.echo_json_configs == false) { // cmd->objtype = TYPE_EMPTY; // } diff --git a/TinyG2/kinematics.cpp b/TinyG2/kinematics.cpp index e61a1340..6a4910af 100755 --- a/TinyG2/kinematics.cpp +++ b/TinyG2/kinematics.cpp @@ -53,7 +53,7 @@ void ik_kinematics(const float travel[], float steps[]) { float joint[AXES]; -// _inverse_kinematics(travel, joint, microseconds);// you can insert inverse kinematics transformations here +// _inverse_kinematics(travel, joint); // you can insert inverse kinematics transformations here memcpy(joint, travel, sizeof(float)*AXES); //...or just do a memcopy for cartesian machines // Map motors to axes and convert length units to steps @@ -104,7 +104,9 @@ static void _inverse_kinematics(float travel[], float joint[]) } */ -//############## UNIT TESTS ################ +// ************************************************* +// ***** UNIT TESTS ******************************** +// ************************************************* //#define __UNIT_TEST_KINEMATICS #ifdef __UNIT_TESTS diff --git a/TinyG2/text_parser.cpp b/TinyG2/text_parser.cpp index b572632a..21906432 100755 --- a/TinyG2/text_parser.cpp +++ b/TinyG2/text_parser.cpp @@ -27,7 +27,6 @@ #include "tinyg2.h" #include "config.h" -#include "controller.h" #include "canonical_machine.h" #include "text_parser.h" #include "json_parser.h" @@ -135,7 +134,7 @@ static stat_t _text_parser_kernal(char_t *str, cmdObj_t *cmd) strcpy_P(cmd->group, cfgArray[cmd->index].group);// capture the group string if there is one // see if you need to strip the token - if ((cmd_index_is_group(cmd->index)) && (cmd_group_is_prefixed(cmd->token))) { + if (cmd->group[0] != NUL) { wr = cmd->token; rd = cmd->token + strlen(cmd->group); while (*rd != NUL) { *(wr)++ = *(rd)++;} diff --git a/TinyG2/tinyg2.h b/TinyG2/tinyg2.h index 4038868e..c5761a43 100755 --- a/TinyG2/tinyg2.h +++ b/TinyG2/tinyg2.h @@ -36,7 +36,7 @@ #include "MotatePins.h" #ifndef TINYG_FIRMWARE_BUILD -#define TINYG_FIRMWARE_BUILD 039.05 // Merge tinyg code; jogging - mostly back-porting to TinyG +#define TINYG_FIRMWARE_BUILD 039.07 // Merge tinyg code; encoders, parsers, kinematics #endif #define TINYG_FIRMWARE_VERSION 0.8 // firmware major version #define TINYG_HARDWARE_PLATFORM 3 // hardware platform indicator (2 = Native Arduino Due)