Merge pull request #8536 from thinkyhead/bf2_nanodlp_z_move_sync

[2.0.x] Implement NANODLP_Z_SYNC for 2.0.x
This commit is contained in:
Scott Lahteine 2017-11-24 13:11:14 -06:00 committed by GitHub
commit a766dfb3b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 355 additions and 8 deletions

View File

@ -1492,4 +1492,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1492,4 +1492,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1491,4 +1491,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1491,4 +1491,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1491,4 +1491,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1493,4 +1493,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1491,4 +1491,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1488,4 +1488,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1491,4 +1491,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1491,4 +1491,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1494,4 +1494,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1491,4 +1491,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1501,4 +1501,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1491,4 +1491,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1485,4 +1485,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1495,4 +1495,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1513,4 +1513,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1491,4 +1491,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1491,4 +1491,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1480,4 +1480,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1491,4 +1491,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1492,4 +1492,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1499,4 +1499,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1492,4 +1492,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1493,4 +1493,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1493,4 +1493,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1493,4 +1493,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1493,4 +1493,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1498,4 +1498,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1493,4 +1493,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1492,4 +1492,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1491,4 +1491,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1491,4 +1491,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -1492,4 +1492,14 @@
// tweaks made to the configuration are affecting the printer in real-time. // tweaks made to the configuration are affecting the printer in real-time.
#endif #endif
/**
* NanoDLP Synch support
*
* Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp"
* string to enable synchronization with DLP projector exposure. This change will allow to use
* [[WaitForDoneMessage]] instead of populating your gcode with M400 commands
*
*/
//#define NANODLP_Z_SYNC
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

View File

@ -145,6 +145,7 @@
#define MSG_BUSY_PROCESSING "busy: processing" #define MSG_BUSY_PROCESSING "busy: processing"
#define MSG_BUSY_PAUSED_FOR_USER "busy: paused for user" #define MSG_BUSY_PAUSED_FOR_USER "busy: paused for user"
#define MSG_BUSY_PAUSED_FOR_INPUT "busy: paused for input" #define MSG_BUSY_PAUSED_FOR_INPUT "busy: paused for input"
#define MSG_Z_MOVE_COMP "Z_move_comp"
#define MSG_RESEND "Resend: " #define MSG_RESEND "Resend: "
#define MSG_UNKNOWN_COMMAND "Unknown command: \"" #define MSG_UNKNOWN_COMMAND "Unknown command: \""
#define MSG_ACTIVE_EXTRUDER "Active Extruder: " #define MSG_ACTIVE_EXTRUDER "Active Extruder: "

View File

@ -72,5 +72,13 @@ void GcodeSuite::G0_G1(
#else #else
prepare_move_to_destination(); prepare_move_to_destination();
#endif #endif
#if ENABLED(NANODLP_Z_SYNC)
// If G0/G1 command include Z-axis, wait for move and output sync text.
if (parser.seenval('Z')) {
stepper.synchronize();
SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP);
}
#endif
} }
} }

View File

@ -429,6 +429,10 @@
#define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(INVERT_E1_DIR); } } #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(INVERT_E1_DIR); } }
#define REV_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); } } #define REV_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); } }
#endif #endif
#elif ENABLED(MK2_MULTIPLEXER) // Even-numbered steppers are reversed
#define E_STEP_WRITE(v) E0_STEP_WRITE(v)
#define NORM_E_DIR() E0_DIR_WRITE(TEST(current_block->active_extruder, 0) ? !INVERT_E0_DIR: INVERT_E0_DIR)
#define REV_E_DIR() E0_DIR_WRITE(TEST(current_block->active_extruder, 0) ? INVERT_E0_DIR: !INVERT_E0_DIR)
#elif EXTRUDERS > 4 #elif EXTRUDERS > 4
#define E_STEP_WRITE(v) { switch (current_block->active_extruder) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); break; case 4: E4_STEP_WRITE(v); } } #define E_STEP_WRITE(v) { switch (current_block->active_extruder) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); break; case 4: E4_STEP_WRITE(v); } }
#define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 4: E4_DIR_WRITE(!INVERT_E4_DIR); } } #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 4: E4_DIR_WRITE(!INVERT_E4_DIR); } }
@ -472,14 +476,8 @@
#endif #endif
#else #else
#define E_STEP_WRITE(v) E0_STEP_WRITE(v) #define E_STEP_WRITE(v) E0_STEP_WRITE(v)
#if ENABLED(MK2_MULTIPLEXER)
// Even-numbered steppers are reversed
#define NORM_E_DIR() E0_DIR_WRITE(TEST(current_block->active_extruder, 0) ? !INVERT_E0_DIR: INVERT_E0_DIR)
#define REV_E_DIR() E0_DIR_WRITE(TEST(current_block->active_extruder, 0) ? INVERT_E0_DIR: !INVERT_E0_DIR)
#else
#define NORM_E_DIR() E0_DIR_WRITE(!INVERT_E0_DIR) #define NORM_E_DIR() E0_DIR_WRITE(!INVERT_E0_DIR)
#define REV_E_DIR() E0_DIR_WRITE(INVERT_E0_DIR) #define REV_E_DIR() E0_DIR_WRITE(INVERT_E0_DIR)
#endif
#endif #endif
#endif // STEPPER_INDIRECTION_H #endif // STEPPER_INDIRECTION_H