diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index caee9915be..bb6f7ebb17 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -193,7 +193,7 @@ void calculate_trapezoid_for_block(block_t *block, float entry_factor, float exi if (plateau_steps < 0) { accelerate_steps = ceil(intersection_distance(block->initial_rate, block->final_rate, acceleration, block->step_event_count)); accelerate_steps = max(accelerate_steps,0); // Check limits due to numerical round-off - accelerate_steps = min(accelerate_steps,block->step_event_count); + accelerate_steps = min((uint32_t)accelerate_steps,block->step_event_count);//(We can cast here to unsigned, because the above line ensures that we are above zero) plateau_steps = 0; } diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index d5c8164b73..854ec6baeb 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -52,8 +52,8 @@ volatile static unsigned long step_events_completed; // The number of step event #ifdef ADVANCE static long advance_rate, advance, final_advance = 0; static long old_advance = 0; + static long e_steps[3]; #endif -static long e_steps[3]; static long acceleration_time, deceleration_time; //static unsigned long accelerate_until, decelerate_after, acceleration_rate, initial_rate, final_rate, nominal_rate; static unsigned short acc_step_rate; // needed for deccelaration start point diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 9bc0953609..bc46c9f7ff 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -906,9 +906,15 @@ ISR(TIMER0_COMPB_vect) static unsigned char temp_state = 0; static unsigned char pwm_count = 1; static unsigned char soft_pwm_0; + #if EXTRUDERS > 1 static unsigned char soft_pwm_1; + #endif + #if EXTRUDERS > 2 static unsigned char soft_pwm_2; + #endif + #if HEATER_BED_PIN > -1 static unsigned char soft_pwm_b; + #endif if(pwm_count == 0){ soft_pwm_0 = soft_pwm[0];