Fix absolute E positioning.

Now also works with M101/M103
This commit is contained in:
Markus Amsler 2011-04-12 01:17:28 +02:00
parent 1d556e0278
commit 4b7f8fba48
2 changed files with 9 additions and 5 deletions

12
dda.c
View File

@ -379,8 +379,10 @@ void dda_create(DDA *dda, TARGET *target) {
// next dda starts where we finish
memcpy(&startpoint, target, sizeof(TARGET));
// E is always relative, reset it here
startpoint.E = 0;
// if E is relative, reset it here
#ifndef E_ABSOLUTE
startpoint.E = 0;
#endif
}
/*! Start a prepared DDA
@ -647,8 +649,10 @@ void dda_step(DDA *dda) {
}
else {
dda->live = 0;
// reset E- always relative
current_position.E = 0;
// if E is relative reset it
#ifndef E_ABSOLUTE
current_position.E = 0;
#endif
// linear acceleration code doesn't alter F during a move, so we must update it here
// in theory, we *could* update F every step, but that would require a divide in interrupt context which should be avoided if at all possible
current_position.F = dda->endpoint.F;

View File

@ -64,7 +64,7 @@ static void zero_z(void) {
/// move E by a certain amount at a certain speed
static void SpecialMoveE(int32_t e, uint32_t f) {
TARGET t = startpoint;
t.E = e;
t.E += e;
t.F = f;
enqueue(&t);
}