Browse Source

Cleaning up code in prep for merge with upstream.

Chris Roadfeldt 9 years ago
parent
commit
a57862e29f

+ 0
- 1
Marlin/Configuration.h View File

@@ -330,7 +330,6 @@ const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
330 330
 const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
331 331
 const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
332 332
 const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
333
-
334 333
 //#define DISABLE_MAX_ENDSTOPS
335 334
 //#define DISABLE_MIN_ENDSTOPS
336 335
 // If you want to enable the Z Probe pin, but disable its use, uncomment the line below.

+ 0
- 1
Marlin/Marlin.h View File

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

+ 43
- 40
Marlin/Marlin_main.cpp View File

@@ -170,10 +170,10 @@
170 170
 // M404 - N<dia in mm> Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters
171 171
 // M405 - Turn on Filament Sensor extrusion control.  Optional D<delay in cm> to set delay in centimeters between sensor and extruder
172 172
 // M406 - Turn off Filament Sensor extrusion control
173
-// M407 - Displays measured filament diameter
173
+// M407 - Display measured filament diameter
174 174
 // M500 - Store parameters in EEPROM
175 175
 // M501 - Read parameters from EEPROM (if you need reset them after you changed them temporarily).
176
-// M502 - Revert to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
176
+// M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
177 177
 // M503 - Print the current settings (from memory not from EEPROM). Use S0 to leave off headings.
178 178
 // M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
179 179
 // M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
@@ -272,7 +272,7 @@ int fanSpeed = 0;
272 272
 
273 273
 #endif // FWRETRACT
274 274
 
275
-#ifdef ULTIPANEL
275
+#if defined(ULTIPANEL) && HAS_POWER_SWITCH
276 276
   bool powersupply = 
277 277
     #ifdef PS_DEFAULT_OFF
278 278
       false
@@ -311,13 +311,13 @@ bool cancel_heatup = false;
311 311
 
312 312
 #ifdef FILAMENT_SENSOR
313 313
   //Variables for Filament Sensor input
314
-  float filament_width_nominal=DEFAULT_NOMINAL_FILAMENT_DIA;  //Set nominal filament width, can be changed with M404
315
-  bool filament_sensor=false;  //M405 turns on filament_sensor control, M406 turns it off
316
-  float filament_width_meas=DEFAULT_MEASURED_FILAMENT_DIA; //Stores the measured filament diameter
314
+  float filament_width_nominal = DEFAULT_NOMINAL_FILAMENT_DIA;  //Set nominal filament width, can be changed with M404
315
+  bool filament_sensor = false;  //M405 turns on filament_sensor control, M406 turns it off
316
+  float filament_width_meas = DEFAULT_MEASURED_FILAMENT_DIA; //Stores the measured filament diameter
317 317
   signed char measurement_delay[MAX_MEASUREMENT_DELAY+1];  //ring buffer to delay measurement  store extruder factor after subtracting 100
318
-  int delay_index1=0;  //index into ring buffer
319
-  int delay_index2=-1;  //index into ring buffer - set to -1 on startup to indicate ring buffer needs to be initialized
320
-  float delay_dist=0; //delay distance counter
318
+  int delay_index1 = 0;  //index into ring buffer
319
+  int delay_index2 = -1;  //index into ring buffer - set to -1 on startup to indicate ring buffer needs to be initialized
320
+  float delay_dist = 0; //delay distance counter
321 321
   int meas_delay_cm = MEASUREMENT_DELAY_CM;  //distance delay setting
322 322
 #endif
323 323
 
@@ -516,8 +516,8 @@ void setup_powerhold()
516 516
   #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
517 517
     OUT_WRITE(SUICIDE_PIN, HIGH);
518 518
   #endif
519
-  #if defined(PS_ON_PIN) && PS_ON_PIN > -1
520
-    #if defined(PS_DEFAULT_OFF)
519
+  #if HAS_POWER_SWITCH
520
+    #ifdef PS_DEFAULT_OFF
521 521
       OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP);
522 522
     #else
523 523
       OUT_WRITE(PS_ON_PIN, PS_ON_AWAKE);
@@ -1100,7 +1100,7 @@ inline void sync_plan_position() {
1100 1100
   static void run_z_probe() {
1101 1101
 
1102 1102
     #ifdef DELTA
1103
-
1103
+    
1104 1104
       float start_z = current_position[Z_AXIS];
1105 1105
       long start_steps = st_get_position(Z_AXIS);
1106 1106
     
@@ -1153,7 +1153,7 @@ inline void sync_plan_position() {
1153 1153
       current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
1154 1154
       // make sure the planner knows where we are as it may be a bit different than we last said to move to
1155 1155
       sync_plan_position();
1156
-
1156
+      
1157 1157
     #endif // !DELTA
1158 1158
   }
1159 1159
 
@@ -1163,7 +1163,7 @@ inline void sync_plan_position() {
1163 1163
     #ifdef DELTA
1164 1164
 
1165 1165
       feedrate = XY_TRAVEL_SPEED;
1166
-
1166
+      
1167 1167
       destination[X_AXIS] = x;
1168 1168
       destination[Y_AXIS] = y;
1169 1169
       destination[Z_AXIS] = z;
@@ -1237,12 +1237,12 @@ inline void sync_plan_position() {
1237 1237
       feedrate = homing_feedrate[X_AXIS]/10;
1238 1238
       destination[X_AXIS] = 0;
1239 1239
       prepare_move_raw();
1240
-
1240
+      
1241 1241
       // Home Y for safety
1242 1242
       feedrate = homing_feedrate[X_AXIS]/2;
1243 1243
       destination[Y_AXIS] = 0;
1244 1244
       prepare_move_raw();
1245
-
1245
+      
1246 1246
       st_synchronize();
1247 1247
 
1248 1248
     #if defined(Z_PROBE_ENDSTOP)
@@ -1250,7 +1250,7 @@ inline void sync_plan_position() {
1250 1250
       if (z_probe_endstop) {
1251 1251
     #else
1252 1252
       bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
1253
-      if (!z_min_endstop) {
1253
+      if (z_min_endstop) {
1254 1254
     #endif
1255 1255
         if (!Stopped) {
1256 1256
           SERIAL_ERROR_START;
@@ -1261,7 +1261,7 @@ inline void sync_plan_position() {
1261 1261
       }
1262 1262
 
1263 1263
     #endif // Z_PROBE_ALLEN_KEY
1264
-      
1264
+
1265 1265
   }
1266 1266
 
1267 1267
   static void retract_z_probe() {
@@ -1279,9 +1279,9 @@ inline void sync_plan_position() {
1279 1279
         #if SERVO_LEVELING
1280 1280
           servos[servo_endstops[Z_AXIS]].attach(0);
1281 1281
         #endif
1282
-          
1283
-          servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]);
1284
-          
1282
+
1283
+        servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]);
1284
+
1285 1285
         #if SERVO_LEVELING
1286 1286
           delay(PROBE_SERVO_DEACTIVATION_DELAY);
1287 1287
           servos[servo_endstops[Z_AXIS]].detach();
@@ -1305,23 +1305,23 @@ inline void sync_plan_position() {
1305 1305
       feedrate = homing_feedrate[Z_AXIS]/10;
1306 1306
       destination[Z_AXIS] = current_position[Z_AXIS] - Z_PROBE_ALLEN_KEY_RETRACT_DEPTH;
1307 1307
       prepare_move_raw();
1308
-
1308
+      
1309 1309
       // Move up for safety
1310 1310
       feedrate = homing_feedrate[Z_AXIS]/2;
1311 1311
       destination[Z_AXIS] = current_position[Z_AXIS] + Z_PROBE_ALLEN_KEY_RETRACT_DEPTH * 2;
1312 1312
       prepare_move_raw();
1313
-
1313
+      
1314 1314
       // Home XY for safety
1315 1315
       feedrate = homing_feedrate[X_AXIS]/2;
1316 1316
       destination[X_AXIS] = 0;
1317 1317
       destination[Y_AXIS] = 0;
1318 1318
       prepare_move_raw();
1319
-
1319
+      
1320 1320
       st_synchronize();
1321 1321
 
1322 1322
     #if defined(Z_PROBE_ENDSTOP)
1323 1323
       bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
1324
-      if (z_probe_endstop) {
1324
+      if (!z_probe_endstop) {
1325 1325
     #else
1326 1326
       bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
1327 1327
       if (!z_min_endstop) {
@@ -3319,7 +3319,7 @@ inline void gcode_M140() {
3319 3319
   if (code_seen('S')) setTargetBed(code_value());
3320 3320
 }
3321 3321
 
3322
-#if defined(PS_ON_PIN) && PS_ON_PIN > -1
3322
+#if HAS_POWER_SWITCH
3323 3323
 
3324 3324
   /**
3325 3325
    * M80: Turn on Power Supply
@@ -3341,10 +3341,12 @@ inline void gcode_M140() {
3341 3341
     #endif
3342 3342
   }
3343 3343
 
3344
-#endif // PS_ON_PIN
3344
+#endif // HAS_POWER_SWITCH
3345 3345
 
3346 3346
 /**
3347
- * M81: Turn off Power Supply
3347
+ * M81: Turn off Power, including Power Supply, if there is one.
3348
+ *
3349
+ *      This code should ALWAYS be available for EMERGENCY SHUTDOWN!
3348 3350
  */
3349 3351
 inline void gcode_M81() {
3350 3352
   disable_heater();
@@ -3359,16 +3361,19 @@ inline void gcode_M81() {
3359 3361
   #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
3360 3362
     st_synchronize();
3361 3363
     suicide();
3362
-  #elif defined(PS_ON_PIN) && PS_ON_PIN > -1
3364
+  #elif HAS_POWER_SWITCH
3363 3365
     OUT_WRITE(PS_ON_PIN, PS_ON_ASLEEP);
3364 3366
   #endif
3365 3367
   #ifdef ULTIPANEL
3366
-    powersupply = false;
3368
+    #if HAS_POWER_SWITCH
3369
+      powersupply = false;
3370
+    #endif
3367 3371
     LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF ".");
3368 3372
     lcd_update();
3369 3373
   #endif
3370 3374
 }
3371 3375
 
3376
+
3372 3377
 /**
3373 3378
  * M82: Set E codes absolute (default)
3374 3379
  */
@@ -4903,15 +4908,15 @@ void process_commands() {
4903 4908
         #endif //HEATER_2_PIN
4904 4909
       #endif //BARICUDA
4905 4910
 
4906
-      #if defined(PS_ON_PIN) && PS_ON_PIN > -1
4911
+      #if HAS_POWER_SWITCH
4907 4912
 
4908 4913
         case 80: // M80 - Turn on Power Supply
4909 4914
           gcode_M80();
4910 4915
           break;
4911 4916
 
4912
-      #endif // PS_ON_PIN
4917
+      #endif // HAS_POWER_SWITCH
4913 4918
 
4914
-      case 81: // M81 - Turn off Power Supply
4919
+      case 81: // M81 - Turn off Power, including Power Supply, if possible
4915 4920
         gcode_M81();
4916 4921
         break;
4917 4922
 
@@ -5882,19 +5887,17 @@ void kill()
5882 5887
   disable_e2();
5883 5888
   disable_e3();
5884 5889
 
5885
-#if defined(PS_ON_PIN) && PS_ON_PIN > -1
5886
-  pinMode(PS_ON_PIN,INPUT);
5887
-#endif
5890
+  #if HAS_POWER_SWITCH
5891
+    pinMode(PS_ON_PIN, INPUT);
5892
+  #endif
5893
+
5888 5894
   SERIAL_ERROR_START;
5889 5895
   SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
5890 5896
   LCD_ALERTMESSAGEPGM(MSG_KILLED);
5891 5897
   
5892 5898
   // FMC small patch to update the LCD before ending
5893 5899
   sei();   // enable interrupts
5894
-  for ( int i=5; i--; lcd_update())
5895
-  {
5896
-     delay(200);
5897
-  }
5900
+  for (int i = 5; i--; lcd_update()) delay(200); // Wait a short time
5898 5901
   cli();   // disable interrupts
5899 5902
   suicide();
5900 5903
   while(1) { /* Intentionally left empty */ } // Wait for reset

+ 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]);

+ 70
- 46
Marlin/stepper.cpp View File

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

+ 1
- 1
Marlin/ultralcd.cpp View File

@@ -491,7 +491,7 @@ static void lcd_tune_menu() {
491 491
     MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
492 492
   #endif
493 493
   MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
494
-  MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999);
494
+  MENU_ITEM_EDIT(int3, MSG_FLOW, &extruder_multiply[active_extruder], 10, 999);
495 495
   MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F0, &extruder_multiply[0], 10, 999);
496 496
   #if TEMP_SENSOR_1 != 0
497 497
     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