PWM Spindle Control and Invert Spindle & Coolant Pins
PWM Spindle Control and Invert Spindle & Coolant Pins
This commit is contained in:
@ -39,10 +39,17 @@ void coolant_init()
|
||||
|
||||
void coolant_stop()
|
||||
{
|
||||
#ifdef INVERT_COOLANT
|
||||
#ifdef ENABLE_M7
|
||||
COOLANT_MIST_PORT &= ~(1 << COOLANT_MIST_BIT);
|
||||
#endif
|
||||
COOLANT_FLOOD_PORT &= ~(1 << COOLANT_FLOOD_BIT);
|
||||
COOLANT_MIST_PORT |= (1 << COOLANT_MIST_BIT);
|
||||
#endif
|
||||
COOLANT_FLOOD_PORT |= (1 << COOLANT_FLOOD_BIT);
|
||||
#else
|
||||
#ifdef ENABLE_M7
|
||||
COOLANT_MIST_PORT &= ~(1 << COOLANT_MIST_BIT);
|
||||
#endif
|
||||
COOLANT_FLOOD_PORT &= ~(1 << COOLANT_FLOOD_BIT);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -51,11 +58,19 @@ void coolant_run(uint8_t mode)
|
||||
if (mode != current_coolant_mode)
|
||||
{
|
||||
plan_synchronize(); // Ensure coolant turns on when specified in program.
|
||||
if (mode == COOLANT_FLOOD_ENABLE) {
|
||||
COOLANT_FLOOD_PORT |= (1 << COOLANT_FLOOD_BIT);
|
||||
if (mode == COOLANT_FLOOD_ENABLE) {
|
||||
#ifdef INVERT_COOLANT
|
||||
COOLANT_FLOOD_PORT &= ~(1 << COOLANT_FLOOD_BIT);
|
||||
#else
|
||||
COOLANT_FLOOD_PORT |= (1 << COOLANT_FLOOD_BIT);
|
||||
#endif
|
||||
#ifdef ENABLE_M7
|
||||
} else if (mode == COOLANT_MIST_ENABLE) {
|
||||
#ifdef INVERT_COOLANT
|
||||
COOLANT_MIST_PORT &= ~(1 << COOLANT_MIST_BIT);
|
||||
#else
|
||||
COOLANT_MIST_PORT |= (1 << COOLANT_MIST_BIT);
|
||||
#endif
|
||||
#endif
|
||||
} else {
|
||||
coolant_stop();
|
||||
|
Reference in New Issue
Block a user