volatile_block_buffer_runtime_us
`block_buffer_runtime_us` is mangled in the planner and in the stepper-ISR. So it needs to be volatile and interrupt protected.
This commit is contained in:
@ -146,7 +146,7 @@ float Planner::previous_speed[NUM_AXIS],
|
||||
#endif
|
||||
|
||||
#if ENABLED(ENSURE_SMOOTH_MOVES)
|
||||
uint32_t Planner::block_buffer_runtime_us = 0;
|
||||
volatile uint32_t Planner::block_buffer_runtime_us = 0;
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -1007,7 +1007,9 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
||||
segment_time = (MIN_BLOCK_TIME) * 1000UL;
|
||||
}
|
||||
block->segment_time = segment_time;
|
||||
block_buffer_runtime_us += segment_time;
|
||||
CRITICAL_SECTION_START
|
||||
block_buffer_runtime_us += segment_time;
|
||||
CRITICAL_SECTION_END
|
||||
#endif
|
||||
|
||||
block->nominal_speed = block->millimeters * inverse_mm_s; // (mm/sec) Always > 0
|
||||
|
Reference in New Issue
Block a user