summaryrefslogtreecommitdiff
path: root/Tonokip_Firmware/Tonokip_Firmware.pde
diff options
context:
space:
mode:
authortonokip <tonokip@gmail.com>2010-05-02 13:47:44 -0700
committertonokip <tonokip@gmail.com>2010-05-02 13:47:44 -0700
commit38eb0a1bcda7239f5c8b4f0158128a423b7f25d1 (patch)
treedba24f29735c8a06dbd61b0730ca8c97f40634e8 /Tonokip_Firmware/Tonokip_Firmware.pde
parent3d2194c3341e9e8b4b1068bfb3cd01fcef7b3f25 (diff)
added config option for inverting stepper direction
Diffstat (limited to 'Tonokip_Firmware/Tonokip_Firmware.pde')
-rw-r--r--Tonokip_Firmware/Tonokip_Firmware.pde16
1 files changed, 8 insertions, 8 deletions
diff --git a/Tonokip_Firmware/Tonokip_Firmware.pde b/Tonokip_Firmware/Tonokip_Firmware.pde
index e5ee6af..4bb1ca0 100644
--- a/Tonokip_Firmware/Tonokip_Firmware.pde
+++ b/Tonokip_Firmware/Tonokip_Firmware.pde
@@ -379,14 +379,14 @@ inline void get_coordinates()
void linear_move(unsigned long x_steps_remaining, unsigned long y_steps_remaining, unsigned long z_steps_remaining, unsigned long e_steps_remaining) // make linear move with preset speeds and destinations, see G0 and G1
{
//Determine direction of movement
- if (destination_x > current_x) digitalWrite(X_DIR_PIN,HIGH);
- else digitalWrite(X_DIR_PIN,LOW);
- if (destination_y > current_y) digitalWrite(Y_DIR_PIN,HIGH);
- else digitalWrite(Y_DIR_PIN,LOW);
- if (destination_z > current_z) digitalWrite(Z_DIR_PIN,HIGH);
- else digitalWrite(Z_DIR_PIN,LOW);
- if (destination_e > current_e) digitalWrite(E_DIR_PIN,HIGH);
- else digitalWrite(E_DIR_PIN,LOW);
+ if (destination_x > current_x) digitalWrite(X_DIR_PIN,!INVERT_X_DIR);
+ else digitalWrite(X_DIR_PIN,INVERT_X_DIR);
+ if (destination_y > current_y) digitalWrite(Y_DIR_PIN,!INVERT_Y_DIR);
+ else digitalWrite(Y_DIR_PIN,INVERT_Y_DIR);
+ if (destination_z > current_z) digitalWrite(Z_DIR_PIN,!INVERT_Z_DIR);
+ else digitalWrite(Z_DIR_PIN,INVERT_Z_DIR);
+ if (destination_e > current_e) digitalWrite(E_DIR_PIN,!INVERT_E_DIR);
+ else digitalWrite(E_DIR_PIN,INVERT_E_DIR);
//Only enable axis that are moving. If the axis doesn't need to move then it can stay disabled depending on configuration.
if(x_steps_remaining) enable_x();