firmware/TBControl/TBControl.cpp
void TBControl::stepXY() {
    unsigned long time = micros();
    int diffx = time - pxtime;
    int diffy = time - pytime; 
    bool xstep = abs(diffx) > xtime;
    bool ystep = abs(diffy) > ytime;

    if (xstep) {
        xaxis->stepBegin();
    }
    if (ystep) {
        yaxis->stepBegin();
    }

    if (xstep) {
        xaxis->stepEnd();
    }

    if (ystep) {
        yaxis->stepEnd();
    }

    unsigned long etime = micros();
    if (xstep) {
        pxtime = etime;
    }
    if (ystep) {
        pytime = etime; 
    }
}
/**
 * Take a single step in BOTH x and y directions if target not yet reached. 
 * If one axis target has been reached but not the other, move only one.
 */
Take a single step in BOTH x and y directions if target not yet reached.
If one axis target has been reached but not the other, move only one.
Take a single step in BOTH x and y directions if target not yet reached . If one axis target has been reached but not the other move only one .
void TBControl::stepXY() {
    unsigned long time = micros();
    int diffx = time - pxtime;
    int diffy = time - pytime; 
    bool xstep = abs(diffx) > xtime;
    bool ystep = abs(diffy) > ytime;
    if (xstep) {
        xaxis->stepBegin();
    }
    if (ystep) {
        yaxis->stepBegin();
    }
    if (xstep) {
        xaxis->stepEnd();
    }
    if (ystep) {
        yaxis->stepEnd();
    }
    unsigned long etime = micros();
    if (xstep) {
        pxtime = etime;
    }
    if (ystep) {
        pytime = etime; 
    }
}
void TBControl :: stepXY ( ) { unsigned long time = micros ( ) ; int diffx = time - pxtime ; int diffy = time - pytime ; bool xstep = abs ( diffx ) > xtime ; bool ystep = abs ( diffy ) > ytime ; if ( xstep ) { xaxis -> stepBegin ( ) ; } if ( ystep ) { yaxis -> stepBegin ( ) ; } if ( xstep ) { xaxis -> stepEnd ( ) ; } if ( ystep ) { yaxis -> stepEnd ( ) ; } unsigned long etime = micros ( ) ; if ( xstep ) { pxtime = etime ; } if ( ystep ) { pytime = etime ; } }
Take a single step in BOTH x and y directions if target not yet reached.
Take a single step in BOTH x and y directions if target not yet reached .