mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2026-01-05 22:27:43 -07:00
🎨 Aesthetic tweaks
This commit is contained in:
parent
33ad711ee8
commit
8bf127afe6
3 changed files with 9 additions and 8 deletions
|
|
@ -781,7 +781,7 @@ block_t* Planner::get_current_block() {
|
|||
block_t* Planner::get_future_block(const uint8_t offset) {
|
||||
const uint8_t nr_moves = movesplanned();
|
||||
if (nr_moves <= offset) return nullptr;
|
||||
block_t * const block = &block_buffer[block_inc_mod(block_buffer_tail, offset)];
|
||||
block_t * const block = &block_buffer[block_add_mod(block_buffer_tail, offset)];
|
||||
if (block->flag.recalculate) return nullptr;
|
||||
return block;
|
||||
}
|
||||
|
|
@ -878,6 +878,7 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const float e
|
|||
block->acceleration_time_inverse = acceleration_time_inverse;
|
||||
block->deceleration_time_inverse = deceleration_time_inverse;
|
||||
#endif
|
||||
|
||||
#if ENABLED(SMOOTH_LIN_ADVANCE)
|
||||
block->cruise_time = plateau_steps > 0 ? float(plateau_steps) * float(STEPPER_TIMER_RATE) / float(cruise_rate) : 0;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -325,11 +325,11 @@ typedef struct PlannerBlock {
|
|||
#define HAS_POSITION_FLOAT 1
|
||||
#endif
|
||||
|
||||
constexpr uint8_t block_dec_mod(const uint8_t v1, const uint8_t v2) {
|
||||
constexpr uint8_t block_sub_mod(const uint8_t v1, const uint8_t v2) {
|
||||
return v1 >= v2 ? v1 - v2 : v1 - v2 + BLOCK_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
constexpr uint8_t block_inc_mod(const uint8_t v1, const uint8_t v2) {
|
||||
constexpr uint8_t block_add_mod(const uint8_t v1, const uint8_t v2) {
|
||||
return v1 + v2 < BLOCK_BUFFER_SIZE ? v1 + v2 : v1 + v2 - BLOCK_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
|
|
@ -850,10 +850,10 @@ class Planner {
|
|||
#endif // HAS_POSITION_MODIFIERS
|
||||
|
||||
// Number of moves currently in the planner including the busy block, if any
|
||||
FORCE_INLINE static uint8_t movesplanned() { return block_dec_mod(block_buffer_head, block_buffer_tail); }
|
||||
FORCE_INLINE static uint8_t movesplanned() { return block_sub_mod(block_buffer_head, block_buffer_tail); }
|
||||
|
||||
// Number of nonbusy moves currently in the planner
|
||||
FORCE_INLINE static uint8_t nonbusy_movesplanned() { return block_dec_mod(block_buffer_head, block_buffer_nonbusy); }
|
||||
FORCE_INLINE static uint8_t nonbusy_movesplanned() { return block_sub_mod(block_buffer_head, block_buffer_nonbusy); }
|
||||
|
||||
// Remove all blocks from the buffer
|
||||
FORCE_INLINE static void clear_block_buffer() {
|
||||
|
|
@ -1131,8 +1131,8 @@ class Planner {
|
|||
/**
|
||||
* Get the index of the next / previous block in the ring buffer
|
||||
*/
|
||||
static constexpr uint8_t next_block_index(const uint8_t block_index) { return block_inc_mod(block_index, 1); }
|
||||
static constexpr uint8_t prev_block_index(const uint8_t block_index) { return block_dec_mod(block_index, 1); }
|
||||
static constexpr uint8_t next_block_index(const uint8_t block_index) { return block_add_mod(block_index, 1); }
|
||||
static constexpr uint8_t prev_block_index(const uint8_t block_index) { return block_sub_mod(block_index, 1); }
|
||||
|
||||
/**
|
||||
* Calculate the maximum allowable speed squared at this point, in order
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@
|
|||
#define BTN_ENC EXP1_02_PIN
|
||||
#define BTN_EN1 EXP2_03_PIN
|
||||
#define BTN_EN2 EXP2_05_PIN
|
||||
#elif ENABLED(HAS_GRAPHICAL_TFT)
|
||||
#elif HAS_GRAPHICAL_TFT
|
||||
#define TFT_BUFFER_WORDS 14400
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue