dda.c: pretty-format dda_start().
Formatting was messed up during all the recent changes. Only whitespace and comment changes, no functional change.
This commit is contained in:
parent
7726b3179c
commit
39f66ef6b0
23
dda.c
23
dda.c
|
|
@ -481,26 +481,21 @@ void dda_create(DDA *dda, const TARGET *target) {
|
|||
serial_writestr_P(PSTR("] }\n"));
|
||||
}
|
||||
|
||||
/*! Start a prepared DDA
|
||||
\param *dda pointer to entry in dda_queue to start
|
||||
/** Start a prepared DDA
|
||||
|
||||
\param *dda Pointer to entry in the movement queue to start.
|
||||
|
||||
This function actually begins the move described by the passed DDA entry.
|
||||
|
||||
We set direction and enable outputs, and set the timer for the first step from the precalculated value.
|
||||
|
||||
We also mark this DDA as running, so other parts of the firmware know that something is happening
|
||||
|
||||
Called both inside and outside of interrupts.
|
||||
Called from both, inside and outside of interrupts.
|
||||
*/
|
||||
void dda_start(DDA *dda) {
|
||||
// called from interrupt context: keep it simple!
|
||||
|
||||
if (DEBUG_DDA && (debug_flags & DEBUG_DDA))
|
||||
sersendf_P(PSTR("Start: X %lq Y %lq Z %lq F %lu\n"),
|
||||
dda->endpoint.axis[X], dda->endpoint.axis[Y],
|
||||
dda->endpoint.axis[Z], dda->endpoint.F);
|
||||
|
||||
// get ready to go
|
||||
// Get ready to go.
|
||||
psu_timeout = 0;
|
||||
#ifdef Z_AUTODISABLE
|
||||
if (dda->delta[Z])
|
||||
|
|
@ -509,7 +504,7 @@ void dda_start(DDA *dda) {
|
|||
if (dda->endstop_check)
|
||||
endstops_on();
|
||||
|
||||
// set direction outputs
|
||||
// Set direction outputs.
|
||||
x_direction(dda->x_direction);
|
||||
y_direction(dda->y_direction);
|
||||
z_direction(dda->z_direction);
|
||||
|
|
@ -520,7 +515,7 @@ void dda_start(DDA *dda) {
|
|||
heater_set(DC_EXTRUDER, DC_EXTRUDER_PWM);
|
||||
#endif
|
||||
|
||||
// initialise state variable
|
||||
// Initialise state variables.
|
||||
move_state.counter[X] = move_state.counter[Y] = move_state.counter[Z] = \
|
||||
move_state.counter[E] = -(dda->total_steps >> 1);
|
||||
move_state.endstop_stop = 0;
|
||||
|
|
@ -533,10 +528,10 @@ void dda_start(DDA *dda) {
|
|||
move_state.time[Z] = move_state.time[E] = 0UL;
|
||||
#endif
|
||||
|
||||
// ensure this dda starts
|
||||
// Ensure this DDA starts.
|
||||
dda->live = 1;
|
||||
|
||||
// set timeout for first step
|
||||
// Set timeout for first step.
|
||||
timer_set(dda->c, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue