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,7 +229,6 @@ void refresh_cmd_timeout(void);
229 229
 extern float homing_feedrate[];
230 230
 extern bool axis_relative_modes[];
231 231
 extern int feedmultiply;
232
-extern int extrudemultiply; // Sets extrude multiply factor (in percent) for all extruders
233 232
 extern bool volumetric_enabled;
234 233
 extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
235 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,7 +369,7 @@ static void lcd_implementation_status_screen() {
369 369
       lcd_printPGM(PSTR("dia:"));
370 370
       lcd_print(ftostr12ns(filament_width_meas));
371 371
       lcd_printPGM(PSTR(" factor:"));
372
-      lcd_print(itostr3(extrudemultiply));
372
+      lcd_print(itostr3(volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
373 373
       lcd_print('%');
374 374
     }
375 375
   #endif

+ 2
- 2
Marlin/planner.cpp View File

@@ -545,7 +545,7 @@ float junction_deviation = 0.1;
545 545
   block->steps[Z_AXIS] = labs(dz);
546 546
   block->steps[E_AXIS] = labs(de);
547 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 549
   block->steps[E_AXIS] /= 100;
550 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,7 +679,7 @@ float junction_deviation = 0.1;
679 679
     delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];
680 680
   #endif
681 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 684
   if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) {
685 685
     block->millimeters = fabs(delta_mm[E_AXIS]);

+ 76
- 39
Marlin/stepper.cpp View File

@@ -515,31 +515,36 @@ ISR(TIMER1_COMPA_vect) {
515 515
     }
516 516
 
517 517
     if (TEST(out_bits, Z_AXIS)) {   // -direction
518
+
518 519
       Z_APPLY_DIR(INVERT_Z_DIR,0);
519 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 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 543
                 step_events_completed = current_block->step_event_count;
539
-              } 
540 544
             }
541 545
             old_z_min_endstop = z_min_endstop;
542 546
             old_z2_min_endstop = z2_min_endstop;
547
+<<<<<<< HEAD
543 548
           #endif
544 549
         #endif
545 550
 
@@ -556,37 +561,55 @@ ISR(TIMER1_COMPA_vect) {
556 561
           old_z_probe_endstop = z_probe_endstop;
557 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 578
     else { // +direction
579
+
561 580
       Z_APPLY_DIR(!INVERT_Z_DIR,0);
562 581
       count_direction[Z_AXIS] = 1;
582
+
563 583
       if (check_endstops) {
584
+
564 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 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 608
                 step_events_completed = current_block->step_event_count;
586
-              } 
587 609
             }
588 610
             old_z_max_endstop = z_max_endstop;
589 611
             old_z2_max_endstop = z2_max_endstop;
612
+<<<<<<< HEAD
590 613
           #endif
591 614
         #endif
592 615
 
@@ -603,20 +626,34 @@ ISR(TIMER1_COMPA_vect) {
603 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 644
     #ifndef ADVANCE
608 645
       if (TEST(out_bits, E_AXIS)) {  // -direction
609 646
         REV_E_DIR();
610
-        count_direction[E_AXIS]=-1;
647
+        count_direction[E_AXIS] = -1;
611 648
       }
612 649
       else { // +direction
613 650
         NORM_E_DIR();
614
-        count_direction[E_AXIS]=1;
651
+        count_direction[E_AXIS] = 1;
615 652
       }
616 653
     #endif //!ADVANCE
617 654
 
618 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 657
       #ifndef AT90USB
621 658
         MSerial.checkRx(); // Check for serial chars.
622 659
       #endif

+ 1
- 1
Marlin/ultralcd.cpp View File

@@ -485,7 +485,7 @@ static void lcd_tune_menu() {
485 485
     MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
486 486
   #endif
487 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 489
   MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F0, &extruder_multiply[0], 10, 999);
490 490
   #if TEMP_SENSOR_1 != 0
491 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,7 +624,7 @@ static void lcd_implementation_status_screen()
624 624
 
625 625
 static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char post_char) {
626 626
   char c;
627
-  uint8_t n = LCD_WIDTH - 1 - (LCD_WIDTH < 20 ? 1 : 2);
627
+  uint8_t n = LCD_WIDTH - 2;
628 628
   lcd.setCursor(0, row);
629 629
   lcd.print(sel ? pre_char : ' ');
630 630
   while ((c = pgm_read_byte(pstr)) && n > 0) {
@@ -633,12 +633,11 @@ static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const cha
633 633
   }
634 634
   while(n--) lcd.print(' ');
635 635
   lcd.print(post_char);
636
-  lcd.print(' ');
637 636
 }
638 637
 
639 638
 static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char* data) {
640 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 641
   lcd.setCursor(0, row);
643 642
   lcd.print(sel ? pre_char : ' ');
644 643
   while ((c = pgm_read_byte(pstr)) && n > 0) {
@@ -651,7 +650,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t r
651 650
 }
652 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 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 654
   lcd.setCursor(0, row);
656 655
   lcd.print(sel ? pre_char : ' ');
657 656
   while ((c = pgm_read_byte(pstr)) && n > 0) {
@@ -688,11 +687,11 @@ void lcd_implementation_drawedit(const char* pstr, char* value) {
688 687
   lcd.setCursor(1, 1);
689 688
   lcd_printPGM(pstr);
690 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 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 695
   char c;
697 696
   uint8_t n = LCD_WIDTH - concat;
698 697
   lcd.setCursor(0, row);
@@ -706,14 +705,15 @@ static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* ps
706 705
     filename++;
707 706
   }
708 707
   while (n--) lcd.print(' ');
708
+  lcd.print(post_char);
709 709
 }
710 710
 
711 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 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 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