dda_lookahead.c/.h: #ifdef's around some debug-variables.
Move debug.h from .c to .h so debug-vars are available when DEBUG is defined in debug.h. Program -78 Bytes Data -8 Bytes No functional change.
This commit is contained in:
parent
4a5e28975e
commit
0e7165f22f
|
|
@ -17,15 +17,18 @@
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "delay.h"
|
#include "delay.h"
|
||||||
#include "dda_queue.h"
|
#include "dda_queue.h"
|
||||||
#include "debug.h"
|
|
||||||
#include "sersendf.h"
|
#include "sersendf.h"
|
||||||
#include "pinio.h"
|
#include "pinio.h"
|
||||||
#include "memory_barrier.h"
|
#include "memory_barrier.h"
|
||||||
|
|
||||||
extern uint8_t use_lookahead;
|
extern uint8_t use_lookahead;
|
||||||
|
|
||||||
uint32_t lookahead_joined = 0; // Total number of moves joined together
|
#ifdef DEBUG
|
||||||
uint32_t lookahead_timeout = 0; // Moves that did not compute in time to be actually joined
|
// Total number of moves joined together.
|
||||||
|
uint32_t lookahead_joined = 0;
|
||||||
|
// Moves that did not compute in time to be actually joined.
|
||||||
|
uint32_t lookahead_timeout = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
/// \var maximum_jerk_P
|
/// \var maximum_jerk_P
|
||||||
/// \brief maximum allowed feedrate jerk on each axis
|
/// \brief maximum allowed feedrate jerk on each axis
|
||||||
|
|
@ -300,7 +303,9 @@ void dda_join_moves(DDA *prev, DDA *current) {
|
||||||
|
|
||||||
ATOMIC_START
|
ATOMIC_START
|
||||||
// Evaluation: determine how we did...
|
// Evaluation: determine how we did...
|
||||||
|
#ifdef DEBUG
|
||||||
lookahead_joined++;
|
lookahead_joined++;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Determine if we are fast enough - if not, just leave the moves
|
// Determine if we are fast enough - if not, just leave the moves
|
||||||
// Note: to test if the previous move was already executed and replaced by a new
|
// Note: to test if the previous move was already executed and replaced by a new
|
||||||
|
|
@ -321,7 +326,9 @@ void dda_join_moves(DDA *prev, DDA *current) {
|
||||||
// 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:
|
||||||
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "config_wrapper.h"
|
#include "config_wrapper.h"
|
||||||
#include "dda.h"
|
#include "dda.h"
|
||||||
|
#include "debug.h"
|
||||||
|
|
||||||
#ifdef LOOKAHEAD
|
#ifdef LOOKAHEAD
|
||||||
|
|
||||||
|
|
@ -28,8 +29,10 @@ 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
|
// Debug counters
|
||||||
extern uint32_t lookahead_joined;
|
#ifdef DEBUG
|
||||||
extern uint32_t lookahead_timeout;
|
extern uint32_t lookahead_joined;
|
||||||
|
extern uint32_t lookahead_timeout;
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* LOOKAHEAD */
|
#endif /* LOOKAHEAD */
|
||||||
#endif /* DDA_LOOKAHEAD_H_ */
|
#endif /* DDA_LOOKAHEAD_H_ */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue