Fixed $G report issue with M7 and M8 both enabled.

[fix] When M7 and M8 are both enabled, $G report would show `M78`,
rather than `M7 M8`. This only effects systems that enable M7 mist
coolant in config.h. Not the default build.
This commit is contained in:
Sonny Jeon 2017-03-02 09:40:23 -07:00
parent fd2a4ebaee
commit 849122559b
3 changed files with 14 additions and 5 deletions

View file

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

View file

@ -316,13 +316,13 @@ void report_gcode_modes()
case SPINDLE_DISABLE : serial_write('5'); break;
}
report_util_gcode_modes_M();
#ifdef ENABLE_M7
if (gc_state.modal.coolant) { // Note: Multiple coolant states may be active at the same time.
if (gc_state.modal.coolant & PL_COND_FLAG_COOLANT_MIST) { serial_write('7'); }
if (gc_state.modal.coolant & PL_COND_FLAG_COOLANT_FLOOD) { serial_write('8'); }
} else { serial_write('9'); }
if (gc_state.modal.coolant & PL_COND_FLAG_COOLANT_MIST) { report_util_gcode_modes_M(); serial_write('7'); }
if (gc_state.modal.coolant & PL_COND_FLAG_COOLANT_FLOOD) { report_util_gcode_modes_M(); serial_write('8'); }
} else { report_util_gcode_modes_M(); serial_write('9'); }
#else
report_util_gcode_modes_M();
if (gc_state.modal.coolant) { serial_write('8'); }
else { serial_write('9'); }
#endif