1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-23 12:04:19 +00:00

Fix some compiler warnings

This commit is contained in:
Scott Lahteine 2018-05-12 05:27:51 -05:00
parent 3614e6ce0f
commit f5aaa2d6c0
2 changed files with 25 additions and 23 deletions

View File

@ -31,10 +31,11 @@
#include "../../queue.h" #include "../../queue.h"
#define M91x_USE(A) (ENABLED(A##_IS_TMC2130) || (ENABLED(A##_IS_TMC2208) && PIN_EXISTS(A##_SERIAL_RX))) #define M91x_USE(A) (ENABLED(A##_IS_TMC2130) || (ENABLED(A##_IS_TMC2208) && PIN_EXISTS(A##_SERIAL_RX)))
#define M91x_USE_E(N) (E_STEPPERS > N && M91x_USE(E##N))
#define M91x_USE_X (ENABLED(IS_TRAMS) || M91x_USE(X)) #define M91x_USE_X (ENABLED(IS_TRAMS) || M91x_USE(X))
#define M91x_USE_Y (ENABLED(IS_TRAMS) || M91x_USE(Y)) #define M91x_USE_Y (ENABLED(IS_TRAMS) || M91x_USE(Y))
#define M91x_USE_Z (ENABLED(IS_TRAMS) || M91x_USE(Z)) #define M91x_USE_Z (ENABLED(IS_TRAMS) || M91x_USE(Z))
#define M91x_USE_E0 (ENABLED(IS_TRAMS) || M91x_USE(E0)) #define M91x_USE_E0 (ENABLED(IS_TRAMS) || M91x_USE_E(0))
/** /**
* M911: Report TMC stepper driver overtemperature pre-warn flag * M911: Report TMC stepper driver overtemperature pre-warn flag
@ -62,16 +63,16 @@ void GcodeSuite::M911() {
#if M91x_USE_E0 #if M91x_USE_E0
tmc_report_otpw(stepperE0, TMC_E0); tmc_report_otpw(stepperE0, TMC_E0);
#endif #endif
#if M91x_USE(E1) #if M91x_USE_E(1)
tmc_report_otpw(stepperE1, TMC_E1); tmc_report_otpw(stepperE1, TMC_E1);
#endif #endif
#if M91x_USE(E2) #if M91x_USE_E(2)
tmc_report_otpw(stepperE2, TMC_E2); tmc_report_otpw(stepperE2, TMC_E2);
#endif #endif
#if M91x_USE(E3) #if M91x_USE_E(3)
tmc_report_otpw(stepperE3, TMC_E3); tmc_report_otpw(stepperE3, TMC_E3);
#endif #endif
#if M91x_USE(E4) #if M91x_USE_E(4)
tmc_report_otpw(stepperE4, TMC_E4); tmc_report_otpw(stepperE4, TMC_E4);
#endif #endif
} }
@ -105,7 +106,6 @@ void GcodeSuite::M912() {
#endif #endif
#endif #endif
#define M91x_USE_Y (M91x_USE(Y) || ENABLED(IS_TRAMS))
#if M91x_USE_Y || M91x_USE(Y2) #if M91x_USE_Y || M91x_USE(Y2)
const uint8_t yval = parser.byteval(axis_codes[Y_AXIS], 10); const uint8_t yval = parser.byteval(axis_codes[Y_AXIS], 10);
#if M91x_USE_Y #if M91x_USE_Y
@ -116,7 +116,6 @@ void GcodeSuite::M912() {
#endif #endif
#endif #endif
#define M91x_USE_Z (M91x_USE(Z) || ENABLED(IS_TRAMS))
#if M91x_USE_Z || M91x_USE(Z2) #if M91x_USE_Z || M91x_USE(Z2)
const uint8_t zval = parser.byteval(axis_codes[Z_AXIS], 10); const uint8_t zval = parser.byteval(axis_codes[Z_AXIS], 10);
#if M91x_USE_Z #if M91x_USE_Z
@ -127,22 +126,23 @@ void GcodeSuite::M912() {
#endif #endif
#endif #endif
const uint8_t eval = parser.byteval(axis_codes[E_AXIS], 10); #if M91x_USE_E0 || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4)
const uint8_t eval = parser.byteval(axis_codes[E_AXIS], 10);
#if M91x_USE_E0 #if M91x_USE_E0
if (hasNone || eval == 0 || (hasE && eval == 10)) tmc_clear_otpw(stepperE0, TMC_E0); if (hasNone || eval == 0 || (hasE && eval == 10)) tmc_clear_otpw(stepperE0, TMC_E0);
#endif #endif
#if E_STEPPERS > 1 && M91x_USE(E1) #if M91x_USE_E(1)
if (hasNone || eval == 1 || (hasE && eval == 10)) tmc_clear_otpw(stepperE1, TMC_E1); if (hasNone || eval == 1 || (hasE && eval == 10)) tmc_clear_otpw(stepperE1, TMC_E1);
#endif #endif
#if E_STEPPERS > 2 && M91x_USE(E2) #if M91x_USE_E(2)
if (hasNone || eval == 2 || (hasE && eval == 10)) tmc_clear_otpw(stepperE2, TMC_E2); if (hasNone || eval == 2 || (hasE && eval == 10)) tmc_clear_otpw(stepperE2, TMC_E2);
#endif #endif
#if E_STEPPERS > 3 && M91x_USE(E3) #if M91x_USE_E(3)
if (hasNone || eval == 3 || (hasE && eval == 10)) tmc_clear_otpw(stepperE3, TMC_E3); if (hasNone || eval == 3 || (hasE && eval == 10)) tmc_clear_otpw(stepperE3, TMC_E3);
#endif #endif
#if E_STEPPERS > 4 && M91x_USE(E4) #if M91x_USE_E(4)
if (hasNone || eval == 4 || (hasE && eval == 10)) tmc_clear_otpw(stepperE4, TMC_E4); if (hasNone || eval == 4 || (hasE && eval == 10)) tmc_clear_otpw(stepperE4, TMC_E4);
#endif
#endif #endif
} }

View File

@ -1009,6 +1009,8 @@ float Temperature::analog2temp(const int raw, const uint8_t e) {
const short(*tt)[][2] = (short(*)[][2])(heater_ttbl_map[e]); const short(*tt)[][2] = (short(*)[][2])(heater_ttbl_map[e]);
SCAN_THERMISTOR_TABLE((*tt), heater_ttbllen_map[e]); SCAN_THERMISTOR_TABLE((*tt), heater_ttbllen_map[e]);
#endif #endif
return 0;
} }
#if HAS_HEATED_BED #if HAS_HEATED_BED