Configurable SLOWDOWN divisor (#17171)

This commit is contained in:
InsanityAutomation
2020-03-15 19:29:18 -04:00
committed by GitHub
parent 3b987dfcec
commit 775a4294fc
2 changed files with 9 additions and 2 deletions

View File

@ -2041,7 +2041,10 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
#endif
#if ENABLED(SLOWDOWN)
if (WITHIN(moves_queued, 2, (BLOCK_BUFFER_SIZE) / 2 - 1)) {
#ifndef SLOWDOWN_DIVISOR
#define SLOWDOWN_DIVISOR 2
#endif
if (WITHIN(moves_queued, 2, (BLOCK_BUFFER_SIZE) / (SLOWDOWN_DIVISOR) - 1)) {
if (segment_time_us < settings.min_segment_time_us) {
// buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more.
const uint32_t nst = segment_time_us + LROUND(2 * (settings.min_segment_time_us - segment_time_us) / moves_queued);