Browse Source

Merge remote-tracking branch 'MarlinFirmware/Development' into Development

Conflicts:
	Marlin/Marlin_main.cpp
	Marlin/stepper.cpp
Chris Roadfeldt 9 years ago
parent
commit
cba5692673

+ 0
- 1
Marlin/Marlin.h View File

229
 extern float homing_feedrate[];
229
 extern float homing_feedrate[];
230
 extern bool axis_relative_modes[];
230
 extern bool axis_relative_modes[];
231
 extern int feedmultiply;
231
 extern int feedmultiply;
232
-extern int extrudemultiply; // Sets extrude multiply factor (in percent) for all extruders
233
 extern bool volumetric_enabled;
232
 extern bool volumetric_enabled;
234
 extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
233
 extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
235
 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.
234
 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.

+ 513
- 358
Marlin/Marlin_main.cpp
File diff suppressed because it is too large
View File


+ 1
- 1
Marlin/dogm_lcd_implementation.h View File

369
       lcd_printPGM(PSTR("dia:"));
369
       lcd_printPGM(PSTR("dia:"));
370
       lcd_print(ftostr12ns(filament_width_meas));
370
       lcd_print(ftostr12ns(filament_width_meas));
371
       lcd_printPGM(PSTR(" factor:"));
371
       lcd_printPGM(PSTR(" factor:"));
372
-      lcd_print(itostr3(extrudemultiply));
372
+      lcd_print(itostr3(volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
373
       lcd_print('%');
373
       lcd_print('%');
374
     }
374
     }
375
   #endif
375
   #endif

+ 2
- 2
Marlin/planner.cpp View File

545
   block->steps[Z_AXIS] = labs(dz);
545
   block->steps[Z_AXIS] = labs(dz);
546
   block->steps[E_AXIS] = labs(de);
546
   block->steps[E_AXIS] = labs(de);
547
   block->steps[E_AXIS] *= volumetric_multiplier[active_extruder];
547
   block->steps[E_AXIS] *= volumetric_multiplier[active_extruder];
548
-  block->steps[E_AXIS] *= extrudemultiply;
548
+  block->steps[E_AXIS] *= extruder_multiply[active_extruder];
549
   block->steps[E_AXIS] /= 100;
549
   block->steps[E_AXIS] /= 100;
550
   block->step_event_count = max(block->steps[X_AXIS], max(block->steps[Y_AXIS], max(block->steps[Z_AXIS], block->steps[E_AXIS])));
550
   block->step_event_count = max(block->steps[X_AXIS], max(block->steps[Y_AXIS], max(block->steps[Z_AXIS], block->steps[E_AXIS])));
551
 
551
 
679
     delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];
679
     delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];
680
   #endif
680
   #endif
681
   delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
681
   delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
682
-  delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[active_extruder] * extrudemultiply / 100.0;
682
+  delta_mm[E_AXIS] = (de / axis_steps_per_unit[E_AXIS]) * volumetric_multiplier[active_extruder] * extruder_multiply[active_extruder] / 100.0;
683
 
683
 
684
   if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) {
684
   if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) {
685
     block->millimeters = fabs(delta_mm[E_AXIS]);
685
     block->millimeters = fabs(delta_mm[E_AXIS]);

+ 76
- 39
Marlin/stepper.cpp View File

515
     }
515
     }
516
 
516
 
517
     if (TEST(out_bits, Z_AXIS)) {   // -direction
517
     if (TEST(out_bits, Z_AXIS)) {   // -direction
518
+
518
       Z_APPLY_DIR(INVERT_Z_DIR,0);
519
       Z_APPLY_DIR(INVERT_Z_DIR,0);
519
       count_direction[Z_AXIS] = -1;
520
       count_direction[Z_AXIS] = -1;
520
-      if (check_endstops) 
521
-      {
522
-        #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1
523
-          #ifndef Z_DUAL_ENDSTOPS
524
-            UPDATE_ENDSTOP(z, Z, min, MIN);
525
-          #else
526
-            bool z_min_endstop=(READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
527
-            #if defined(Z2_MIN_PIN) && Z2_MIN_PIN > -1
528
-              bool z2_min_endstop=(READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING);
529
-            #else
530
-              bool z2_min_endstop=z_min_endstop;
531
-            #endif
532
-            if(((z_min_endstop && old_z_min_endstop) || (z2_min_endstop && old_z2_min_endstop)) && (current_block->steps[Z_AXIS] > 0))
533
-            {
521
+
522
+      if (check_endstops) {
523
+
524
+        #if defined(Z_MIN_PIN) && Z_MIN_PIN >= 0
525
+
526
+          #ifdef Z_DUAL_ENDSTOPS
527
+
528
+            bool z_min_endstop = READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING,
529
+                z2_min_endstop =
530
+                  #if defined(Z2_MIN_PIN) && Z2_MIN_PIN >= 0
531
+                    READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING
532
+                  #else
533
+                    z_min_endstop
534
+                  #endif
535
+                ;
536
+
537
+            bool z_min_both = z_min_endstop && old_z_min_endstop,
538
+                z2_min_both = z2_min_endstop && old_z2_min_endstop;
539
+            if ((z_min_both || z2_min_both) && current_block->steps[Z_AXIS] > 0) {
534
               endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
540
               endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
535
-              endstop_z_hit=true;
536
-              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...
537
-              {
541
+              endstop_z_hit = true;
542
+              if (!performing_homing || (performing_homing && z_min_both && z2_min_both)) //if not performing home or if both endstops were trigged during homing...
538
                 step_events_completed = current_block->step_event_count;
543
                 step_events_completed = current_block->step_event_count;
539
-              } 
540
             }
544
             }
541
             old_z_min_endstop = z_min_endstop;
545
             old_z_min_endstop = z_min_endstop;
542
             old_z2_min_endstop = z2_min_endstop;
546
             old_z2_min_endstop = z2_min_endstop;
547
+<<<<<<< HEAD
543
           #endif
548
           #endif
544
         #endif
549
         #endif
545
 
550
 
556
           old_z_probe_endstop = z_probe_endstop;
561
           old_z_probe_endstop = z_probe_endstop;
557
         #endif
562
         #endif
558
       }
563
       }
564
+=======
565
+
566
+          #else // !Z_DUAL_ENDSTOPS
567
+
568
+            UPDATE_ENDSTOP(z, Z, min, MIN);
569
+
570
+          #endif // !Z_DUAL_ENDSTOPS
571
+
572
+        #endif // Z_MIN_PIN
573
+
574
+      } // check_endstops
575
+
576
+>>>>>>> MarlinFirmware/Development
559
     }
577
     }
560
     else { // +direction
578
     else { // +direction
579
+
561
       Z_APPLY_DIR(!INVERT_Z_DIR,0);
580
       Z_APPLY_DIR(!INVERT_Z_DIR,0);
562
       count_direction[Z_AXIS] = 1;
581
       count_direction[Z_AXIS] = 1;
582
+
563
       if (check_endstops) {
583
       if (check_endstops) {
584
+
564
         #if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0
585
         #if defined(Z_MAX_PIN) && Z_MAX_PIN >= 0
565
-          #ifndef Z_DUAL_ENDSTOPS
566
-            UPDATE_ENDSTOP(z, Z, max, MAX);
567
-          #else
568
-            bool z_max_endstop=(READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING);
569
-            #if defined(Z2_MAX_PIN) && Z2_MAX_PIN > -1
570
-              bool z2_max_endstop=(READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING);
571
-            #else
572
-              bool z2_max_endstop=z_max_endstop;
573
-            #endif
574
-            if(((z_max_endstop && old_z_max_endstop) || (z2_max_endstop && old_z2_max_endstop)) && (current_block->steps[Z_AXIS] > 0))
575
-            {
586
+
587
+          #ifdef Z_DUAL_ENDSTOPS
588
+
589
+            bool z_max_endstop = READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING,
590
+                z2_max_endstop =
591
+                  #if defined(Z2_MAX_PIN) && Z2_MAX_PIN >= 0
592
+                    READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING
593
+                  #else
594
+                    z_max_endstop
595
+                  #endif
596
+                ;
597
+
598
+            bool z_max_both = z_max_endstop && old_z_max_endstop,
599
+                z2_max_both = z2_max_endstop && old_z2_max_endstop;
600
+            if ((z_max_both || z2_max_both) && current_block->steps[Z_AXIS] > 0) {
576
               endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
601
               endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
577
-              endstop_z_hit=true;
602
+              endstop_z_hit = true;
578
 
603
 
579
-//              if (z_max_endstop && old_z_max_endstop) SERIAL_ECHOLN("z_max_endstop = true");
580
-//              if (z2_max_endstop && old_z2_max_endstop) SERIAL_ECHOLN("z2_max_endstop = true");
604
+             // if (z_max_both) SERIAL_ECHOLN("z_max_endstop = true");
605
+             // if (z2_max_both) SERIAL_ECHOLN("z2_max_endstop = true");
581
 
606
 
582
-            
583
-              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...
584
-              {
607
+              if (!performing_homing || (performing_homing && z_max_both && z2_max_both)) //if not performing home or if both endstops were trigged during homing...
585
                 step_events_completed = current_block->step_event_count;
608
                 step_events_completed = current_block->step_event_count;
586
-              } 
587
             }
609
             }
588
             old_z_max_endstop = z_max_endstop;
610
             old_z_max_endstop = z_max_endstop;
589
             old_z2_max_endstop = z2_max_endstop;
611
             old_z2_max_endstop = z2_max_endstop;
612
+<<<<<<< HEAD
590
           #endif
613
           #endif
591
         #endif
614
         #endif
592
 
615
 
603
         #endif
626
         #endif
604
       }
627
       }
605
     }
628
     }
629
+=======
630
+
631
+          #else // !Z_DUAL_ENDSTOPS
632
+
633
+            UPDATE_ENDSTOP(z, Z, max, MAX);
634
+
635
+          #endif // !Z_DUAL_ENDSTOPS
636
+
637
+        #endif // Z_MAX_PIN
638
+
639
+      } // check_endstops
640
+
641
+    } // +direction
642
+>>>>>>> MarlinFirmware/Development
606
 
643
 
607
     #ifndef ADVANCE
644
     #ifndef ADVANCE
608
       if (TEST(out_bits, E_AXIS)) {  // -direction
645
       if (TEST(out_bits, E_AXIS)) {  // -direction
609
         REV_E_DIR();
646
         REV_E_DIR();
610
-        count_direction[E_AXIS]=-1;
647
+        count_direction[E_AXIS] = -1;
611
       }
648
       }
612
       else { // +direction
649
       else { // +direction
613
         NORM_E_DIR();
650
         NORM_E_DIR();
614
-        count_direction[E_AXIS]=1;
651
+        count_direction[E_AXIS] = 1;
615
       }
652
       }
616
     #endif //!ADVANCE
653
     #endif //!ADVANCE
617
 
654
 
618
     // Take multiple steps per interrupt (For high speed moves)
655
     // Take multiple steps per interrupt (For high speed moves)
619
-    for (int8_t i=0; i < step_loops; i++) {
656
+    for (int8_t i = 0; i < step_loops; i++) {
620
       #ifndef AT90USB
657
       #ifndef AT90USB
621
         MSerial.checkRx(); // Check for serial chars.
658
         MSerial.checkRx(); // Check for serial chars.
622
       #endif
659
       #endif

+ 1
- 1
Marlin/ultralcd.cpp View File

485
     MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
485
     MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
486
   #endif
486
   #endif
487
   MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
487
   MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
488
-  MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999);
488
+  MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiply[active_extruder], 10, 999);
489
   MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F0, &extruder_multiply[0], 10, 999);
489
   MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F0, &extruder_multiply[0], 10, 999);
490
   #if TEMP_SENSOR_1 != 0
490
   #if TEMP_SENSOR_1 != 0
491
     MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F1, &extruder_multiply[1], 10, 999);
491
     MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F1, &extruder_multiply[1], 10, 999);

+ 8
- 8
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

624
 
624
 
625
 static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char post_char) {
625
 static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char post_char) {
626
   char c;
626
   char c;
627
-  uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2);
627
+  uint8_t n = LCD_WIDTH - 2;
628
   lcd.setCursor(0, row);
628
   lcd.setCursor(0, row);
629
   lcd.print(sel ? pre_char : ' ');
629
   lcd.print(sel ? pre_char : ' ');
630
   while ((c = pgm_read_byte(pstr)) && n > 0) {
630
   while ((c = pgm_read_byte(pstr)) && n > 0) {
633
   }
633
   }
634
   while(n--) lcd.print(' ');
634
   while(n--) lcd.print(' ');
635
   lcd.print(post_char);
635
   lcd.print(post_char);
636
-  lcd.print(' ');
637
 }
636
 }
638
 
637
 
639
 static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char* data) {
638
 static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char* data) {
640
   char c;
639
   char c;
641
-  uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2) - lcd_strlen(data);
640
+  uint8_t n = LCD_WIDTH - 2 - lcd_strlen(data);
642
   lcd.setCursor(0, row);
641
   lcd.setCursor(0, row);
643
   lcd.print(sel ? pre_char : ' ');
642
   lcd.print(sel ? pre_char : ' ');
644
   while ((c = pgm_read_byte(pstr)) && n > 0) {
643
   while ((c = pgm_read_byte(pstr)) && n > 0) {
651
 }
650
 }
652
 static void lcd_implementation_drawmenu_setting_edit_generic_P(bool sel, uint8_t row, const char* pstr, char pre_char, const char* data) {
651
 static void lcd_implementation_drawmenu_setting_edit_generic_P(bool sel, uint8_t row, const char* pstr, char pre_char, const char* data) {
653
   char c;
652
   char c;
654
-  uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2) - lcd_strlen_P(data);
653
+  uint8_t n = LCD_WIDTH - 2 - lcd_strlen_P(data);
655
   lcd.setCursor(0, row);
654
   lcd.setCursor(0, row);
656
   lcd.print(sel ? pre_char : ' ');
655
   lcd.print(sel ? pre_char : ' ');
657
   while ((c = pgm_read_byte(pstr)) && n > 0) {
656
   while ((c = pgm_read_byte(pstr)) && n > 0) {
688
   lcd.setCursor(1, 1);
687
   lcd.setCursor(1, 1);
689
   lcd_printPGM(pstr);
688
   lcd_printPGM(pstr);
690
   lcd.print(':');
689
   lcd.print(':');
691
-  lcd.setCursor(LCD_WIDTH - (LCD_WIDTH < 20 ? 0 : 1) - lcd_strlen(value), 1);
690
+  lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1);
692
   lcd_print(value);
691
   lcd_print(value);
693
 }
692
 }
694
 
693
 
695
-static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename, uint8_t concat) {
694
+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) {
696
   char c;
695
   char c;
697
   uint8_t n = LCD_WIDTH - concat;
696
   uint8_t n = LCD_WIDTH - concat;
698
   lcd.setCursor(0, row);
697
   lcd.setCursor(0, row);
706
     filename++;
705
     filename++;
707
   }
706
   }
708
   while (n--) lcd.print(' ');
707
   while (n--) lcd.print(' ');
708
+  lcd.print(post_char);
709
 }
709
 }
710
 
710
 
711
 static void lcd_implementation_drawmenu_sdfile(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) {
711
 static void lcd_implementation_drawmenu_sdfile(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) {
712
-  lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 1);
712
+  lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, ' ');
713
 }
713
 }
714
 
714
 
715
 static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) {
715
 static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) {
716
-  lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2);
716
+  lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, LCD_STR_FOLDER[0]);
717
 }
717
 }
718
 
718
 
719
 #define lcd_implementation_drawmenu_back(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
719
 #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…
Cancel
Save