Merge pull request #7722 from tcm0116/2.0.x-warnings

Cleanup 2.0.x compiler warnings
This commit is contained in:
Scott Lahteine
2017-10-01 21:56:54 -05:00
committed by GitHub
22 changed files with 238 additions and 224 deletions

View File

@ -135,9 +135,9 @@ volatile uint32_t Stepper::step_events_completed = 0; // The number of step even
* This fix isn't perfect and may lose steps - but better than locking up completely
* in future the planner should slow down if advance stepping rate would be too high
*/
FORCE_INLINE uint16_t adv_rate(const int steps, const uint16_t timer, const uint8_t loops) {
FORCE_INLINE HAL_TIMER_TYPE adv_rate(const int steps, const HAL_TIMER_TYPE timer, const uint8_t loops) {
if (steps) {
const uint16_t rate = (timer * loops) / abs(steps);
const HAL_TIMER_TYPE rate = (timer * loops) / abs(steps);
//return constrain(rate, 1, ADV_NEVER - 1)
return rate ? rate : 1;
}
@ -815,8 +815,8 @@ void Stepper::isr() {
#if DISABLED(ADVANCE) && DISABLED(LIN_ADVANCE)
#ifdef CPU_32_BIT
// Make sure stepper interrupt does not monopolise CPU by adjusting count to give about 8 us room
uint32_t stepper_timer_count = HAL_timer_get_count(STEP_TIMER_NUM),
stepper_timer_current_count = HAL_timer_get_current_count(STEP_TIMER_NUM) + 8 * HAL_TICKS_PER_US;
HAL_TIMER_TYPE stepper_timer_count = HAL_timer_get_count(STEP_TIMER_NUM),
stepper_timer_current_count = HAL_timer_get_current_count(STEP_TIMER_NUM) + 8 * HAL_TICKS_PER_US;
HAL_timer_set_count(STEP_TIMER_NUM, max(stepper_timer_count, stepper_timer_current_count));
#else
NOLESS(OCR1A, TCNT1 + 16);

View File

@ -1744,8 +1744,8 @@ void Temperature::isr() {
// Macros for Slow PWM timer logic
#define _SLOW_PWM_ROUTINE(NR, src) \
soft_pwm_ ##NR = src; \
if (soft_pwm_ ##NR > 0) { \
soft_pwm_count_ ##NR = src; \
if (soft_pwm_count_ ##NR > 0) { \
if (state_timer_heater_ ##NR == 0) { \
if (state_heater_ ##NR == 0) state_timer_heater_ ##NR = MIN_STATE_TIME; \
state_heater_ ##NR = 1; \
@ -1762,7 +1762,7 @@ void Temperature::isr() {
#define SLOW_PWM_ROUTINE(n) _SLOW_PWM_ROUTINE(n, soft_pwm_amount[n])
#define PWM_OFF_ROUTINE(NR) \
if (soft_pwm_ ##NR < slow_pwm_count) { \
if (soft_pwm_count_ ##NR < slow_pwm_count) { \
if (state_timer_heater_ ##NR == 0) { \
if (state_heater_ ##NR == 1) state_timer_heater_ ##NR = MIN_STATE_TIME; \
state_heater_ ##NR = 0; \

View File

@ -286,8 +286,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
#else // !DUAL_X_CARRIAGE
#if ENABLED(PARKING_EXTRUDER) // Dual Parking extruder
const float z_diff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder];
float z_raise = 0;
float z_raise = PARKING_EXTRUDER_SECURITY_RAISE;
if (!no_move) {
const float parkingposx[] = PARKING_EXTRUDER_PARKING_X,
@ -310,7 +309,6 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
SERIAL_ECHOLNPGM("Starting Autopark");
if (DEBUGGING(LEVELING)) DEBUG_POS("current position:", current_position);
#endif
z_raise = PARKING_EXTRUDER_SECURITY_RAISE;
current_position[Z_AXIS] += z_raise;
#if ENABLED(DEBUG_LEVELING_FEATURE)
SERIAL_ECHOLNPGM("(1) Raise Z-Axis ");