🎨 Minimize block->steps.set

This commit is contained in:
Scott Lahteine 2022-04-20 04:29:39 -05:00
parent d5a79c27fe
commit c56fb1c182

View file

@ -1976,22 +1976,24 @@ bool Planner::_populate_block(
// Number of steps for each axis // Number of steps for each axis
// See https://www.corexy.com/theory.html // See https://www.corexy.com/theory.html
#if CORE_IS_XY block->steps.set(LINEAR_AXIS_LIST(
block->steps.set(LINEAR_AXIS_LIST(ABS(da + db), ABS(da - db), ABS(dc), ABS(di), ABS(dj), ABS(dk))); #if CORE_IS_XY
#elif CORE_IS_XZ ABS(da + db), ABS(da - db), ABS(dc)
block->steps.set(LINEAR_AXIS_LIST(ABS(da + dc), ABS(db), ABS(da - dc), ABS(di), ABS(dj), ABS(dk))); #elif CORE_IS_XZ
#elif CORE_IS_YZ ABS(da + dc), ABS(db), ABS(da - dc)
block->steps.set(LINEAR_AXIS_LIST(ABS(da), ABS(db + dc), ABS(db - dc), ABS(di), ABS(dj), ABS(dk))); #elif CORE_IS_YZ
#elif ENABLED(MARKFORGED_XY) ABS(da), ABS(db + dc), ABS(db - dc)
block->steps.set(LINEAR_AXIS_LIST(ABS(da + db), ABS(db), ABS(dc), ABS(di), ABS(dj), ABS(dk))); #elif ENABLED(MARKFORGED_XY)
#elif ENABLED(MARKFORGED_YX) ABS(da + db), ABS(db), ABS(dc)
block->steps.set(LINEAR_AXIS_LIST(ABS(da), ABS(db + da), ABS(dc), ABS(di), ABS(dj), ABS(dk))); #elif ENABLED(MARKFORGED_YX)
#elif IS_SCARA ABS(da), ABS(db + da), ABS(dc)
block->steps.set(LINEAR_AXIS_LIST(ABS(da), ABS(db), ABS(dc), ABS(di), ABS(dj), ABS(dk))); #elif IS_SCARA
#else ABS(da), ABS(db), ABS(dc)
// default non-h-bot planning #else // default non-h-bot planning
block->steps.set(LINEAR_AXIS_LIST(ABS(da), ABS(db), ABS(dc), ABS(di), ABS(dj), ABS(dk))); ABS(da), ABS(db), ABS(dc)
#endif #endif
, ABS(di), ABS(dj), ABS(dk)
));
/** /**
* This part of the code calculates the total length of the movement. * This part of the code calculates the total length of the movement.