mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-27 13:56:24 +00:00
parent
cba5692673
commit
e08f8eed05
@ -229,6 +229,7 @@ void refresh_cmd_timeout(void);
|
||||
extern float homing_feedrate[];
|
||||
extern bool axis_relative_modes[];
|
||||
extern int feedmultiply;
|
||||
extern int extrudemultiply; // Sets extrude multiply factor (in percent) for all extruders
|
||||
extern bool volumetric_enabled;
|
||||
extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
|
||||
extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -369,7 +369,7 @@ static void lcd_implementation_status_screen() {
|
||||
lcd_printPGM(PSTR("dia:"));
|
||||
lcd_print(ftostr12ns(filament_width_meas));
|
||||
lcd_printPGM(PSTR(" factor:"));
|
||||
lcd_print(itostr3(volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
|
||||
lcd_print(itostr3(extrudemultiply));
|
||||
lcd_print('%');
|
||||
}
|
||||
#endif
|
||||
|
@ -545,7 +545,7 @@ float junction_deviation = 0.1;
|
||||
block->steps[Z_AXIS] = labs(dz);
|
||||
block->steps[E_AXIS] = labs(de);
|
||||
block->steps[E_AXIS] *= volumetric_multiplier[active_extruder];
|
||||
block->steps[E_AXIS] *= extruder_multiply[active_extruder];
|
||||
block->steps[E_AXIS] *= extrudemultiply;
|
||||
block->steps[E_AXIS] /= 100;
|
||||
block->step_event_count = max(block->steps[X_AXIS], max(block->steps[Y_AXIS], max(block->steps[Z_AXIS], block->steps[E_AXIS])));
|
||||
|
||||
@ -679,7 +679,7 @@ float junction_deviation = 0.1;
|
||||
delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];
|
||||
#endif
|
||||
delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
|
||||
delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[active_extruder] * extruder_multiply[active_extruder] / 100.0;
|
||||
delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[active_extruder] * extrudemultiply / 100.0;
|
||||
|
||||
if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) {
|
||||
block->millimeters = fabs(delta_mm[E_AXIS]);
|
||||
|
@ -515,36 +515,31 @@ ISR(TIMER1_COMPA_vect) {
|
||||
}
|
||||
|
||||
if (TEST(out_bits, Z_AXIS)) { // -direction
|
||||
|
||||
Z_APPLY_DIR(INVERT_Z_DIR,0);
|
||||
count_direction[Z_AXIS] = -1;
|
||||
|
||||
if (check_endstops) {
|
||||
|
||||
#if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0
|
||||
|
||||
#ifdef Z_DUAL_ENDSTOPS
|
||||
|
||||
bool z_min_endstop = READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING,
|
||||
z2_min_endstop =
|
||||
#if defined(Z2_MIN_PIN) && Z2_MIN_PIN >= 0
|
||||
READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING
|
||||
#else
|
||||
z_min_endstop
|
||||
#endif
|
||||
;
|
||||
|
||||
bool z_min_both = z_min_endstop && old_z_min_endstop,
|
||||
z2_min_both = z2_min_endstop && old_z2_min_endstop;
|
||||
if ((z_min_both || z2_min_both) && current_block->steps[Z_AXIS] > 0) {
|
||||
if (check_endstops)
|
||||
{
|
||||
#if defined(Z_MIN_PIN) && Z_MIN_PIN > -1
|
||||
#ifndef Z_DUAL_ENDSTOPS
|
||||
UPDATE_ENDSTOP(z, Z, min, MIN);
|
||||
#else
|
||||
bool z_min_endstop=(READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
|
||||
#if defined(Z2_MIN_PIN) && Z2_MIN_PIN > -1
|
||||
bool z2_min_endstop=(READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING);
|
||||
#else
|
||||
bool z2_min_endstop=z_min_endstop;
|
||||
#endif
|
||||
if(((z_min_endstop && old_z_min_endstop) || (z2_min_endstop && old_z2_min_endstop)) && (current_block->steps[Z_AXIS] > 0))
|
||||
{
|
||||
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
|
||||
endstop_z_hit = true;
|
||||
if (!performing_homing || (performing_homing && z_min_both && z2_min_both)) //if not performing home or if both endstops were trigged during homing...
|
||||
endstop_z_hit=true;
|
||||
if (!(performing_homing) || ((performing_homing)&&(z_min_endstop && old_z_min_endstop)&&(z2_min_endstop && old_z2_min_endstop))) //if not performing home or if both endstops were trigged during homing...
|
||||
{
|
||||
step_events_completed = current_block->step_event_count;
|
||||
}
|
||||
}
|
||||
old_z_min_endstop = z_min_endstop;
|
||||
old_z2_min_endstop = z2_min_endstop;
|
||||
<<<<<<< HEAD
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -561,55 +556,37 @@ ISR(TIMER1_COMPA_vect) {
|
||||
old_z_probe_endstop = z_probe_endstop;
|
||||
#endif
|
||||
}
|
||||
=======
|
||||
|
||||
#else // !Z_DUAL_ENDSTOPS
|
||||
|
||||
UPDATE_ENDSTOP(z, Z, min, MIN);
|
||||
|
||||
#endif // !Z_DUAL_ENDSTOPS
|
||||
|
||||
#endif // Z_MIN_PIN
|
||||
|
||||
} // check_endstops
|
||||
|
||||
>>>>>>> MarlinFirmware/Development
|
||||
}
|
||||
else { // +direction
|
||||
|
||||
Z_APPLY_DIR(!INVERT_Z_DIR,0);
|
||||
count_direction[Z_AXIS] = 1;
|
||||
|
||||
if (check_endstops) {
|
||||
|
||||
#if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0
|
||||
|
||||
#ifdef Z_DUAL_ENDSTOPS
|
||||
|
||||
bool z_max_endstop = READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING,
|
||||
z2_max_endstop =
|
||||
#if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0
|
||||
READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING
|
||||
#else
|
||||
z_max_endstop
|
||||
#endif
|
||||
;
|
||||
|
||||
bool z_max_both = z_max_endstop && old_z_max_endstop,
|
||||
z2_max_both = z2_max_endstop && old_z2_max_endstop;
|
||||
if ((z_max_both || z2_max_both) && current_block->steps[Z_AXIS] > 0) {
|
||||
#ifndef Z_DUAL_ENDSTOPS
|
||||
UPDATE_ENDSTOP(z, Z, max, MAX);
|
||||
#else
|
||||
bool z_max_endstop=(READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING);
|
||||
#if defined(Z2_MAX_PIN) && Z2_MAX_PIN > -1
|
||||
bool z2_max_endstop=(READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING);
|
||||
#else
|
||||
bool z2_max_endstop=z_max_endstop;
|
||||
#endif
|
||||
if(((z_max_endstop && old_z_max_endstop) || (z2_max_endstop && old_z2_max_endstop)) && (current_block->steps[Z_AXIS] > 0))
|
||||
{
|
||||
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
|
||||
endstop_z_hit = true;
|
||||
endstop_z_hit=true;
|
||||
|
||||
// if (z_max_both) SERIAL_ECHOLN("z_max_endstop = true");
|
||||
// if (z2_max_both) SERIAL_ECHOLN("z2_max_endstop = true");
|
||||
// if (z_max_endstop && old_z_max_endstop) SERIAL_ECHOLN("z_max_endstop = true");
|
||||
// if (z2_max_endstop && old_z2_max_endstop) SERIAL_ECHOLN("z2_max_endstop = true");
|
||||
|
||||
if (!performing_homing || (performing_homing && z_max_both && z2_max_both)) //if not performing home or if both endstops were trigged during homing...
|
||||
|
||||
if (!(performing_homing) || ((performing_homing)&&(z_max_endstop && old_z_max_endstop)&&(z2_max_endstop && old_z2_max_endstop))) //if not performing home or if both endstops were trigged during homing...
|
||||
{
|
||||
step_events_completed = current_block->step_event_count;
|
||||
}
|
||||
}
|
||||
old_z_max_endstop = z_max_endstop;
|
||||
old_z2_max_endstop = z2_max_endstop;
|
||||
<<<<<<< HEAD
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -626,34 +603,20 @@ ISR(TIMER1_COMPA_vect) {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
=======
|
||||
|
||||
#else // !Z_DUAL_ENDSTOPS
|
||||
|
||||
UPDATE_ENDSTOP(z, Z, max, MAX);
|
||||
|
||||
#endif // !Z_DUAL_ENDSTOPS
|
||||
|
||||
#endif // Z_MAX_PIN
|
||||
|
||||
} // check_endstops
|
||||
|
||||
} // +direction
|
||||
>>>>>>> MarlinFirmware/Development
|
||||
|
||||
#ifndef ADVANCE
|
||||
if (TEST(out_bits, E_AXIS)) { // -direction
|
||||
REV_E_DIR();
|
||||
count_direction[E_AXIS] = -1;
|
||||
count_direction[E_AXIS]=-1;
|
||||
}
|
||||
else { // +direction
|
||||
NORM_E_DIR();
|
||||
count_direction[E_AXIS] = 1;
|
||||
count_direction[E_AXIS]=1;
|
||||
}
|
||||
#endif //!ADVANCE
|
||||
|
||||
// Take multiple steps per interrupt (For high speed moves)
|
||||
for (int8_t i = 0; i < step_loops; i++) {
|
||||
for (int8_t i=0; i < step_loops; i++) {
|
||||
#ifndef AT90USB
|
||||
MSerial.checkRx(); // Check for serial chars.
|
||||
#endif
|
||||
|
@ -485,7 +485,7 @@ static void lcd_tune_menu() {
|
||||
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
|
||||
#endif
|
||||
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
|
||||
MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiply[active_extruder], 10, 999);
|
||||
MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999);
|
||||
MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F0, &extruder_multiply[0], 10, 999);
|
||||
#if TEMP_SENSOR_1 != 0
|
||||
MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F1, &extruder_multiply[1], 10, 999);
|
||||
|
@ -624,7 +624,7 @@ static void lcd_implementation_status_screen()
|
||||
|
||||
static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char post_char) {
|
||||
char c;
|
||||
uint8_t n = LCD_WIDTH - 2;
|
||||
uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2);
|
||||
lcd.setCursor(0, row);
|
||||
lcd.print(sel ? pre_char : ' ');
|
||||
while ((c = pgm_read_byte(pstr)) && n > 0) {
|
||||
@ -633,11 +633,12 @@ static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const cha
|
||||
}
|
||||
while(n--) lcd.print(' ');
|
||||
lcd.print(post_char);
|
||||
lcd.print(' ');
|
||||
}
|
||||
|
||||
static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char* data) {
|
||||
char c;
|
||||
uint8_t n = LCD_WIDTH - 2 - lcd_strlen(data);
|
||||
uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2) - lcd_strlen(data);
|
||||
lcd.setCursor(0, row);
|
||||
lcd.print(sel ? pre_char : ' ');
|
||||
while ((c = pgm_read_byte(pstr)) && n > 0) {
|
||||
@ -650,7 +651,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t r
|
||||
}
|
||||
static void lcd_implementation_drawmenu_setting_edit_generic_P(bool sel, uint8_t row, const char* pstr, char pre_char, const char* data) {
|
||||
char c;
|
||||
uint8_t n = LCD_WIDTH - 2 - lcd_strlen_P(data);
|
||||
uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2) - lcd_strlen_P(data);
|
||||
lcd.setCursor(0, row);
|
||||
lcd.print(sel ? pre_char : ' ');
|
||||
while ((c = pgm_read_byte(pstr)) && n > 0) {
|
||||
@ -687,11 +688,11 @@ void lcd_implementation_drawedit(const char* pstr, char* value) {
|
||||
lcd.setCursor(1, 1);
|
||||
lcd_printPGM(pstr);
|
||||
lcd.print(':');
|
||||
lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1);
|
||||
lcd.setCursor(LCD_WIDTH - (LCD_WIDTH < 20 ? 0 : 1) - lcd_strlen(value), 1);
|
||||
lcd_print(value);
|
||||
}
|
||||
|
||||
static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename, uint8_t concat, char post_char) {
|
||||
static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename, uint8_t concat) {
|
||||
char c;
|
||||
uint8_t n = LCD_WIDTH - concat;
|
||||
lcd.setCursor(0, row);
|
||||
@ -705,15 +706,14 @@ static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* ps
|
||||
filename++;
|
||||
}
|
||||
while (n--) lcd.print(' ');
|
||||
lcd.print(post_char);
|
||||
}
|
||||
|
||||
static void lcd_implementation_drawmenu_sdfile(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) {
|
||||
lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, ' ');
|
||||
lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 1);
|
||||
}
|
||||
|
||||
static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) {
|
||||
lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, LCD_STR_FOLDER[0]);
|
||||
lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2);
|
||||
}
|
||||
|
||||
#define lcd_implementation_drawmenu_back(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
|
||||
|
Loading…
Reference in New Issue
Block a user