Actually set extruder enable pin if defined

This commit is contained in:
Stephan Walter 2011-02-26 14:03:45 +01:00 committed by Michael Moon
parent f985de8a54
commit 8acb072e0b
4 changed files with 19 additions and 0 deletions

2
dda.c
View File

@ -183,6 +183,7 @@ void dda_create(DDA *dda, TARGET *target) {
y_enable();
if (dda->z_delta)
z_enable();
e_enable();
// since it's unusual to combine X, Y and Z changes in a single move on reprap, check if we can use simpler approximations before trying the full 3d approximation.
if (dda->z_delta == 0)
@ -363,6 +364,7 @@ void dda_start(DDA *dda) {
y_enable();
if (dda->z_delta)
z_enable();
e_enable();
// set direction outputs
x_direction(dda->x_direction);

View File

@ -273,6 +273,7 @@ void process_gcode_command() {
x_disable();
y_disable();
z_disable();
e_disable();
power_off();
for (;;)
wd_reset();
@ -439,6 +440,7 @@ void process_gcode_command() {
x_enable();
y_enable();
z_enable();
e_enable();
steptimeout = 0;
break;
// M191- power off
@ -446,6 +448,7 @@ void process_gcode_command() {
x_disable();
y_disable();
z_disable();
e_disable();
power_off();
break;

View File

@ -10,6 +10,9 @@ void power_off() {
#ifdef Z_ENABLE_PIN
z_disable();
#endif
#ifdef E_ENABLE_PIN
e_disable();
#endif
#ifdef STEPPER_ENABLE_PIN
WRITE(STEPPER_ENABLE_PIN, STEPPER_ENABLE_INVERT ^ 1);

11
pinio.h
View File

@ -45,6 +45,9 @@
#ifndef E_INVERT_DIR
#define E_INVERT_DIR 0
#endif
#ifndef E_INVERT_ENABLE
#define E_INVERT_ENABLE 0
#endif
#ifndef STEPPER_ENABLE_INVERT
#define STEPPER_ENABLE_INVERT 0
@ -165,4 +168,12 @@ Stepper Enable Pins
#define z_disable() do { } while (0)
#endif
#ifdef E_ENABLE_PIN
#define e_enable() do { WRITE(E_ENABLE_PIN, E_INVERT_ENABLE); SET_OUTPUT(E_ENABLE_PIN); } while (0)
#define e_disable() do { WRITE(E_ENABLE_PIN, E_INVERT_ENABLE ^ 1); SET_OUTPUT(E_ENABLE_PIN); } while (0)
#else
#define e_enable() do { } while (0)
#define e_disable() do { } while (0)
#endif
#endif /* _PINIO_H */