Merge pull request #970 from mkbel/fix_compiler_warnings
Fix compiler warnings
This commit is contained in:
commit
9b4f786325
|
|
@ -475,8 +475,6 @@ uint16_t print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; //estimated re
|
||||||
const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'};
|
const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'};
|
||||||
float destination[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0};
|
float destination[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0};
|
||||||
|
|
||||||
static float delta[3] = {0.0, 0.0, 0.0};
|
|
||||||
|
|
||||||
// For tracing an arc
|
// For tracing an arc
|
||||||
static float offset[3] = {0.0, 0.0, 0.0};
|
static float offset[3] = {0.0, 0.0, 0.0};
|
||||||
static float feedrate = 1500.0, next_feedrate, saved_feedrate;
|
static float feedrate = 1500.0, next_feedrate, saved_feedrate;
|
||||||
|
|
@ -1778,9 +1776,9 @@ void trace();
|
||||||
char chunk[CHUNK_SIZE+SAFETY_MARGIN];
|
char chunk[CHUNK_SIZE+SAFETY_MARGIN];
|
||||||
int chunkHead = 0;
|
int chunkHead = 0;
|
||||||
|
|
||||||
int serial_read_stream() {
|
void serial_read_stream() {
|
||||||
|
|
||||||
setTargetHotend(0, 0);
|
setAllTargetHotends(0);
|
||||||
setTargetBed(0);
|
setTargetBed(0);
|
||||||
|
|
||||||
lcd_clear();
|
lcd_clear();
|
||||||
|
|
@ -1839,9 +1837,7 @@ int serial_read_stream() {
|
||||||
card.closefile();
|
card.closefile();
|
||||||
prusa_sd_card_upload = false;
|
prusa_sd_card_upload = false;
|
||||||
SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED);
|
SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2876,9 +2872,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
|
||||||
if (!onlyZ)
|
if (!onlyZ)
|
||||||
{
|
{
|
||||||
setTargetBed(0);
|
setTargetBed(0);
|
||||||
setTargetHotend(0, 0);
|
setAllTargetHotends(0);
|
||||||
setTargetHotend(0, 1);
|
|
||||||
setTargetHotend(0, 2);
|
|
||||||
adjust_bed_reset(); //reset bed level correction
|
adjust_bed_reset(); //reset bed level correction
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5264,7 +5258,10 @@ Sigma_Exit:
|
||||||
if(setTargetedHotend(104)){
|
if(setTargetedHotend(104)){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder);
|
if (code_seen('S'))
|
||||||
|
{
|
||||||
|
setTargetHotendSafe(code_value(), tmp_extruder);
|
||||||
|
}
|
||||||
setWatch();
|
setWatch();
|
||||||
break;
|
break;
|
||||||
case 112: // M112 -Emergency Stop
|
case 112: // M112 -Emergency Stop
|
||||||
|
|
@ -5377,10 +5374,10 @@ Sigma_Exit:
|
||||||
autotemp_enabled=false;
|
autotemp_enabled=false;
|
||||||
#endif
|
#endif
|
||||||
if (code_seen('S')) {
|
if (code_seen('S')) {
|
||||||
setTargetHotend(code_value(), tmp_extruder);
|
setTargetHotendSafe(code_value(), tmp_extruder);
|
||||||
CooldownNoWait = true;
|
CooldownNoWait = true;
|
||||||
} else if (code_seen('R')) {
|
} else if (code_seen('R')) {
|
||||||
setTargetHotend(code_value(), tmp_extruder);
|
setTargetHotendSafe(code_value(), tmp_extruder);
|
||||||
CooldownNoWait = false;
|
CooldownNoWait = false;
|
||||||
}
|
}
|
||||||
#ifdef AUTOTEMP
|
#ifdef AUTOTEMP
|
||||||
|
|
@ -6368,9 +6365,7 @@ bFirst=false;
|
||||||
if (millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) {
|
if (millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) {
|
||||||
lcd_display_message_fullscreen_P(_i("Press knob to preheat nozzle and continue."));////MSG_PRESS_TO_PREHEAT c=20 r=4
|
lcd_display_message_fullscreen_P(_i("Press knob to preheat nozzle and continue."));////MSG_PRESS_TO_PREHEAT c=20 r=4
|
||||||
wait_for_user_state = 1;
|
wait_for_user_state = 1;
|
||||||
setTargetHotend(0, 0);
|
setAllTargetHotends(0);
|
||||||
setTargetHotend(0, 1);
|
|
||||||
setTargetHotend(0, 2);
|
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
disable_e0();
|
disable_e0();
|
||||||
disable_e1();
|
disable_e1();
|
||||||
|
|
@ -7510,7 +7505,7 @@ static void handleSafetyTimer()
|
||||||
else if (safetyTimer.expired(safetytimer_inactive_time))
|
else if (safetyTimer.expired(safetytimer_inactive_time))
|
||||||
{
|
{
|
||||||
setTargetBed(0);
|
setTargetBed(0);
|
||||||
setTargetHotend(0, 0);
|
setAllTargetHotends(0);
|
||||||
lcd_show_fullscreen_message_and_wait_P(_i("Heating disabled by safety timer."));////MSG_BED_HEATING_SAFETY_DISABLED c=0 r=0
|
lcd_show_fullscreen_message_and_wait_P(_i("Heating disabled by safety timer."));////MSG_BED_HEATING_SAFETY_DISABLED c=0 r=0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -8315,9 +8310,7 @@ void long_pause() //long pause print
|
||||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 15, active_extruder);
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 15, active_extruder);
|
||||||
|
|
||||||
//set nozzle target temperature to 0
|
//set nozzle target temperature to 0
|
||||||
setTargetHotend(0, 0);
|
setAllTargetHotends(0);
|
||||||
setTargetHotend(0, 1);
|
|
||||||
setTargetHotend(0, 2);
|
|
||||||
|
|
||||||
//Move XY to side
|
//Move XY to side
|
||||||
current_position[X_AXIS] = X_PAUSE_POS;
|
current_position[X_AXIS] = X_PAUSE_POS;
|
||||||
|
|
@ -8832,7 +8825,9 @@ enquecommand_P(PSTR("G4 S0"));
|
||||||
void stop_and_save_print_to_ram(float z_move, float e_move)
|
void stop_and_save_print_to_ram(float z_move, float e_move)
|
||||||
{
|
{
|
||||||
if (saved_printing) return;
|
if (saved_printing) return;
|
||||||
|
#if 0
|
||||||
unsigned char nplanner_blocks;
|
unsigned char nplanner_blocks;
|
||||||
|
#endif
|
||||||
unsigned char nlines;
|
unsigned char nlines;
|
||||||
uint16_t sdlen_planner;
|
uint16_t sdlen_planner;
|
||||||
uint16_t sdlen_cmdqueue;
|
uint16_t sdlen_cmdqueue;
|
||||||
|
|
@ -8840,7 +8835,9 @@ void stop_and_save_print_to_ram(float z_move, float e_move)
|
||||||
|
|
||||||
cli();
|
cli();
|
||||||
if (card.sdprinting) {
|
if (card.sdprinting) {
|
||||||
|
#if 0
|
||||||
nplanner_blocks = number_of_blocks();
|
nplanner_blocks = number_of_blocks();
|
||||||
|
#endif
|
||||||
saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue
|
saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue
|
||||||
sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner
|
sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner
|
||||||
saved_sdpos -= sdlen_planner;
|
saved_sdpos -= sdlen_planner;
|
||||||
|
|
|
||||||
|
|
@ -46,13 +46,10 @@ int SdFatUtil::FreeRam() {
|
||||||
|
|
||||||
void SdFatUtil::set_stack_guard()
|
void SdFatUtil::set_stack_guard()
|
||||||
{
|
{
|
||||||
char i = 0;
|
|
||||||
uint32_t *stack_guard;
|
uint32_t *stack_guard;
|
||||||
|
|
||||||
stack_guard = (uint32_t*)&__bss_end;
|
stack_guard = (uint32_t*)&__bss_end;
|
||||||
//for (i = 0; i < 10; i++) {
|
*stack_guard = STACK_GUARD_TEST_VALUE;
|
||||||
*stack_guard = STACK_GUARD_TEST_VALUE;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SdFatUtil::test_stack_integrity()
|
bool SdFatUtil::test_stack_integrity()
|
||||||
|
|
@ -63,12 +60,9 @@ bool SdFatUtil::test_stack_integrity()
|
||||||
|
|
||||||
uint32_t SdFatUtil::get_stack_guard_test_value()
|
uint32_t SdFatUtil::get_stack_guard_test_value()
|
||||||
{
|
{
|
||||||
//static char i = 0;
|
|
||||||
uint32_t* stack_guard;
|
uint32_t* stack_guard;
|
||||||
uint32_t output;
|
uint32_t output;
|
||||||
stack_guard = (uint32_t*)&__bss_end;
|
stack_guard = (uint32_t*)&__bss_end;
|
||||||
//output = *(stack_guard + i);
|
|
||||||
//i++;
|
|
||||||
output = *stack_guard;
|
output = *stack_guard;
|
||||||
return(output);
|
return(output);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -702,11 +702,12 @@ void CardReader::updir()
|
||||||
{
|
{
|
||||||
--workDirDepth;
|
--workDirDepth;
|
||||||
workDir = workDirParents[0];
|
workDir = workDirParents[0];
|
||||||
int d;
|
for (unsigned int d = 0; d < workDirDepth; d++)
|
||||||
for (int d = 0; d < workDirDepth; d++)
|
{
|
||||||
workDirParents[d] = workDirParents[d+1];
|
workDirParents[d] = workDirParents[d+1];
|
||||||
|
}
|
||||||
#ifdef SDCARD_SORT_ALPHA
|
#ifdef SDCARD_SORT_ALPHA
|
||||||
presort();
|
presort();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1373,8 +1373,7 @@ void temp_runaway_stop(bool isPreheat, bool isBed)
|
||||||
|
|
||||||
void disable_heater()
|
void disable_heater()
|
||||||
{
|
{
|
||||||
for(int i=0;i<EXTRUDERS;i++)
|
setAllTargetHotends(0);
|
||||||
setTargetHotend(0,i);
|
|
||||||
setTargetBed(0);
|
setTargetBed(0);
|
||||||
#if defined(TEMP_0_PIN) && TEMP_0_PIN > -1
|
#if defined(TEMP_0_PIN) && TEMP_0_PIN > -1
|
||||||
target_temperature[0]=0;
|
target_temperature[0]=0;
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,16 @@ FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder) {
|
||||||
target_temperature[extruder] = celsius;
|
target_temperature[extruder] = celsius;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static inline void setTargetHotendSafe(const float &celsius, uint8_t extruder)
|
||||||
|
{
|
||||||
|
if (extruder<EXTRUDERS) target_temperature[extruder] = celsius;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void setAllTargetHotends(const float &celsius)
|
||||||
|
{
|
||||||
|
for(int i=0;i<EXTRUDERS;i++) setTargetHotend(celsius,i);
|
||||||
|
}
|
||||||
|
|
||||||
FORCE_INLINE void setTargetBed(const float &celsius) {
|
FORCE_INLINE void setTargetBed(const float &celsius) {
|
||||||
target_temperature_bed = celsius;
|
target_temperature_bed = celsius;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -668,16 +668,6 @@ uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval)
|
||||||
return stat;
|
return stat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void tmc2130_eeprom_load_config()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void tmc2130_eeprom_save_config()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#define _GET_PWR_X (READ(X_ENABLE_PIN) == X_ENABLE_ON)
|
#define _GET_PWR_X (READ(X_ENABLE_PIN) == X_ENABLE_ON)
|
||||||
#define _GET_PWR_Y (READ(Y_ENABLE_PIN) == Y_ENABLE_ON)
|
#define _GET_PWR_Y (READ(Y_ENABLE_PIN) == Y_ENABLE_ON)
|
||||||
#define _GET_PWR_Z (READ(Z_ENABLE_PIN) == Z_ENABLE_ON)
|
#define _GET_PWR_Z (READ(Z_ENABLE_PIN) == Z_ENABLE_ON)
|
||||||
|
|
|
||||||
|
|
@ -91,38 +91,6 @@ extern uint8_t tmc2130_usteps2mres(uint16_t usteps);
|
||||||
|
|
||||||
extern bool tmc2130_wait_standstill_xy(int timeout);
|
extern bool tmc2130_wait_standstill_xy(int timeout);
|
||||||
|
|
||||||
extern void tmc2130_eeprom_load_config();
|
|
||||||
extern void tmc2130_eeprom_save_config();
|
|
||||||
|
|
||||||
|
|
||||||
#pragma pack(push)
|
|
||||||
#pragma pack(1)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
uint8_t mres:5; // mres - byte 0, bit 0..4 microstep resolution
|
|
||||||
uint8_t reserved_0_0:2; // reserved - byte 0, bit 5..6
|
|
||||||
uint8_t intpol:1; // intpol - byte 0, bit 7 linear interpolation to 255 usteps
|
|
||||||
uint8_t pwm_ampl:8; // pwm_ampl - byte 1, bit 0..7 pwm amplitude for silent mode
|
|
||||||
uint8_t pwm_grad:4; // pwm_grad - byte 2, bit 0..3 pwm gradient for silent mode
|
|
||||||
uint8_t pwm_freq:2; // pwm_freq - byte 2, bit 4..5 pwm frequency for silent mode
|
|
||||||
uint8_t reserved_2_0:2; // reserved - byte 2, bit 6..7
|
|
||||||
uint16_t tcoolthrs:16; // tcoolthrs - byte 3..4 coolstep threshold / middle sensitivity
|
|
||||||
int8_t sg_thrs:8; // sg_thrs - byte 5, bit 0..7 stallguard sensitivity in high power / middle sensitivity
|
|
||||||
int8_t current_h:6; // current_h - byte 6, bit 0..5 holding current for high power mode
|
|
||||||
uint8_t reserved_6_0:2; // reserved - byte 6, bit 6..7
|
|
||||||
int8_t current_r:6; // current_r - byte 7, bit 0..5 running current for high power mode
|
|
||||||
uint8_t reserved_7_0:2; // reserved - byte 7, bit 6..7
|
|
||||||
int8_t home_sg_thrs:8; // sg_thrs - byte 8, bit 0..7 stallguard sensitivity for homing
|
|
||||||
int8_t home_current:6; // current_r - byte 9, bit 0..5 running current for homing
|
|
||||||
uint8_t reserved_9_0:2; // reserved - byte 9, bit 6..7
|
|
||||||
int8_t home_dtcoolthrs:8; // dtcoolthrs - byte 10, bit 0..7 delta tcoolthrs for homing
|
|
||||||
int8_t dtcoolthrs_low:8; // dtcoolthrs - byte 11, bit 0..7 delta tcoolthrs for low sensitivity (based on value for middle sensitivity)
|
|
||||||
int8_t dtcoolthrs_high:8; // dtcoolthrs - byte 12, bit 0..7 delta tcoolthrs for high sensitivity (based on value for middle sensitivity)
|
|
||||||
int8_t sg_thrs_low:8; // sg_thrs - byte 13, bit 0..7 stallguard sensitivity in high power / low sensitivity
|
|
||||||
int8_t sg_thrs_high:8; // sg_thrs - byte 14, bit 0..7 stallguard sensitivity in high power / high sensitivity
|
|
||||||
} tmc2130_axis_config;
|
|
||||||
#pragma pack(pop)
|
|
||||||
|
|
||||||
extern uint16_t tmc2130_get_res(uint8_t axis);
|
extern uint16_t tmc2130_get_res(uint8_t axis);
|
||||||
extern void tmc2130_set_res(uint8_t axis, uint16_t res);
|
extern void tmc2130_set_res(uint8_t axis, uint16_t res);
|
||||||
extern uint8_t tmc2130_get_pwr(uint8_t axis);
|
extern uint8_t tmc2130_get_pwr(uint8_t axis);
|
||||||
|
|
|
||||||
|
|
@ -852,7 +852,7 @@ if (print_sd_status)
|
||||||
lcd_set_cursor(7, 3);
|
lcd_set_cursor(7, 3);
|
||||||
lcd_puts_P(PSTR(" "));
|
lcd_puts_P(PSTR(" "));
|
||||||
|
|
||||||
for (int dots = 0; dots < heating_status_counter; dots++)
|
for (unsigned int dots = 0; dots < heating_status_counter; dots++)
|
||||||
{
|
{
|
||||||
lcd_set_cursor(7 + dots, 3);
|
lcd_set_cursor(7 + dots, 3);
|
||||||
lcd_print('.');
|
lcd_print('.');
|
||||||
|
|
@ -1804,9 +1804,7 @@ void lcd_commands()
|
||||||
cancel_heatup = true;
|
cancel_heatup = true;
|
||||||
setTargetBed(0);
|
setTargetBed(0);
|
||||||
#if !(defined (SNMM) || defined (SNMM_V2))
|
#if !(defined (SNMM) || defined (SNMM_V2))
|
||||||
setTargetHotend(0, 0); //heating when changing filament for multicolor
|
setAllTargetHotends(0);
|
||||||
setTargetHotend(0, 1);
|
|
||||||
setTargetHotend(0, 2);
|
|
||||||
#endif
|
#endif
|
||||||
manage_heater();
|
manage_heater();
|
||||||
custom_message = true;
|
custom_message = true;
|
||||||
|
|
@ -2036,9 +2034,7 @@ void lcd_preheat_flex()
|
||||||
|
|
||||||
void lcd_cooldown()
|
void lcd_cooldown()
|
||||||
{
|
{
|
||||||
setTargetHotend0(0);
|
setAllTargetHotends(0);
|
||||||
setTargetHotend1(0);
|
|
||||||
setTargetHotend2(0);
|
|
||||||
setTargetBed(0);
|
setTargetBed(0);
|
||||||
fanSpeed = 0;
|
fanSpeed = 0;
|
||||||
lcd_return_to_status();
|
lcd_return_to_status();
|
||||||
|
|
@ -3126,7 +3122,7 @@ void lcd_adjust_z() {
|
||||||
|
|
||||||
bool lcd_wait_for_pinda(float temp) {
|
bool lcd_wait_for_pinda(float temp) {
|
||||||
lcd_set_custom_characters_degree();
|
lcd_set_custom_characters_degree();
|
||||||
setTargetHotend(0, 0);
|
setAllTargetHotends(0);
|
||||||
setTargetBed(0);
|
setTargetBed(0);
|
||||||
LongTimer pinda_timeout;
|
LongTimer pinda_timeout;
|
||||||
pinda_timeout.start();
|
pinda_timeout.start();
|
||||||
|
|
@ -3166,7 +3162,7 @@ void lcd_wait_for_heater() {
|
||||||
|
|
||||||
void lcd_wait_for_cool_down() {
|
void lcd_wait_for_cool_down() {
|
||||||
lcd_set_custom_characters_degree();
|
lcd_set_custom_characters_degree();
|
||||||
setTargetHotend(0,0);
|
setAllTargetHotends(0);
|
||||||
setTargetBed(0);
|
setTargetBed(0);
|
||||||
while ((degHotend(0)>MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) {
|
while ((degHotend(0)>MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) {
|
||||||
lcd_display_message_fullscreen_P(_i("Waiting for nozzle and bed cooling"));////MSG_WAITING_TEMP c=20 r=3
|
lcd_display_message_fullscreen_P(_i("Waiting for nozzle and bed cooling"));////MSG_WAITING_TEMP c=20 r=3
|
||||||
|
|
@ -6712,7 +6708,7 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
|
||||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
#ifdef TMC2130
|
#ifdef TMC2130
|
||||||
if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1))
|
if (((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1))
|
||||||
#else //TMC2130
|
#else //TMC2130
|
||||||
if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
|
if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
|
||||||
((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ||
|
((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ||
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue