Skip to content

Commit b66db6c

Browse files
committed
338.12 removed accuracy diagnostic code, eliminated extraneous warnings in JSON mode
1 parent 4dc7f0a commit b66db6c

File tree

7 files changed

+4813
-4943
lines changed

7 files changed

+4813
-4943
lines changed

firmware/config.c

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,12 +1094,16 @@ static uint8_t _set_am(cmdObj *cmd)
10941094
if (strchr(linear_axes, cmd->token[0]) != NULL) { // true if it's a linear axis
10951095
if (cmd->value > AXIS_MAX_LINEAR) {
10961096
cmd->value = 0;
1097-
fprintf_P(stderr, PSTR("*** WARNING *** Unsupported linear axis mode. Axis DISABLED\n"));
1097+
if (tg.communications_mode == TG_TEXT_MODE) {
1098+
fprintf_P(stderr, PSTR("*** WARNING *** Unsupported linear axis mode. Axis DISABLED\n"));
1099+
}
10981100
}
10991101
} else {
11001102
if (cmd->value > AXIS_MAX_ROTARY) {
11011103
cmd->value = 0;
1102-
fprintf_P(stderr, PSTR("*** WARNING *** Unsupported rotary axis mode. Axis DISABLED\n"));
1104+
if (tg.communications_mode == TG_TEXT_MODE) {
1105+
fprintf_P(stderr, PSTR("*** WARNING *** Unsupported rotary axis mode. Axis DISABLED\n"));
1106+
}
11031107
}
11041108
}
11051109
_set_ui8(cmd);
@@ -1130,7 +1134,9 @@ static uint8_t _set_tr(cmdObj *cmd)
11301134
static uint8_t _set_mi(cmdObj *cmd)
11311135
{
11321136
if (fp_NE(cmd->value,1) && fp_NE(cmd->value,2) && fp_NE(cmd->value,4) && fp_NE(cmd->value,8)) {
1133-
fprintf_P(stderr, PSTR("*** WARNING *** Unsupported microstep value\n"));
1137+
if (tg.communications_mode == TG_TEXT_MODE) {
1138+
fprintf_P(stderr, PSTR("*** WARNING *** Unsupported microstep value\n"));
1139+
}
11341140
}
11351141
_set_ui8(cmd); // but set it anyway, even if it's unsupported
11361142
_set_motor_steps_per_unit(cmd);
@@ -1288,37 +1294,10 @@ uint8_t cfg_config_parser(char *str)
12881294
{
12891295
cmdObj *cmd = cmd_array; // point at first struct in the array
12901296

1291-
//######################### START diagnostic ##############################
1292-
if (str[0] == '?') { // special handling for status report
1293-
switch(str[1]) {
1294-
case 'x':fprintf_P(stderr,PSTR("[x=%1.3f]\n"), cm_get_runtime_work_position(X)); break;
1295-
case 'X':fprintf_P(stderr,PSTR("[x=%1.3f]\n"), cm_get_runtime_machine_position(X));break;
1296-
case 'y':fprintf_P(stderr,PSTR("[y=%1.3f]\n"), cm_get_runtime_work_position(Y));break;
1297-
case 'Y':fprintf_P(stderr,PSTR("[y=%1.3f]\n"), cm_get_runtime_machine_position(Y));break;
1298-
case 'z':fprintf_P(stderr,PSTR("[z=%1.3f]\n"), cm_get_runtime_work_position(Z));break;
1299-
case 'Z':fprintf_P(stderr,PSTR("[z=%1.3f]\n"), cm_get_runtime_machine_position(Z));break;
1300-
case 'a':fprintf_P(stderr,PSTR("[a=%1.3f]\n"), cm_get_runtime_work_position(A));break;
1301-
case 'A':fprintf_P(stderr,PSTR("[a=%1.3f]\n"), cm_get_runtime_machine_position(A));break;
1302-
case 'd':{
1303-
1304-
fprintf_P(stderr,PSTR("Programmed X=[%1.3f] "),cm_get_runtime_work_position(X));
1305-
fprintf_P(stderr,PSTR("Real=[%1.3f] mm\n"),x_cnt/cfg.m[X].steps_per_unit);
1306-
fprintf_P(stderr,PSTR("Programmed Y=[%1.3f] "),cm_get_runtime_work_position(Y));
1307-
fprintf_P(stderr,PSTR("Real=[%1.3f] mm\n"),y_cnt/cfg.m[Y].steps_per_unit);
1308-
fprintf_P(stderr,PSTR("Programmed Z=[%1.3f] "),cm_get_runtime_work_position(Z));
1309-
fprintf_P(stderr,PSTR("Real=[%1.3f] mm\n"),z_cnt/cfg.m[Z].steps_per_unit);
1310-
break;
1311-
}
1312-
default: rpt_run_multiline_status_report();
1313-
}
1297+
if (str[0] == '?') { // special handling for status report
1298+
rpt_run_multiline_status_report();
13141299
return (TG_OK);
13151300
}
1316-
//######################### END diagnostic ##############################
1317-
1318-
// if (str[0] == '?') { // special handling for status report
1319-
// rpt_run_multiline_status_report();
1320-
// return (TG_OK);
1321-
// }
13221301
ritorno(_parse_config_string(str,cmd)); // get the first object
13231302
if ((cmd->value_type != VALUE_TYPE_PARENT) && (cmd->value_type != VALUE_TYPE_NULL)) {
13241303
cmd_set(cmd); // set single value

0 commit comments

Comments
 (0)