Corrected IN_DEBUGGER occurrences

This commit is contained in:
Alden Hart
2017-01-01 08:35:40 -05:00
parent 941772e4ad
commit d95cf5699f
3 changed files with 9 additions and 6 deletions
+5 -3
View File
@@ -178,7 +178,8 @@ static stat_t _plan_move(mpBuf_t *bf, float entry_velocity)
mp_calculate_ramps(block, bf, entry_velocity); // (which it will if you don't do this)
// diagnostic traps
#ifdef IN_DEBUGGER
#if IN_DEBUGGER == 1
if (block->exit_velocity > block->cruise_velocity) {
__asm__("BKPT"); // exit > cruise after calculate_block
}
@@ -186,6 +187,7 @@ static stat_t _plan_move(mpBuf_t *bf, float entry_velocity)
__asm__("BKPT"); // zero or negative length block
}
#endif
bf->buffer_state = MP_BUFFER_PLANNED; //...here
bf->plannable = false;
return (STAT_OK); // report that we planned something...
@@ -256,7 +258,7 @@ stat_t mp_exec_move()
// first-time operations
if (bf->buffer_state != MP_BUFFER_RUNNING) {
if ((bf->buffer_state < MP_BUFFER_PREPPED) && (cm.motion_state == MOTION_RUN)) {
#ifdef IN_DEBUGGER
#if IN_DEBUGGER == 1
__asm__("BKPT"); // mp_exec_move() buffer is not prepped
#endif
// IMPORTANT: We can't rpt_exception from here!
@@ -271,7 +273,7 @@ stat_t mp_exec_move()
if (bf->buffer_state == MP_BUFFER_PREPPED) {
if (cm.motion_state == MOTION_RUN) {
#ifdef IN_DEBUGGER
#if IN_DEBUGGER == 1
__asm__("BKPT"); // we are running but don't have a block planned
#endif
}
+3 -2
View File
@@ -49,13 +49,14 @@ static void _logger(const char *msg, const mpBuf_t *bf) // LOG_RETURN wi
#define LOG_RETURN(msg) { _logger(msg, bf); }
*/
//#define TRAP_ZERO(t,m)
#define TRAP_ZERO(t,m)
/*
#define TRAP_ZERO(t, m) \
if (fp_ZERO(t)) { \
rpt_exception(STAT_MINIMUM_LENGTH_MOVE, m); \
_debug_trap(m); \
}
*/
//+++++ END DIAGNOSTICS
/* local functions */
Executable → Regular
+1 -1
View File
@@ -57,7 +57,7 @@ inline void _debug_trap(const char *reason) {
// We might be able to put a print here, but it MIGHT interrupt other output
// and might be deep in an ISR, so we had better just _NOP() and hope for the best.
__NOP();
#ifdef IN_DEBUGGER
#if IN_DEBUGGER == 1
__asm__("BKPT");
#endif
}