Improved option for v0.9 GUI compatibility.

- Addressed an issue with backward compatibility with Grbl v0.9-style
GUIs.

- It still may not work due to new data and states coming back from
Grbl v1.1. Regardless, DO NOT TRY TO USE THE COMPATIBILITY MODE UNTIL
THERE IS A REALLY GOOD REASON TO.

- v0.9 GUI compatibility mode will be removed in future versions.
You’ve been warned. It’s highly recommended for GUIs to update to the
new v1.1 interface.

- Compability mode will only fit on an Arduino Uno due to size
increases.

- Removed the REPORT_GUI_MODE compile option since it’s part of the
v1.1 interface standard.

- Updated the documentation to better describe the compatibility mode
build option.
This commit is contained in:
Sonny Jeon 2016-10-18 22:58:52 -06:00
parent ed790c9fa2
commit 8b76a39d5d
7 changed files with 300 additions and 211 deletions

View File

@ -7,7 +7,7 @@
"Z","Homing force origin","Enabled"
"H","Homing single axis commands","Enabled"
"L","Two limit switches on axis","Enabled"
"R","Classic status reporting","Enabled"
"R","Classic compatibility mode","Enabled"
"*","Restore all EEPROM command","Disabled"
"$","Restore EEPROM `$` settings command","Disabled"
"#","Restore EEPROM parameter data command","Disabled"

1 OPT: Code Build-Option Description State
7 Z Homing force origin Enabled
8 H Homing single axis commands Enabled
9 L Two limit switches on axis Enabled
10 R Classic status reporting Classic compatibility mode Enabled
11 * Restore all EEPROM command Disabled
12 $ Restore EEPROM `$` settings command Disabled
13 # Restore EEPROM parameter data command Disabled

View File

@ -1,3 +1,73 @@
----------------
Date: 2016-10-17
Author: Sonny Jeon
Subject: v1.1d: Tweaked interface a bit. Added realtime spindle speed and build option data. Minor bug fixes.
- Increment to v1.1d due to interface tweaks.
- Based on GUI dev feedback, the toggle overrides report was removed
and replace with showing “accessory state”. This shows a character if a
particular accessory is enabled, like the spindle or flood coolant.
These can be directly altered by the toggle overrides, so when they
execute, a GUI will be able to observe the state altering as feedback.
- Altered the real-time feed rate to show real-time spindle speed as
well. It was an over-sight on my part. Its needed because its hard to
know what the current spindle speed is when overrides are altering it.
Especially during something like a laser cutting job when its important
to know how spindle speed overrides are effecting things.
- Real-time spindle speed is not shown if VARIABLE_SPINDLE is disabled.
The old real-time feed rate data field will show instead.
- Compile-time option data is now included in another message
immediately following the build info version string, starting with
`[OPT:`. A character code follows the data type name with each
indicating a particular option enabled or disabled. This will help
immensely with debugging Grbl as well as help GUIs know exactly how
Grbl was compiled.
- These interface changes are detailed in the updated documentation.
- Reduced the default planner buffer size from 17 to 16. Needed to free
up some memory…
- For increasing the serial TX buffer size from 90 to 104 bytes. The
addition of real-time spindle speeds and accessory enable data required
a bigger buffer. This is to ensure Grbl is performing at optimal levels.
- Refactored parts of the spindle and coolant control code to make it
more consistent to each other and how it was called. It was a little
messy. The changes made it easier to track what each function call was
doing based on what was calling it.
- Created a couple of new get_state functions for the spindle and
coolant. These are called by the accessory state report to look
directly at the pin state, rather than track how it was set. This
guarantees that the state is reported correctly.
- Updated the g-code parser, parking motion, sleep mode, and spindle
stop calls to refactored spindle and coolant code.
- Added a compile-time option to enable homing individual axes, rather
than having only the main homing cycle. The actual use case for this is
pretty rare. Its not recommended you enable this, unless you have a
specific application for it. Otherwise, just alter the homing cycle
itself.
- Refactored the printFloat() function to not show a decimal point if
there are no trailing values after it. For example, `1.` now shows `1`.
- Fixed an issue regarding spindle speed overrides no being applied to
blocks without motions.
- Removed the toggle_ovr_mask system variable and replaced with
spindle_stop_ovr system variable. Coolant toggles dont need to be
tracked.
- Updated README
----------------
Date: 2016-10-17
Author: Will Winder

View File

@ -311,7 +311,7 @@ Feedback messages provide non-critical information on what Grbl is doing, what i
| **`Z`** | Homing force origin enabled |
| **`H`** | Homing single axis enabled |
| **`L`** | Two limit switches on axis enabled |
| **`R`** | Classic status reporting enabled |
| **`R`** | Classic compatiblity mode enabled |
| **`*`** | Restore all EEPROM disabled |
| **`$`** | Restore EEPROM `$` settings disabled |
| **`#`** | Restore EEPROM parameter data disabled |

View File

@ -260,13 +260,7 @@
// to their default values at program end.
#define RESTORE_OVERRIDES_AFTER_PROGRAM_END // Default enabled. Comment to disable.
// Enables minimal reporting feedback mode for GUIs, where human-readable strings are not as important.
// This saves nearly 2KB of flash space and may allow enough space to install other/future features.
// GUIs will need to install a look-up table for the error-codes that Grbl sends back in their place.
// NOTE: This feature is new and experimental. Make sure the GUI you are using supports this mode.
#define REPORT_GUI_MODE // Default enabled. Comment to disable.
// The status report change for Grbl v1.0 and after also removed the ability to disable/enable most data
// The status report change for Grbl v1.1 and after also removed the ability to disable/enable most data
// fields from the report. This caused issues for GUI developers, who've had to manage several scenarios
// and configurations. The increased efficiency of the new reporting style allows for all data fields to
// be sent without potential performance issues.
@ -293,13 +287,21 @@
#define REPORT_WCO_REFRESH_BUSY_COUNT 30 // (1-255)
#define REPORT_WCO_REFRESH_IDLE_COUNT 10 // (1-255) Must be less than or equal to the busy count
// COMPATIBILITY OPTIONS:
// Grbl v1.0 and later altered the formatting of the realtime status reports to make it more consistent
// for parsing with cleaner delimiters and optimized messages. To use Grbl v0.9-style status reporting,
// enable this compile option. This is generally useful if older GUIs require this formatting.
// #define USE_CLASSIC_REALTIME_REPORT
// #define REPORT_ALL_PIN_STATES // Default disabled. Comment to enable. NOTE: Compatible with old-style reports only.
// #define REPORT_REALTIME_RATE // Disabled by default. Uncomment to enable.
// ----- COMPATIBILITY OPTIONS: ------
// The following options enabled the old-style v0.9 Grbl interface.
// WARNING: DO NOT USE these compatibility options unless there is a really good reason to. If you are
// trying to use Grbl v1.1 with a GUI that supports a v0.9-style interface, it will still not likely work.
// A few things have been added, like override and accessory data and a new sleep state. These things will
// still likely require the GUI to be updated to handle these. In other words, IT WILL STILL NOT WORK!
// IT'S HIGHLY RECOMMENDED FOR GUIs TO UPDATE TO THE NEW INTERFACE FOR v1.1. Don't try to make it
// compatible with this old v0.9 style. It will be dropped in the near future. You have been warned.
// NOTE: The compiled size of Grbl with these options enabled will exceed the flash limit of FTDI-based
// Arduinos, like the Duemilanove and Nano. This will only fit on an Uno with the Optiboot bootloader.
// #define USE_CLASSIC_GRBL_INTERFACE // Default disabled. Uncomment to enable.
// #define REPORT_ALL_PIN_STATES // Default disabled. Uncomment to enable. Option obsolete in v1.1.
// #define REPORT_REALTIME_RATE // Disabled by default. Uncomment to enable. Option obsolete in v1.1.
// Enables minimal reporting feedback mode for GUIs, where human-readable strings are not as important.
// -----------------------------------
// The temporal resolution of the acceleration management subsystem. A higher number gives smoother
// acceleration, particularly noticeable on machines that run at very high feedrates, but may negatively

View File

@ -23,7 +23,7 @@
// Grbl versioning system
#define GRBL_VERSION "1.1d"
#define GRBL_VERSION_BUILD "20161017"
#define GRBL_VERSION_BUILD "20161018"
// Define standard libraries used by Grbl.
#include <avr/io.h>

View File

@ -42,53 +42,56 @@ static void report_util_axis_values(float *axis_value) {
}
}
// static void report_util_setting_string(uint8_t n) {
// serial_write(' ');
// serial_write('(');
// switch(n) {
// case 0: printPgmString(PSTR("stp pulse:us")); break;
// case 1: printPgmString(PSTR("idl delay:ms")); break;
// case 2: printPgmString(PSTR("stp inv:msk")); break;
// case 3: printPgmString(PSTR("dir inv:msk")); break;
// case 4: printPgmString(PSTR("stp enbl inv")); break;
// case 5: printPgmString(PSTR("lim inv")); break;
// case 6: printPgmString(PSTR("prb inv")); break;
// case 10: printPgmString(PSTR("rpt:msk")); break;
// case 11: printPgmString(PSTR("jnc dev:mm")); break;
// case 12: printPgmString(PSTR("arc tol:mm")); break;
// case 13: printPgmString(PSTR("rpt inch")); break;
// case 20: printPgmString(PSTR("sft lim")); break;
// case 21: printPgmString(PSTR("hrd lim")); break;
// case 22: printPgmString(PSTR("hm cyc")); break;
// case 23: printPgmString(PSTR("hm dir inv:msk")); break;
// case 24: printPgmString(PSTR("hm feed:mm/min")); break;
// case 25: printPgmString(PSTR("hm seek:mm/min")); break;
// case 26: printPgmString(PSTR("hm delay:ms")); break;
// case 27: printPgmString(PSTR("hm off:mm")); break;
// case 30: printPgmString(PSTR("rpm max")); break;
// case 31: printPgmString(PSTR("rpm min")); break;
// case 32: printPgmString(PSTR("laser")); break;
// default:
// n -= AXIS_SETTINGS_START_VAL;
// uint8_t idx = 0;
// while (n < 10) {
// if (n<10) {
// print_uint8_base10(n+idx);
// switch (idx) {
// case 0: printPgmString(PSTR(":stp/mm")); break;
// case 1: printPgmString(PSTR(":mm/min")); break;
// case 2: printPgmString(PSTR(":mm/s^2")); break;
// case 3: printPgmString(PSTR(":mm max")); break;
// }
// } else {
// n -= 10;
// idx++;
// }
// }
// }
// report_util_comment_line_feed();
// }
/*
static void report_util_setting_string(uint8_t n) {
serial_write(' ');
serial_write('(');
switch(n) {
case 0: printPgmString(PSTR("stp pulse:us")); break;
case 1: printPgmString(PSTR("idl delay:ms")); break;
case 2: printPgmString(PSTR("stp inv:msk")); break;
case 3: printPgmString(PSTR("dir inv:msk")); break;
case 4: printPgmString(PSTR("stp enbl inv")); break;
case 5: printPgmString(PSTR("lim inv")); break;
case 6: printPgmString(PSTR("prb inv")); break;
case 10: printPgmString(PSTR("rpt:msk")); break;
case 11: printPgmString(PSTR("jnc dev:mm")); break;
case 12: printPgmString(PSTR("arc tol:mm")); break;
case 13: printPgmString(PSTR("rpt inch")); break;
case 20: printPgmString(PSTR("sft lim")); break;
case 21: printPgmString(PSTR("hrd lim")); break;
case 22: printPgmString(PSTR("hm cyc")); break;
case 23: printPgmString(PSTR("hm dir inv:msk")); break;
case 24: printPgmString(PSTR("hm feed:mm/min")); break;
case 25: printPgmString(PSTR("hm seek:mm/min")); break;
case 26: printPgmString(PSTR("hm delay:ms")); break;
case 27: printPgmString(PSTR("hm off:mm")); break;
case 30: printPgmString(PSTR("rpm max")); break;
case 31: printPgmString(PSTR("rpm min")); break;
case 32: printPgmString(PSTR("laser")); break;
default:
n -= AXIS_SETTINGS_START_VAL;
uint8_t idx = 0;
while (n < 10) {
if (n<10) {
print_uint8_base10(n+idx);
switch (idx) {
case 0: printPgmString(PSTR(":stp/mm")); break;
case 1: printPgmString(PSTR(":mm/min")); break;
case 2: printPgmString(PSTR(":mm/s^2")); break;
case 3: printPgmString(PSTR(":mm max")); break;
}
} else {
n -= 10;
idx++;
}
}
}
report_util_comment_line_feed();
}
*/
#ifndef USE_CLASSIC_GRBL_INTERFACE
static void report_util_uint8_setting(uint8_t n, int val) {
report_util_setting_prefix(n);
print_uint8_base10(val);
@ -101,6 +104,7 @@ static void report_util_float_setting(uint8_t n, float val, uint8_t n_decimal) {
report_util_line_feed();
// report_util_setting_string(n);
}
#endif
// Handles the primary confirmation protocol response for streaming interfaces and human-feedback.
@ -116,10 +120,7 @@ void report_status_message(uint8_t status_code)
case STATUS_OK: // STATUS_OK
printPgmString(PSTR("ok\r\n")); break;
default:
#ifdef REPORT_GUI_MODE
printPgmString(PSTR("error:"));
print_uint8_base10(status_code);
#else
#ifdef USE_CLASSIC_GRBL_INTERFACE
printPgmString(PSTR("error: "));
switch(status_code) {
case STATUS_EXPECTED_COMMAND_LETTER:
@ -168,6 +169,9 @@ void report_status_message(uint8_t status_code)
printPgmString(PSTR("Invalid gcode ID:"));
print_uint8_base10(status_code); // Print error code for user reference
}
#else
printPgmString(PSTR("error:"));
print_uint8_base10(status_code);
#endif
report_util_line_feed();
}
@ -176,10 +180,7 @@ void report_status_message(uint8_t status_code)
// Prints alarm messages.
void report_alarm_message(int8_t alarm_code)
{
#ifdef REPORT_GUI_MODE
printPgmString(PSTR("ALARM:"));
print_uint8_base10(alarm_code);
#else
#ifdef USE_CLASSIC_GRBL_INTERFACE
printPgmString(PSTR("ALARM: "));
switch (alarm_code) {
case ALARM_HARD_LIMIT_ERROR:
@ -197,6 +198,9 @@ void report_alarm_message(int8_t alarm_code)
case ALARM_HOMING_FAIL_APPROACH:
printPgmString(PSTR("Homing fail")); break;
}
#else
printPgmString(PSTR("ALARM:"));
print_uint8_base10(alarm_code);
#endif
report_util_line_feed();
delay_ms(500); // Force delay to ensure message clears serial write buffer.
@ -209,7 +213,11 @@ void report_alarm_message(int8_t alarm_code)
// is installed, the message number codes are less than zero.
void report_feedback_message(uint8_t message_code)
{
#ifdef USE_CLASSIC_GRBL_INTERFACE
serial_write('[');
#else
printPgmString(PSTR("[MSG:"));
#endif
switch(message_code) {
case MESSAGE_CRITICAL_EVENT:
printPgmString(PSTR("Reset to continue")); break;
@ -246,9 +254,7 @@ void report_init_message()
// Grbl help message
void report_grbl_help() {
#ifdef REPORT_GUI_MODE
printPgmString(PSTR("[HLP:$$ $# $G $I $N $x=val $Nx=line $J=line $SLP $C $X $H ~ ! ? ctrl-x]\r\n"));
#else
#ifdef USE_CLASSIC_GRBL_INTERFACE
printPgmString(PSTR("$$ (view Grbl settings)\r\n"
"$# (view # parameters)\r\n"
"$G (view parser state)\r\n"
@ -265,6 +271,8 @@ void report_grbl_help() {
"! (feed hold)\r\n"
"? (current status)\r\n"
"ctrl-x (reset Grbl)\r\n"));
#else
printPgmString(PSTR("[HLP:$$ $# $G $I $N $x=val $Nx=line $J=line $SLP $C $X $H ~ ! ? ctrl-x]\r\n"));
#endif
}
@ -273,8 +281,66 @@ void report_grbl_help() {
// NOTE: The numbering scheme here must correlate to storing in settings.c
void report_grbl_settings() {
// Print Grbl settings.
#ifdef REPORT_GUI_MODE
#ifdef USE_CLASSIC_GRBL_INTERFACE
printPgmString(PSTR("$0=")); print_uint8_base10(settings.pulse_microseconds);
printPgmString(PSTR(" (step pulse, usec)\r\n$1=")); print_uint8_base10(settings.stepper_idle_lock_time);
printPgmString(PSTR(" (step idle delay, msec)\r\n$2=")); print_uint8_base10(settings.step_invert_mask);
printPgmString(PSTR(" (step port invert mask)\r\n$3=")); print_uint8_base10(settings.dir_invert_mask);
printPgmString(PSTR(" (dir port invert mask)\r\n$4=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_INVERT_ST_ENABLE));
printPgmString(PSTR(" (step enable invert, bool)\r\n$5=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_INVERT_LIMIT_PINS));
printPgmString(PSTR(" (limit pins invert, bool)\r\n$6=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_INVERT_PROBE_PIN));
printPgmString(PSTR(" (probe pin invert, bool)\r\n$10=")); print_uint8_base10(settings.status_report_mask);
printPgmString(PSTR(" (status report mask)\r\n$11=")); printFloat(settings.junction_deviation,N_DECIMAL_SETTINGVALUE);
printPgmString(PSTR(" (junction deviation, mm)\r\n$12=")); printFloat(settings.arc_tolerance,N_DECIMAL_SETTINGVALUE);
printPgmString(PSTR(" (arc tolerance, mm)\r\n$13=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_REPORT_INCHES));
printPgmString(PSTR(" (report inches, bool)\r\n$20=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_SOFT_LIMIT_ENABLE));
printPgmString(PSTR(" (soft limits, bool)\r\n$21=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_HARD_LIMIT_ENABLE));
printPgmString(PSTR(" (hard limits, bool)\r\n$22=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_HOMING_ENABLE));
printPgmString(PSTR(" (homing cycle, bool)\r\n$23=")); print_uint8_base10(settings.homing_dir_mask);
printPgmString(PSTR(" (homing dir invert mask\r\n$24=")); printFloat(settings.homing_feed_rate,N_DECIMAL_SETTINGVALUE);
printPgmString(PSTR(" (homing feed, mm/min)\r\n$25=")); printFloat(settings.homing_seek_rate,N_DECIMAL_SETTINGVALUE);
printPgmString(PSTR(" (homing seek, mm/min)\r\n$26=")); print_uint8_base10(settings.homing_debounce_delay);
printPgmString(PSTR(" (homing debounce, msec)\r\n$27=")); printFloat(settings.homing_pulloff,N_DECIMAL_SETTINGVALUE);
printPgmString(PSTR(" (homing pull-off, mm)\r\n$30=")); printFloat(settings.rpm_max,N_DECIMAL_RPMVALUE);
printPgmString(PSTR(" (rpm max)\r\n$31=")); printFloat(settings.rpm_min,N_DECIMAL_RPMVALUE);
#ifdef VARIABLE_SPINDLE
printPgmString(PSTR(" (rpm min)\r\n$32=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_LASER_MODE));
printPgmString(PSTR(" (laser mode, bool)\r\n"));
#else
printPgmString(PSTR(" (rpm min)\r\n$32=0 (laser mode, bool)\r\n"));
#endif
// Print axis settings
uint8_t idx, set_idx;
uint8_t val = AXIS_SETTINGS_START_VAL;
for (set_idx=0; set_idx<AXIS_N_SETTINGS; set_idx++) {
for (idx=0; idx<N_AXIS; idx++) {
serial_write('$');
print_uint8_base10(val+idx);
serial_write('=');
switch (set_idx) {
case 0: printFloat(settings.steps_per_mm[idx],N_DECIMAL_SETTINGVALUE); break;
case 1: printFloat(settings.max_rate[idx],N_DECIMAL_SETTINGVALUE); break;
case 2: printFloat(settings.acceleration[idx]/(60*60),N_DECIMAL_SETTINGVALUE); break;
case 3: printFloat(-settings.max_travel[idx],N_DECIMAL_SETTINGVALUE); break;
}
serial_write(' ');
serial_write('(');
switch (idx) {
case X_AXIS: printPgmString(PSTR("x")); break;
case Y_AXIS: printPgmString(PSTR("y")); break;
case Z_AXIS: printPgmString(PSTR("z")); break;
}
switch (set_idx) {
case 0: printPgmString(PSTR(", step/mm")); break;
case 1: printPgmString(PSTR(" max rate, mm/min")); break;
case 2: printPgmString(PSTR(" accel, mm/sec^2")); break;
case 3: printPgmString(PSTR(" max travel, mm")); break;
}
printPgmString(PSTR(")\r\n"));
}
val += AXIS_SETTINGS_INCREMENT;
}
#else
report_util_uint8_setting(0,settings.pulse_microseconds);
report_util_uint8_setting(1,settings.stepper_idle_lock_time);
report_util_uint8_setting(2,settings.step_invert_mask);
@ -315,68 +381,6 @@ void report_grbl_settings() {
}
val += AXIS_SETTINGS_INCREMENT;
}
#else
printPgmString(PSTR("$0=")); print_uint8_base10(settings.pulse_microseconds);
printPgmString(PSTR(" (step pulse, usec)\r\n$1=")); print_uint8_base10(settings.stepper_idle_lock_time);
printPgmString(PSTR(" (step idle delay, msec)\r\n$2=")); print_uint8_base10(settings.step_invert_mask);
printPgmString(PSTR(" (step port invert mask)\r\n$3=")); print_uint8_base10(settings.dir_invert_mask);
printPgmString(PSTR(" (dir port invert mask)\r\n$4=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_INVERT_ST_ENABLE));
printPgmString(PSTR(" (step enable invert, bool)\r\n$5=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_INVERT_LIMIT_PINS));
printPgmString(PSTR(" (limit pins invert, bool)\r\n$6=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_INVERT_PROBE_PIN));
printPgmString(PSTR(" (probe pin invert, bool)\r\n$10=")); print_uint8_base10(settings.status_report_mask);
printPgmString(PSTR(" (status report mask)\r\n$11=")); printFloat_SettingValue(settings.junction_deviation);
printPgmString(PSTR(" (junction deviation, mm)\r\n$12=")); printFloat_SettingValue(settings.arc_tolerance);
printPgmString(PSTR(" (arc tolerance, mm)\r\n$13=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_REPORT_INCHES));
printPgmString(PSTR(" (report inches, bool)\r\n$20=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_SOFT_LIMIT_ENABLE));
printPgmString(PSTR(" (soft limits, bool)\r\n$21=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_HARD_LIMIT_ENABLE));
printPgmString(PSTR(" (hard limits, bool)\r\n$22=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_HOMING_ENABLE));
printPgmString(PSTR(" (homing cycle, bool)\r\n$23=")); print_uint8_base10(settings.homing_dir_mask);
printPgmString(PSTR(" (homing dir invert mask\r\n$24=")); printFloat_SettingValue(settings.homing_feed_rate);
printPgmString(PSTR(" (homing feed, mm/min)\r\n$25=")); printFloat_SettingValue(settings.homing_seek_rate);
printPgmString(PSTR(" (homing seek, mm/min)\r\n$26=")); print_uint8_base10(settings.homing_debounce_delay);
printPgmString(PSTR(" (homing debounce, msec)\r\n$27=")); printFloat_SettingValue(settings.homing_pulloff);
printPgmString(PSTR(" (homing pull-off, mm)\r\n$30=")); printFloat_RPMValue(settings.rpm_max);
printPgmString(PSTR(" (rpm max)\r\n$31=")); printFloat_RPMValue(settings.rpm_min);
#ifdef VARIABLE_SPINDLE
printPgmString(PSTR(" (rpm min)\r\n$32=")); print_uint8_base10(bit_istrue(settings.flags,BITFLAG_LASER_MODE));
printPgmString(PSTR(" (laser mode, bool)\r\n"));
#else
printPgmString(PSTR(" (rpm min)\r\n$32=0 (laser mode, bool)\r\n"));
#endif
// Print axis settings
uint8_t idx, set_idx;
uint8_t val = AXIS_SETTINGS_START_VAL;
for (set_idx=0; set_idx<AXIS_N_SETTINGS; set_idx++) {
for (idx=0; idx<N_AXIS; idx++) {
serial_write('$');
print_uint8_base10(val+idx);
serial_write('=');
switch (set_idx) {
case 0: printFloat_SettingValue(settings.steps_per_mm[idx]); break;
case 1: printFloat_SettingValue(settings.max_rate[idx]); break;
case 2: printFloat_SettingValue(settings.acceleration[idx]/(60*60)); break;
case 3: printFloat_SettingValue(-settings.max_travel[idx]); break;
}
serial_write(' ');
serial_write('(');
switch (idx) {
case X_AXIS: printPgmString(PSTR("x")); break;
case Y_AXIS: printPgmString(PSTR("y")); break;
case Z_AXIS: printPgmString(PSTR("z")); break;
}
switch (set_idx) {
case 0: printPgmString(PSTR(", step/mm")); break;
case 1: printPgmString(PSTR(" max rate, mm/min")); break;
case 2: printPgmString(PSTR(" accel, mm/sec^2")); break;
case 3: printPgmString(PSTR(" max travel, mm")); break;
}
printPgmString(PSTR(")\r\n"));
}
val += AXIS_SETTINGS_INCREMENT;
}
#endif
}
@ -430,7 +434,11 @@ void report_ngc_parameters()
// Print current gcode parser mode state
void report_gcode_modes()
{
#ifdef USE_CLASSIC_GRBL_INTERFACE
printPgmString(PSTR("[G"));
#else
printPgmString(PSTR("[GC:G"));
#endif
switch (gc_state.modal.motion) {
case MOTION_MODE_SEEK : serial_write('0'); break;
case MOTION_MODE_LINEAR : serial_write('1'); break;
@ -515,15 +523,24 @@ void report_startup_line(uint8_t n, char *line)
void report_execute_startup_message(char *line, uint8_t status_code)
{
#ifdef USE_CLASSIC_GRBL_INTERFACE
printString(line);
report_status_message(status_code);
#else
serial_write('>');
printString(line);
serial_write(':');
report_status_message(status_code);
#endif
}
// Prints build info line
void report_build_info(char *line)
{
#ifdef USE_CLASSIC_GRBL_INTERFACE
printPgmString(PSTR("[" GRBL_VERSION "." GRBL_VERSION_BUILD ":"));
printString(line);
#else
printPgmString(PSTR("[VER:" GRBL_VERSION "." GRBL_VERSION_BUILD ":"));
printString(line);
report_util_feedback_line_feed();
@ -552,7 +569,7 @@ void report_build_info(char *line)
#ifdef LIMITS_TWO_SWITCHES_ON_AXES
serial_write('L');
#endif
#ifdef USE_CLASSIC_REALTIME_REPORT
#ifdef USE_CLASSIC_GRBL_INTERFACE
serial_write('R');
#endif
#ifndef ENABLE_RESTORE_EEPROM_WIPE_ALL // NOTE: Shown when disabled.
@ -573,9 +590,9 @@ void report_build_info(char *line)
#ifndef FORCE_BUFFER_SYNC_DURING_WCO_CHANGE // NOTE: Shown when disabled.
serial_write('W');
#endif
// NOTE: Compiled values, like override increments/max/min values, may be added at some point later.
// These will likely have a comma delimiter to separate them.
#endif
report_util_feedback_line_feed();
}
@ -597,7 +614,7 @@ void report_echo_line_received(char *line)
// especially during g-code programs with fast, short line segments and high frequency reports (5-20Hz).
void report_realtime_status()
{
#ifdef USE_CLASSIC_REALTIME_REPORT
#ifdef USE_CLASSIC_GRBL_INTERFACE
uint8_t idx;
int32_t current_position[N_AXIS]; // Copy current state of the system position variable

View File

@ -40,7 +40,7 @@
#define BITFLAG_INVERT_PROBE_PIN bit(7)
// Define status reporting boolean enable bit flags in settings.status_report_mask
#ifdef USE_CLASSIC_REALTIME_REPORT
#ifdef USE_CLASSIC_GRBL_INTERFACE
#define BITFLAG_RT_STATUS_MACHINE_POSITION bit(0)
#define BITFLAG_RT_STATUS_WORK_POSITION bit(1)
#define BITFLAG_RT_STATUS_PLANNER_BUFFER bit(2)