diff --git a/Firmware/planner.cpp b/Firmware/planner.cpp index c0f465c2a..9ff291a0c 100644 --- a/Firmware/planner.cpp +++ b/Firmware/planner.cpp @@ -1132,7 +1132,7 @@ Having the real displacement of the head, we can calculate the total movement le block->acceleration_st = (block->acceleration_st + (bresenham_oversample >> 1)) / bresenham_oversample; #endif - block->acceleration_rate = (long)((float)block->acceleration_st * (16777216.0 / (F_CPU / 8.0))); + block->acceleration_rate = ((float)block->acceleration_st * (16777216.0 / (F_CPU / 8.0))); #ifdef LIN_ADVANCE if (block->use_advance_lead) { diff --git a/Firmware/planner.h b/Firmware/planner.h index 425ed9b54..34899cac4 100644 --- a/Firmware/planner.h +++ b/Firmware/planner.h @@ -73,7 +73,7 @@ typedef struct { // steps_x.y,z, step_event_count, acceleration_rate, direction_bits and active_extruder are set by plan_buffer_line(). dda_isteps_t steps_x, steps_y, steps_z, steps_e; // Step count along each axis dda_usteps_t step_event_count; // The number of step events required to complete this block - long acceleration_rate; // The acceleration rate used for acceleration calculation + uint32_t acceleration_rate; // The acceleration rate used for acceleration calculation unsigned char direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h) unsigned char active_extruder; // Selects the active extruder // accelerate_until and decelerate_after are set by calculate_trapezoid_for_block() and they need to be synchronized with the stepper interrupt controller.