Simlified the extruder ticking code.
This commit is contained in:
parent
e3dadfde71
commit
a1fd50ea9a
|
|
@ -634,34 +634,20 @@ void isr() {
|
||||||
if ((out_bits & (1 << E_AXIS)) != 0)
|
if ((out_bits & (1 << E_AXIS)) != 0)
|
||||||
{ // -direction
|
{ // -direction
|
||||||
//AKU
|
//AKU
|
||||||
|
WRITE(E0_DIR_PIN,
|
||||||
#ifdef SNMM
|
#ifdef SNMM
|
||||||
if (snmm_extruder == 0 || snmm_extruder == 2)
|
(snmm_extruder == 0 || snmm_extruder == 2) ? !INVERT_E0_DIR :
|
||||||
{
|
|
||||||
NORM_E_DIR();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
REV_E_DIR();
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
REV_E_DIR();
|
|
||||||
#endif // SNMM
|
#endif // SNMM
|
||||||
|
INVERT_E0_DIR);
|
||||||
count_direction[E_AXIS] = -1;
|
count_direction[E_AXIS] = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // +direction
|
{ // +direction
|
||||||
|
WRITE(E0_DIR_PIN,
|
||||||
#ifdef SNMM
|
#ifdef SNMM
|
||||||
if (snmm_extruder == 0 || snmm_extruder == 2)
|
(snmm_extruder == 0 || snmm_extruder == 2) ? INVERT_E0_DIR :
|
||||||
{
|
|
||||||
REV_E_DIR();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
NORM_E_DIR();
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
NORM_E_DIR();
|
|
||||||
#endif // SNMM
|
#endif // SNMM
|
||||||
|
!INVERT_E0_DIR);
|
||||||
count_direction[E_AXIS] = 1;
|
count_direction[E_AXIS] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -738,10 +724,10 @@ void isr() {
|
||||||
#ifndef LIN_ADVANCE
|
#ifndef LIN_ADVANCE
|
||||||
counter_e += current_block->steps_e;
|
counter_e += current_block->steps_e;
|
||||||
if (counter_e > 0) {
|
if (counter_e > 0) {
|
||||||
WRITE_E_STEP(!INVERT_E_STEP_PIN);
|
WRITE(E0_STEP_PIN, !INVERT_E_STEP_PIN);
|
||||||
counter_e -= current_block->step_event_count;
|
counter_e -= current_block->step_event_count;
|
||||||
count_position[E_AXIS]+=count_direction[E_AXIS];
|
count_position[E_AXIS]+=count_direction[E_AXIS];
|
||||||
WRITE_E_STEP(INVERT_E_STEP_PIN);
|
WRITE(E0_STEP_PIN, INVERT_E_STEP_PIN);
|
||||||
#ifdef PAT9125
|
#ifdef PAT9125
|
||||||
fsensor_counter++;
|
fsensor_counter++;
|
||||||
#endif //PAT9125
|
#endif //PAT9125
|
||||||
|
|
|
||||||
|
|
@ -23,20 +23,6 @@
|
||||||
|
|
||||||
#include "planner.h"
|
#include "planner.h"
|
||||||
|
|
||||||
#if EXTRUDERS > 2
|
|
||||||
#define WRITE_E_STEP(v) { if(current_block->active_extruder == 2) { WRITE(E2_STEP_PIN, v); } else { if(current_block->active_extruder == 1) { WRITE(E1_STEP_PIN, v); } else { WRITE(E0_STEP_PIN, v); }}}
|
|
||||||
#define NORM_E_DIR() { if(current_block->active_extruder == 2) { WRITE(E2_DIR_PIN, !INVERT_E2_DIR); } else { if(current_block->active_extruder == 1) { WRITE(E1_DIR_PIN, !INVERT_E1_DIR); } else { WRITE(E0_DIR_PIN, !INVERT_E0_DIR); }}}
|
|
||||||
#define REV_E_DIR() { if(current_block->active_extruder == 2) { WRITE(E2_DIR_PIN, INVERT_E2_DIR); } else { if(current_block->active_extruder == 1) { WRITE(E1_DIR_PIN, INVERT_E1_DIR); } else { WRITE(E0_DIR_PIN, INVERT_E0_DIR); }}}
|
|
||||||
#elif EXTRUDERS > 1
|
|
||||||
#define WRITE_E_STEP(v) { if(current_block->active_extruder == 1) { WRITE(E1_STEP_PIN, v); } else { WRITE(E0_STEP_PIN, v); }}
|
|
||||||
#define NORM_E_DIR() { if(current_block->active_extruder == 1) { WRITE(E1_DIR_PIN, !INVERT_E1_DIR); } else { WRITE(E0_DIR_PIN, !INVERT_E0_DIR); }}
|
|
||||||
#define REV_E_DIR() { if(current_block->active_extruder == 1) { WRITE(E1_DIR_PIN, INVERT_E1_DIR); } else { WRITE(E0_DIR_PIN, INVERT_E0_DIR); }}
|
|
||||||
#else
|
|
||||||
#define WRITE_E_STEP(v) WRITE(E0_STEP_PIN, v)
|
|
||||||
#define NORM_E_DIR() WRITE(E0_DIR_PIN, !INVERT_E0_DIR)
|
|
||||||
#define REV_E_DIR() WRITE(E0_DIR_PIN, INVERT_E0_DIR)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
|
#ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
|
||||||
extern bool abort_on_endstop_hit;
|
extern bool abort_on_endstop_hit;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue