From 72586eb30ab109be55bfff2ae5fd5f9dc4e805e6 Mon Sep 17 00:00:00 2001 From: daid303 Date: Mon, 12 Nov 2012 09:29:12 +0100 Subject: [PATCH] Solved few warnings. --- Marlin/planner.cpp | 2 +- Marlin/stepper.cpp | 2 +- Marlin/temperature.cpp | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index caee9915b..bb6f7ebb1 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 d5c8164b7..854ec6bae 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 9bc095360..bc46c9f7f 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];