diff --git a/uCNC/src/core/parser.c b/uCNC/src/core/parser.c index 5e369d5d2..37e95f96f 100644 --- a/uCNC/src/core/parser.c +++ b/uCNC/src/core/parser.c @@ -2304,20 +2304,17 @@ static uint8_t parser_mcode_word(uint8_t code, uint8_t mantissa, parser_state_t new_group |= GCODE_GROUP_TOOLCHANGE; break; #endif -#if ASSERT_PIN(COOLANT_MIST) case 7: -#endif -#ifdef M7_SAME_AS_M8 - case 7: -#endif case 8: +#ifdef ENABLE_COOLANT cmd->groups |= GCODE_GROUP_COOLANT; // word overlapping allowed -#if ASSERT_PIN(COOLANT_MIST) +#ifndef M7_SAME_AS_M8 new_state->groups.coolant |= ((code == 8) ? M8 : M7); #else new_state->groups.coolant |= M8; #endif return STATUS_OK; +#endif case 9: cmd->groups |= GCODE_GROUP_COOLANT; new_state->groups.coolant = M9; diff --git a/uCNC/src/core/planner.c b/uCNC/src/core/planner.c index 7e8986a45..a4f5a0d6c 100644 --- a/uCNC/src/core/planner.c +++ b/uCNC/src/core/planner.c @@ -509,8 +509,8 @@ void planner_sync_tools(motion_data_t *block_data) { #if TOOL_COUNT > 0 g_planner_state.spindle_speed = block_data->spindle; - g_planner_state.state_flags.reg &= ~STATE_COPY_FLAG_MASK; - g_planner_state.state_flags.reg |= (block_data->motion_flags.reg & STATE_COPY_FLAG_MASK); + g_planner_state.state_flags.reg &= ~TOOL_STATE_COPY_FLAG_MASK; + g_planner_state.state_flags.reg |= (block_data->motion_flags.reg & TOOL_STATE_COPY_FLAG_MASK); #endif } diff --git a/uCNC/src/core/planner.h b/uCNC/src/core/planner.h index 0af35ce42..8692cf7a8 100644 --- a/uCNC/src/core/planner.h +++ b/uCNC/src/core/planner.h @@ -37,7 +37,7 @@ extern "C" #define PLANNER_MOTION_EXACT_STOP 64 #define PLANNER_MOTION_CONTINUOUS 128 -#define STATE_COPY_FLAG_MASK 0x1F +#define TOOL_STATE_COPY_FLAG_MASK 0x78 typedef motion_flags_t planner_flags_t; typedef struct planner_block_ diff --git a/uCNC/src/hal/tools/tool_helper.h b/uCNC/src/hal/tools/tool_helper.h index 9e2de6714..44c1a5924 100644 --- a/uCNC/src/hal/tools/tool_helper.h +++ b/uCNC/src/hal/tools/tool_helper.h @@ -57,8 +57,8 @@ extern "C" * */ #define SET_COOLANT(X, Y, Z) \ { \ - io_set_pinvalue(X, (Z && COOLANT_MASK)); \ - io_set_pinvalue(Y, (Z && MIST_MASK)); \ + io_set_pinvalue(X, (Z & COOLANT_MASK)); \ + io_set_pinvalue(Y, (Z & MIST_MASK)); \ } #ifdef __cplusplus