dda_lookahead.c/.h: more debugging code removal/wrapping.

Program size -76 bytes,
Data size unchanged.
This commit is contained in:
Markus Hitter 2016-09-06 21:48:08 +02:00
parent 0e7165f22f
commit bed5dcb210
2 changed files with 13 additions and 14 deletions

View File

@ -299,7 +299,9 @@ void dda_join_moves(DDA *prev, DDA *current) {
sersendf_P(PSTR("this_F: %lu\n"), this_F_in_steps); sersendf_P(PSTR("this_F: %lu\n"), this_F_in_steps);
} }
#ifdef DEBUG
uint8_t timeout = 0; uint8_t timeout = 0;
#endif
ATOMIC_START ATOMIC_START
// Evaluation: determine how we did... // Evaluation: determine how we did...
@ -319,17 +321,20 @@ void dda_join_moves(DDA *prev, DDA *current) {
current->end_steps = 0; current->end_steps = 0;
current->start_steps = this_F_start_in_steps; current->start_steps = this_F_start_in_steps;
la_cnt++; la_cnt++;
} else }
#ifdef DEBUG
else
timeout = 1; timeout = 1;
#endif
ATOMIC_END ATOMIC_END
// If we were not fast enough, any feedback will happen outside the atomic block: // If we were not fast enough, any feedback will happen outside the atomic block:
#ifdef DEBUG
if (timeout) { if (timeout) {
sersendf_P(PSTR("// Notice: look ahead not fast enough\n")); sersendf_P(PSTR("// Notice: look ahead not fast enough\n"));
#ifdef DEBUG
lookahead_timeout++; lookahead_timeout++;
#endif
} }
#endif
} }
} }

View File

@ -28,11 +28,5 @@
void dda_find_crossing_speed(DDA *prev, DDA *current); void dda_find_crossing_speed(DDA *prev, DDA *current);
void dda_join_moves(DDA *prev, DDA *current); void dda_join_moves(DDA *prev, DDA *current);
// Debug counters
#ifdef DEBUG
extern uint32_t lookahead_joined;
extern uint32_t lookahead_timeout;
#endif
#endif /* LOOKAHEAD */ #endif /* LOOKAHEAD */
#endif /* DDA_LOOKAHEAD_H_ */ #endif /* DDA_LOOKAHEAD_H_ */