From bed5dcb2105bb8b6ba3556b2d706d22c6015c34d Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Tue, 6 Sep 2016 21:48:08 +0200 Subject: [PATCH] dda_lookahead.c/.h: more debugging code removal/wrapping. Program size -76 bytes, Data size unchanged. --- dda_lookahead.c | 21 +++++++++++++-------- dda_lookahead.h | 6 ------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/dda_lookahead.c b/dda_lookahead.c index e36af36..ae8403a 100644 --- a/dda_lookahead.c +++ b/dda_lookahead.c @@ -299,7 +299,9 @@ void dda_join_moves(DDA *prev, DDA *current) { sersendf_P(PSTR("this_F: %lu\n"), this_F_in_steps); } - uint8_t timeout = 0; + #ifdef DEBUG + uint8_t timeout = 0; + #endif ATOMIC_START // Evaluation: determine how we did... @@ -319,17 +321,20 @@ void dda_join_moves(DDA *prev, DDA *current) { current->end_steps = 0; current->start_steps = this_F_start_in_steps; la_cnt++; - } else - timeout = 1; + } + #ifdef DEBUG + else + timeout = 1; + #endif ATOMIC_END // If we were not fast enough, any feedback will happen outside the atomic block: - if(timeout) { - sersendf_P(PSTR("// Notice: look ahead not fast enough\n")); - #ifdef DEBUG + #ifdef DEBUG + if (timeout) { + sersendf_P(PSTR("// Notice: look ahead not fast enough\n")); lookahead_timeout++; - #endif - } + } + #endif } } diff --git a/dda_lookahead.h b/dda_lookahead.h index 4dc6f98..1741c15 100644 --- a/dda_lookahead.h +++ b/dda_lookahead.h @@ -28,11 +28,5 @@ void dda_find_crossing_speed(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 /* DDA_LOOKAHEAD_H_ */