1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-30 09:39:49 +02:00

fixed M4 mode.

M4 is now Supported if SPINDLE_DIR_PIN is defined or laser mode is on.
This commit is contained in:
bdring
2018-12-08 14:08:37 -06:00
parent c98c9a5d72
commit eaad780820

View File

@@ -264,15 +264,19 @@ uint8_t gc_execute_line(char *line, uint8_t client)
switch(int_value) { switch(int_value) {
case 3: case 3:
gc_block.modal.spindle = SPINDLE_ENABLE_CW; gc_block.modal.spindle = SPINDLE_ENABLE_CW;
break; break;
case 4: case 4: // Supported if SPINDLE_DIR_PIN is defined or laser mode is on.
#ifdef SPINDLE_DIR_PIN #ifndef SPINDLE_DIR_PIN
gc_block.modal.spindle = SPINDLE_ENABLE_CCW; // if laser mode is not on then this is an unsupported command
#else if bit_isfalse(settings.flags,BITFLAG_LASER_MODE) {
FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND);
break;
}
#endif #endif
break; gc_block.modal.spindle = SPINDLE_ENABLE_CCW;
case 5: gc_block.modal.spindle = SPINDLE_DISABLE; break; break;
case 5:
gc_block.modal.spindle = SPINDLE_DISABLE; break;
} }
break; break;
case 7: case 8: case 9: case 7: case 8: case 9: