|
@@ -310,7 +310,11 @@ typedef struct PlannerBlock {
|
|
|
#define HAS_POSITION_FLOAT 1
|
|
|
#endif
|
|
|
|
|
|
-#define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1))
|
|
|
+#if IS_POWER_OF_2(BLOCK_BUFFER_SIZE)
|
|
|
+ #define BLOCK_MOD(n) ((n)&((BLOCK_BUFFER_SIZE)-1))
|
|
|
+#else
|
|
|
+ #define BLOCK_MOD(n) ((n)%(BLOCK_BUFFER_SIZE))
|
|
|
+#endif
|
|
|
|
|
|
#if ENABLED(LASER_FEATURE)
|
|
|
typedef struct {
|
|
@@ -366,7 +370,7 @@ typedef struct {
|
|
|
#endif
|
|
|
|
|
|
#if ENABLED(DISABLE_OTHER_EXTRUDERS)
|
|
|
- typedef uvalue_t(BLOCK_BUFFER_SIZE * 2) last_move_t;
|
|
|
+ typedef uvalue_t((BLOCK_BUFFER_SIZE) * 2) last_move_t;
|
|
|
#endif
|
|
|
|
|
|
#if ENABLED(ARC_SUPPORT)
|
|
@@ -780,7 +784,7 @@ class Planner {
|
|
|
FORCE_INLINE static bool is_full() { return block_buffer_tail == next_block_index(block_buffer_head); }
|
|
|
|
|
|
// Get count of movement slots free
|
|
|
- FORCE_INLINE static uint8_t moves_free() { return BLOCK_BUFFER_SIZE - 1 - movesplanned(); }
|
|
|
+ FORCE_INLINE static uint8_t moves_free() { return (BLOCK_BUFFER_SIZE) - 1 - movesplanned(); }
|
|
|
|
|
|
/**
|
|
|
* Planner::get_next_free_block
|