Browse Source

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

CONSULitAS 9 years ago
parent
commit
8f8824e1d3
36 changed files with 401 additions and 307 deletions
  1. 3
    3
      Documentation/Compilation.md
  2. 9
    9
      Marlin/Configuration.h
  3. 2
    2
      Marlin/Makefile
  4. 12
    0
      Marlin/Marlin.h
  5. 125
    111
      Marlin/Marlin_main.cpp
  6. 2
    2
      Marlin/SanityCheck.h
  7. 2
    2
      Marlin/Servo.cpp
  8. 3
    3
      Marlin/Servo.h
  9. 2
    2
      Marlin/blinkm.cpp
  10. 1
    1
      Marlin/blinkm.h
  11. 2
    2
      Marlin/configuration_store.cpp
  12. 3
    3
      Marlin/configuration_store.h
  13. 3
    2
      Marlin/configurator/config/Configuration.h
  14. 3
    2
      Marlin/configurator/config/language.h
  15. 0
    0
      Marlin/dogm_bitmaps.h
  16. 1
    1
      Marlin/dogm_lcd_implementation.h
  17. 4
    3
      Marlin/example_configurations/Felix/Configuration.h
  18. 3
    2
      Marlin/example_configurations/Felix/Configuration_DUAL.h
  19. 4
    3
      Marlin/example_configurations/Hephestos/Configuration.h
  20. 4
    3
      Marlin/example_configurations/K8200/Configuration.h
  21. 4
    3
      Marlin/example_configurations/SCARA/Configuration.h
  22. 4
    3
      Marlin/example_configurations/WITBOX/Configuration.h
  23. 4
    3
      Marlin/example_configurations/delta/generic/Configuration.h
  24. 4
    3
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  25. 4
    3
      Marlin/example_configurations/makibox/Configuration.h
  26. 4
    3
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  27. 20
    1
      Marlin/fonts/README.fonts
  28. 3
    2
      Marlin/language.h
  29. 1
    3
      Marlin/pins_AZTEEG_X3.h
  30. 1
    1
      Marlin/pins_SAV_MKI.h
  31. 92
    60
      Marlin/stepper.cpp
  32. 3
    0
      Marlin/temperature.cpp
  33. 54
    52
      Marlin/ultralcd.cpp
  34. 4
    2
      Marlin/ultralcd.h
  35. 5
    4
      Marlin/ultralcd_implementation_hitachi_HD44780.h
  36. 6
    8
      README.md

+ 3
- 3
Documentation/Compilation.md View File

@@ -3,14 +3,14 @@
3 3
   1. Install the latest non-beta arduino software IDE/toolset: http://www.arduino.cc/en/Main/Software
4 4
   2. Download the Marlin firmware
5 5
     - [Latest developement version](https://github.com/MarlinFirmware/Marlin/tree/Development)
6
-    - [Stable version](https://github.com/MarlinFirmware/Marlin/tree/Development)
6
+    - [Stable version]()
7 7
   3. In both cases use the "Download Zip" button on the right.
8 8
   4. Some boards require special files and/or libraries from the ArduinoAddons directory. Take a look at the dedicated [README](/ArduinoAddons/README.md) for details.
9 9
   5. Start the arduino IDE.
10
-  6. Select Tools -> Board -> Arduino Mega 2560    or your microcontroller
10
+  6. Select Tools -> Board -> Arduino Mega 2560 or your microcontroller
11 11
   7. Select the correct serial port in Tools ->Serial Port
12 12
   8. Open Marlin.pde or .ino
13 13
   9. Click the Verify/Compile button
14 14
   10. Click the Upload button. If all goes well the firmware is uploading
15 15
 
16
-That's ok.  Enjoy Silky Smooth Printing.
16
+That's ok.  Enjoy Silky Smooth Printing.

+ 9
- 9
Marlin/Configuration.h View File

@@ -364,6 +364,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
364 364
 #define E_ENABLE_ON 0 // For all extruders
365 365
 
366 366
 // Disables axis when it's not being used.
367
+// WARNING: When motors turn off there is a chance of losing position accuracy!
367 368
 #define DISABLE_X false
368 369
 #define DISABLE_Y false
369 370
 #define DISABLE_Z false
@@ -661,10 +662,9 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
661 662
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
662 663
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
663 664
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
664
-//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
665 665
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
666
-                                               // 0 to disable buzzer feedback  
667
-
666
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000         // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
667
+                                                 // 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms>
668 668
 // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
669 669
 // http://reprap.org/wiki/PanelOne
670 670
 //#define PANEL_ONE
@@ -792,13 +792,13 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
792 792
 // Uncomment below to enable
793 793
 //#define FILAMENT_SENSOR
794 794
 
795
-#define FILAMENT_SENSOR_EXTRUDER_NUM	0  //The number of the extruder that has the filament sensor (0,1,2)
796
-#define MEASUREMENT_DELAY_CM			14  //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
795
+#define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
796
+#define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
797 797
 
798
-#define DEFAULT_NOMINAL_FILAMENT_DIA  3.0  //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software.  Used for sensor reading validation
799
-#define MEASURED_UPPER_LIMIT          3.30  //upper limit factor used for sensor reading validation in mm
800
-#define MEASURED_LOWER_LIMIT          1.90  //lower limit factor for sensor reading validation in mm
801
-#define MAX_MEASUREMENT_DELAY			20  //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM  and lower number saves RAM)
798
+#define DEFAULT_NOMINAL_FILAMENT_DIA 3.0 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software.  Used for sensor reading validation
799
+#define MEASURED_UPPER_LIMIT         3.3 //upper limit factor used for sensor reading validation in mm
800
+#define MEASURED_LOWER_LIMIT         1.9 //lower limit factor for sensor reading validation in mm
801
+#define MAX_MEASUREMENT_DELAY       20   //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM  and lower number saves RAM)
802 802
 
803 803
 //defines used in the code
804 804
 #define DEFAULT_MEASURED_FILAMENT_DIA  DEFAULT_NOMINAL_FILAMENT_DIA  //set measured to nominal initially

+ 2
- 2
Marlin/Makefile View File

@@ -267,8 +267,8 @@ endif
267 267
 CXXSRC = WMath.cpp WString.cpp Print.cpp Marlin_main.cpp	\
268 268
 	MarlinSerial.cpp Sd2Card.cpp SdBaseFile.cpp SdFatUtil.cpp	\
269 269
 	SdFile.cpp SdVolume.cpp motion_control.cpp planner.cpp		\
270
-	stepper.cpp temperature.cpp cardreader.cpp ConfigurationStore.cpp \
271
-	watchdog.cpp SPI.cpp Servo.cpp Tone.cpp ultralcd.cpp digipot_mcp4451.cpp \
270
+	stepper.cpp temperature.cpp cardreader.cpp configuration_store.cpp \
271
+	watchdog.cpp SPI.cpp servo.cpp Tone.cpp ultralcd.cpp digipot_mcp4451.cpp \
272 272
 	vector_3.cpp qr_solve.cpp
273 273
 ifeq ($(LIQUID_TWI2), 0)
274 274
 CXXSRC += LiquidCrystal.cpp

+ 12
- 0
Marlin/Marlin.h View File

@@ -223,6 +223,18 @@ void Stop();
223 223
   void filrunout();
224 224
 #endif
225 225
 
226
+/**
227
+ * Debug flags - not yet widely applied
228
+ */
229
+enum DebugFlags {
230
+  DEBUG_ECHO          = BIT(0),
231
+  DEBUG_INFO          = BIT(1),
232
+  DEBUG_ERRORS        = BIT(2),
233
+  DEBUG_DRYRUN        = BIT(3),
234
+  DEBUG_COMMUNICATION = BIT(4)
235
+};
236
+extern uint8_t marlin_debug_flags;
237
+
226 238
 extern bool Running;
227 239
 inline bool IsRunning() { return  Running; }
228 240
 inline bool IsStopped() { return !Running; }

+ 125
- 111
Marlin/Marlin_main.cpp View File

@@ -49,18 +49,18 @@
49 49
 #include "motion_control.h"
50 50
 #include "cardreader.h"
51 51
 #include "watchdog.h"
52
-#include "ConfigurationStore.h"
52
+#include "configuration_store.h"
53 53
 #include "language.h"
54 54
 #include "pins_arduino.h"
55 55
 #include "math.h"
56 56
 
57 57
 #ifdef BLINKM
58
-  #include "BlinkM.h"
58
+  #include "blinkm.h"
59 59
   #include "Wire.h"
60 60
 #endif
61 61
 
62 62
 #if NUM_SERVOS > 0
63
-  #include "Servo.h"
63
+  #include "servo.h"
64 64
 #endif
65 65
 
66 66
 #if HAS_DIGIPOTSS
@@ -122,7 +122,7 @@
122 122
  *        Call gcode file : "M32 P !filename#" and return to caller file after finishing (similar to #include).
123 123
  *        The '#' is necessary when calling from within sd files, as it stops buffer prereading
124 124
  * M42  - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used.
125
- * M48  - Measure Z_Probe repeatability. M48 [n # of points] [X position] [Y position] [V_erboseness #] [E_ngage Probe] [L # of legs of travel]
125
+ * M48  - Measure Z_Probe repeatability. M48 [P # of points] [X position] [Y position] [V_erboseness #] [E_ngage Probe] [L # of legs of travel]
126 126
  * M80  - Turn on Power Supply
127 127
  * M81  - Turn off Power Supply
128 128
  * M82  - Set E codes absolute (default)
@@ -138,6 +138,7 @@
138 138
  * M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
139 139
  *        Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
140 140
  *        IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
141
+ * M111 - Set debug flags with S<mask>. See flag bits defined in Marlin.h.
141 142
  * M112 - Emergency stop
142 143
  * M114 - Output current position to serial port
143 144
  * M115 - Capabilities string
@@ -184,6 +185,7 @@
184 185
  * M405 - Turn on Filament Sensor extrusion control.  Optional D<delay in cm> to set delay in centimeters between sensor and extruder
185 186
  * M406 - Turn off Filament Sensor extrusion control
186 187
  * M407 - Display measured filament diameter
188
+ * M410 - Quickstop. Abort all the planned moves
187 189
  * M500 - Store parameters in EEPROM
188 190
  * M501 - Read parameters from EEPROM (if you need reset them after you changed them temporarily).
189 191
  * M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
@@ -217,6 +219,8 @@
217 219
 
218 220
 bool Running = true;
219 221
 
222
+uint8_t marlin_debug_flags = DEBUG_INFO|DEBUG_ERRORS;
223
+
220 224
 static float feedrate = 1500.0, next_feedrate, saved_feedrate;
221 225
 float current_position[NUM_AXIS] = { 0.0 };
222 226
 static float destination[NUM_AXIS] = { 0.0 };
@@ -748,9 +752,10 @@ void get_command() {
748 752
         gcode_N = (strtol(strchr_pointer + 1, NULL, 10));
749 753
         if (gcode_N != gcode_LastN + 1 && strstr_P(command, PSTR("M110")) == NULL) {
750 754
           SERIAL_ERROR_START;
751
-          SERIAL_ERRORPGM(MSG_ERR_LINE_NO);
752
-          SERIAL_ERRORLN(gcode_LastN);
753
-          //Serial.println(gcode_N);
755
+          SERIAL_ERRORPGM(MSG_ERR_LINE_NO1);
756
+          SERIAL_ERROR(gcode_LastN + 1);
757
+          SERIAL_ERRORPGM(MSG_ERR_LINE_NO2);
758
+          SERIAL_ERRORLN(gcode_N);
754 759
           FlushSerialRequestResend();
755 760
           serial_count = 0;
756 761
           return;
@@ -889,8 +894,11 @@ void get_command() {
889 894
 }
890 895
 
891 896
 bool code_has_value() {
892
-  char c = strchr_pointer[1];
893
-  return (c >= '0' && c <= '9') || c == '-' || c == '+' || c == '.';
897
+  int i = 1;
898
+  char c = strchr_pointer[i];
899
+  if (c == '-' || c == '+') c = strchr_pointer[++i];
900
+  if (c == '.') c = strchr_pointer[++i];
901
+  return (c >= '0' && c <= '9');
894 902
 }
895 903
 
896 904
 float code_value() {
@@ -989,10 +997,10 @@ static void axis_is_at_home(int axis) {
989 997
   #endif
990 998
 
991 999
   #ifdef SCARA
992
-    float homeposition[3];
993 1000
    
994
-    if (axis < 2) {
1001
+    if (axis == X_AXIS || axis == Y_AXIS) {
995 1002
 
1003
+      float homeposition[3];
996 1004
       for (int i = 0; i < 3; i++) homeposition[i] = base_home_pos(i);
997 1005
 
998 1006
       // SERIAL_ECHOPGM("homeposition[x]= "); SERIAL_ECHO(homeposition[0]);
@@ -1022,17 +1030,18 @@ static void axis_is_at_home(int axis) {
1022 1030
       // inverse kinematic transform.
1023 1031
       min_pos[axis] = base_min_pos(axis); // + (delta[axis] - base_home_pos(axis));
1024 1032
       max_pos[axis] = base_max_pos(axis); // + (delta[axis] - base_home_pos(axis));
1025
-    } 
1026
-    else {
1027
-      current_position[axis] = base_home_pos(axis) + home_offset[axis];
1028
-      min_pos[axis] = base_min_pos(axis) + home_offset[axis];
1029
-      max_pos[axis] = base_max_pos(axis) + home_offset[axis];
1030 1033
     }
1031
-  #else
1034
+    else
1035
+  #endif
1036
+  {
1032 1037
     current_position[axis] = base_home_pos(axis) + home_offset[axis];
1033 1038
     min_pos[axis] = base_min_pos(axis) + home_offset[axis];
1034 1039
     max_pos[axis] = base_max_pos(axis) + home_offset[axis];
1035
-  #endif
1040
+
1041
+    #if defined(ENABLE_AUTO_BED_LEVELING) && Z_HOME_DIR < 0
1042
+      if (axis == Z_AXIS) current_position[Z_AXIS] += zprobe_zoffset;
1043
+    #endif
1044
+  }
1036 1045
 }
1037 1046
 
1038 1047
 /**
@@ -1187,8 +1196,8 @@ inline void set_destination_to_current() { memcpy(destination, current_position,
1187 1196
       st_synchronize();
1188 1197
       endstops_hit_on_purpose(); // clear endstop hit flags
1189 1198
 
1199
+      // Get the current stepper position after bumping an endstop
1190 1200
       current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
1191
-      // make sure the planner knows where we are as it may be a bit different than we last said to move to
1192 1201
       sync_plan_position();
1193 1202
       
1194 1203
     #endif // !DELTA
@@ -1500,13 +1509,11 @@ static void homeaxis(AxisEnum axis) {
1500 1509
 
1501 1510
   if (axis == X_AXIS ? HOMEAXIS_DO(X) : axis == Y_AXIS ? HOMEAXIS_DO(Y) : axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0) {
1502 1511
 
1503
-    int axis_home_dir;
1504
-
1505
-    #ifdef DUAL_X_CARRIAGE
1506
-      if (axis == X_AXIS) axis_home_dir = x_home_dir(active_extruder);
1507
-    #else
1508
-      axis_home_dir = home_dir(axis);
1509
-    #endif
1512
+    int axis_home_dir =
1513
+      #ifdef DUAL_X_CARRIAGE
1514
+        (axis == X_AXIS) ? x_home_dir(active_extruder) :
1515
+      #endif
1516
+      home_dir(axis);
1510 1517
 
1511 1518
     // Set the axis position as setup for the move
1512 1519
     current_position[axis] = 0;
@@ -1744,14 +1751,15 @@ inline void gcode_G2_G3(bool clockwise) {
1744 1751
 inline void gcode_G4() {
1745 1752
   millis_t codenum = 0;
1746 1753
 
1747
-  LCD_MESSAGEPGM(MSG_DWELL);
1748
-
1749 1754
   if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait
1750 1755
   if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait
1751 1756
 
1752 1757
   st_synchronize();
1753 1758
   refresh_cmd_timeout();
1754 1759
   codenum += previous_cmd_ms;  // keep track of when we started waiting
1760
+
1761
+  if (!lcd_hasstatus()) LCD_MESSAGEPGM(MSG_DWELL);
1762
+
1755 1763
   while (millis() < codenum) {
1756 1764
     manage_heater();
1757 1765
     manage_inactivity();
@@ -1794,12 +1802,6 @@ inline void gcode_G4() {
1794 1802
  *  Y   Home to the Y endstop
1795 1803
  *  Z   Home to the Z endstop
1796 1804
  *
1797
- * If numbers are included with XYZ set the position as with G92
1798
- * Currently adds the home_offset, which may be wrong and removed soon.
1799
- *
1800
- *  Xn  Home X, setting X to n + home_offset[X_AXIS]
1801
- *  Yn  Home Y, setting Y to n + home_offset[Y_AXIS]
1802
- *  Zn  Home Z, setting Z to n + home_offset[Z_AXIS]
1803 1805
  */
1804 1806
 inline void gcode_G28() {
1805 1807
 
@@ -1859,7 +1861,7 @@ inline void gcode_G28() {
1859 1861
           homeY = code_seen(axis_codes[Y_AXIS]),
1860 1862
           homeZ = code_seen(axis_codes[Z_AXIS]);
1861 1863
 
1862
-    home_all_axis = !(homeX || homeY || homeZ) || (homeX && homeY && homeZ);
1864
+    home_all_axis = (!homeX && !homeY && !homeZ) || (homeX && homeY && homeZ);
1863 1865
 
1864 1866
     if (home_all_axis || homeZ) {
1865 1867
 
@@ -1946,14 +1948,6 @@ inline void gcode_G28() {
1946 1948
     // Home Y
1947 1949
     if (home_all_axis || homeY) HOMEAXIS(Y);
1948 1950
 
1949
-    // Set the X position, if included
1950
-    if (code_seen(axis_codes[X_AXIS]) && code_has_value())
1951
-      current_position[X_AXIS] = code_value();
1952
-
1953
-    // Set the Y position, if included
1954
-    if (code_seen(axis_codes[Y_AXIS]) && code_has_value())
1955
-      current_position[Y_AXIS] = code_value();
1956
-
1957 1951
     // Home Z last if homing towards the bed
1958 1952
     #if Z_HOME_DIR < 0
1959 1953
 
@@ -2037,14 +2031,6 @@ inline void gcode_G28() {
2037 2031
 
2038 2032
     #endif // Z_HOME_DIR < 0
2039 2033
 
2040
-    // Set the Z position, if included
2041
-    if (code_seen(axis_codes[Z_AXIS]) && code_has_value())
2042
-      current_position[Z_AXIS] = code_value();
2043
-
2044
-    #if defined(ENABLE_AUTO_BED_LEVELING) && (Z_HOME_DIR < 0)
2045
-      if (home_all_axis || homeZ) current_position[Z_AXIS] += zprobe_zoffset;  // Add Z_Probe offset (the distance is negative)
2046
-    #endif
2047
-
2048 2034
     sync_plan_position();
2049 2035
 
2050 2036
   #endif // else DELTA
@@ -2893,7 +2879,7 @@ inline void gcode_M42() {
2893 2879
    * M48: Z-Probe repeatability measurement function.
2894 2880
    *
2895 2881
    * Usage:
2896
-   *   M48 <n#> <X#> <Y#> <V#> <E> <L#>
2882
+   *   M48 <P#> <X#> <Y#> <V#> <E> <L#>
2897 2883
    *     P = Number of sampled points (4-50, default 10)
2898 2884
    *     X = Sample X position
2899 2885
    *     Y = Sample Y position
@@ -2905,10 +2891,6 @@ inline void gcode_M42() {
2905 2891
    * as been issued prior to invoking the M48 Z-Probe repeatability measurement function.
2906 2892
    * Any information generated by a prior G29 Bed leveling command will be lost and need to be
2907 2893
    * regenerated.
2908
-   *
2909
-   * The number of samples will default to 10 if not specified.  You can use upper or lower case
2910
-   * letters for any of the options EXCEPT n.  n must be in lower case because Marlin uses a capital
2911
-   * N for its communication protocol and will get horribly confused if you send it a capital N.
2912 2894
    */
2913 2895
   inline void gcode_M48() {
2914 2896
 
@@ -2926,7 +2908,7 @@ inline void gcode_M42() {
2926 2908
     if (verbose_level > 0)
2927 2909
       SERIAL_PROTOCOLPGM("M48 Z-Probe Repeatability test\n");
2928 2910
 
2929
-    if (code_seen('P') || code_seen('p') || code_seen('n')) { // `n` for legacy support only - please use `P`!
2911
+    if (code_seen('P') || code_seen('p')) {
2930 2912
       n_samples = code_value_short();
2931 2913
       if (n_samples < 4 || n_samples > 50) {
2932 2914
         SERIAL_PROTOCOLPGM("?Sample size not plausible (4-50).\n");
@@ -2934,12 +2916,12 @@ inline void gcode_M42() {
2934 2916
       }
2935 2917
     }
2936 2918
 
2937
-    double X_probe_location, Y_probe_location,
2938
-           X_current = X_probe_location = st_get_position_mm(X_AXIS),
2939
-           Y_current = Y_probe_location = st_get_position_mm(Y_AXIS),
2919
+    double X_current = st_get_position_mm(X_AXIS),
2920
+           Y_current = st_get_position_mm(Y_AXIS),
2940 2921
            Z_current = st_get_position_mm(Z_AXIS),
2941
-           Z_start_location = Z_current + Z_RAISE_BEFORE_PROBING,
2942
-           ext_position = st_get_position_mm(E_AXIS);
2922
+           E_current = st_get_position_mm(E_AXIS),
2923
+           X_probe_location = X_current, Y_probe_location = Y_current,
2924
+           Z_start_location = Z_current + Z_RAISE_BEFORE_PROBING;
2943 2925
 
2944 2926
     bool deploy_probe_for_each_reading = code_seen('E') || code_seen('e');
2945 2927
 
@@ -2974,10 +2956,7 @@ inline void gcode_M42() {
2974 2956
 
2975 2957
     st_synchronize();
2976 2958
     plan_bed_level_matrix.set_to_identity();
2977
-    plan_buffer_line(X_current, Y_current, Z_start_location,
2978
-        ext_position,
2979
-        homing_feedrate[Z_AXIS] / 60,
2980
-        active_extruder);
2959
+    plan_buffer_line(X_current, Y_current, Z_start_location, E_current, homing_feedrate[Z_AXIS] / 60, active_extruder);
2981 2960
     st_synchronize();
2982 2961
 
2983 2962
     //
@@ -2989,7 +2968,7 @@ inline void gcode_M42() {
2989 2968
       SERIAL_PROTOCOLPGM("Positioning the probe...\n");
2990 2969
 
2991 2970
     plan_buffer_line( X_probe_location, Y_probe_location, Z_start_location,
2992
-        ext_position,
2971
+        E_current,
2993 2972
         homing_feedrate[X_AXIS]/60,
2994 2973
         active_extruder);
2995 2974
     st_synchronize();
@@ -2997,7 +2976,7 @@ inline void gcode_M42() {
2997 2976
     current_position[X_AXIS] = X_current = st_get_position_mm(X_AXIS);
2998 2977
     current_position[Y_AXIS] = Y_current = st_get_position_mm(Y_AXIS);
2999 2978
     current_position[Z_AXIS] = Z_current = st_get_position_mm(Z_AXIS);
3000
-    current_position[E_AXIS] = ext_position = st_get_position_mm(E_AXIS);
2979
+    current_position[E_AXIS] = E_current = st_get_position_mm(E_AXIS);
3001 2980
 
3002 2981
     // 
3003 2982
     // OK, do the inital probe to get us close to the bed.
@@ -3013,7 +2992,7 @@ inline void gcode_M42() {
3013 2992
     Z_start_location = st_get_position_mm(Z_AXIS) + Z_RAISE_BEFORE_PROBING;
3014 2993
 
3015 2994
     plan_buffer_line( X_probe_location, Y_probe_location, Z_start_location,
3016
-        ext_position,
2995
+        E_current,
3017 2996
         homing_feedrate[X_AXIS]/60,
3018 2997
         active_extruder);
3019 2998
     st_synchronize();
@@ -3043,8 +3022,8 @@ inline void gcode_M42() {
3043 3022
           if (radius < 0.0) radius = -radius;
3044 3023
 
3045 3024
           X_current = X_probe_location + cos(theta) * radius;
3046
-          Y_current = Y_probe_location + sin(theta) * radius;
3047 3025
           X_current = constrain(X_current, X_MIN_POS, X_MAX_POS);
3026
+          Y_current = Y_probe_location + sin(theta) * radius;
3048 3027
           Y_current = constrain(Y_current, Y_MIN_POS, Y_MAX_POS);
3049 3028
 
3050 3029
           if (verbose_level > 3) {
@@ -3160,7 +3139,7 @@ inline void gcode_M104() {
3160 3139
 inline void gcode_M105() {
3161 3140
   if (setTargetedHotend(105)) return;
3162 3141
 
3163
-  #if HAS_TEMP_0 || HAS_TEMP_BED
3142
+  #if HAS_TEMP_0 || HAS_TEMP_BED || defined(HEATER_0_USES_MAX6675)
3164 3143
     SERIAL_PROTOCOLPGM("ok");
3165 3144
     #if HAS_TEMP_0
3166 3145
       SERIAL_PROTOCOLPGM(" T:");
@@ -3362,12 +3341,17 @@ inline void gcode_M109() {
3362 3341
 #endif // HAS_TEMP_BED
3363 3342
 
3364 3343
 /**
3365
- * M112: Emergency Stop
3344
+ * M111: Set the debug level
3366 3345
  */
3367
-inline void gcode_M112() {
3368
-  kill();
3346
+inline void gcode_M111() {
3347
+  marlin_debug_flags = code_seen('S') ? code_value_short() : DEBUG_INFO|DEBUG_ERRORS;
3369 3348
 }
3370 3349
 
3350
+/**
3351
+ * M112: Emergency Stop
3352
+ */
3353
+inline void gcode_M112() { kill(); }
3354
+
3371 3355
 #ifdef BARICUDA
3372 3356
 
3373 3357
   #if HAS_HEATER_1
@@ -3809,23 +3793,23 @@ inline void gcode_M206() {
3809 3793
    * M666: Set delta endstop adjustment
3810 3794
    */
3811 3795
   inline void gcode_M666() {
3812
-    for (int8_t i = 0; i < 3; i++) {
3796
+    for (int8_t i = X_AXIS; i <= Z_AXIS; i++) {
3813 3797
       if (code_seen(axis_codes[i])) {
3814 3798
         endstop_adj[i] = code_value();
3815 3799
       }
3816 3800
     }
3817 3801
   }
3818
-#elif defined(Z_DUAL_ENDSTOPS)
3802
+#elif defined(Z_DUAL_ENDSTOPS) // !DELTA && defined(Z_DUAL_ENDSTOPS)
3819 3803
   /**
3820 3804
    * M666: For Z Dual Endstop setup, set z axis offset to the z2 axis.
3821 3805
    */
3822 3806
   inline void gcode_M666() {
3823
-   if (code_seen('Z')) z_endstop_adj = code_value();
3824
-   SERIAL_ECHOPAIR("Z Endstop Adjustment set to (mm):", z_endstop_adj );
3825
-   SERIAL_EOL;
3807
+    if (code_seen('Z')) z_endstop_adj = code_value();
3808
+    SERIAL_ECHOPAIR("Z Endstop Adjustment set to (mm):", z_endstop_adj);
3809
+    SERIAL_EOL;
3826 3810
   }
3827 3811
   
3828
-#endif // DELTA
3812
+#endif // !DELTA && defined(Z_DUAL_ENDSTOPS)
3829 3813
 
3830 3814
 #ifdef FWRETRACT
3831 3815
 
@@ -4025,20 +4009,8 @@ inline void gcode_M226() {
4025 4009
   inline void gcode_M300() {
4026 4010
     uint16_t beepS = code_seen('S') ? code_value_short() : 110;
4027 4011
     uint32_t beepP = code_seen('P') ? code_value_long() : 1000;
4028
-    if (beepS > 0) {
4029
-      #if BEEPER > 0
4030
-        tone(BEEPER, beepS);
4031
-        delay(beepP);
4032
-        noTone(BEEPER);
4033
-      #elif defined(ULTRALCD)
4034
-        lcd_buzz(beepS, beepP);
4035
-      #elif defined(LCD_USE_I2C_BUZZER)
4036
-        lcd_buzz(beepP, beepS);
4037
-      #endif
4038
-    }
4039
-    else {
4040
-      delay(beepP);
4041
-    }
4012
+    if (beepP > 5000) beepP = 5000; // limit to 5 seconds
4013
+    lcd_buzz(beepP, beepS);
4042 4014
   }
4043 4015
 
4044 4016
 #endif // BEEPER>0 || ULTRALCD || LCD_USE_I2C_BUZZER
@@ -4313,14 +4285,34 @@ inline void gcode_M400() { st_synchronize(); }
4313 4285
 
4314 4286
 #if defined(ENABLE_AUTO_BED_LEVELING) && (defined(SERVO_ENDSTOPS) || defined(Z_PROBE_ALLEN_KEY)) && not defined(Z_PROBE_SLED)
4315 4287
 
4288
+  #ifdef SERVO_ENDSTOPS
4289
+    void raise_z_for_servo() {
4290
+      float zpos = current_position[Z_AXIS], z_dest = Z_RAISE_BEFORE_HOMING;
4291
+      if (!axis_known_position[Z_AXIS]) z_dest += zpos;
4292
+      if (zpos < z_dest)
4293
+        do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_dest); // also updates current_position
4294
+    }
4295
+  #endif
4296
+
4316 4297
   /**
4317 4298
    * M401: Engage Z Servo endstop if available
4318 4299
    */
4319
-  inline void gcode_M401() { deploy_z_probe(); }
4300
+  inline void gcode_M401() {
4301
+    #ifdef SERVO_ENDSTOPS
4302
+      raise_z_for_servo();
4303
+    #endif
4304
+    deploy_z_probe();
4305
+  }
4306
+
4320 4307
   /**
4321 4308
    * M402: Retract Z Servo endstop if enabled
4322 4309
    */
4323
-  inline void gcode_M402() { stow_z_probe(); }
4310
+  inline void gcode_M402() {
4311
+    #ifdef SERVO_ENDSTOPS
4312
+      raise_z_for_servo();
4313
+    #endif
4314
+    stow_z_probe();
4315
+  }
4324 4316
 
4325 4317
 #endif
4326 4318
 
@@ -4381,6 +4373,14 @@ inline void gcode_M400() { st_synchronize(); }
4381 4373
 #endif // FILAMENT_SENSOR
4382 4374
 
4383 4375
 /**
4376
+ * M410: Quickstop - Abort all planned moves
4377
+ *
4378
+ * This will stop the carriages mid-move, so most likely they
4379
+ * will be out of sync with the stepper position after this.
4380
+ */
4381
+inline void gcode_M410() { quickStop(); }
4382
+
4383
+/**
4384 4384
  * M500: Store settings in EEPROM
4385 4385
  */
4386 4386
 inline void gcode_M500() {
@@ -4426,7 +4426,7 @@ inline void gcode_M503() {
4426 4426
     if (code_seen('Z')) {
4427 4427
       value = code_value();
4428 4428
       if (Z_PROBE_OFFSET_RANGE_MIN <= value && value <= Z_PROBE_OFFSET_RANGE_MAX) {
4429
-        zprobe_zoffset = -value; // compare w/ line 278 of ConfigurationStore.cpp
4429
+        zprobe_zoffset = -value; // compare w/ line 278 of configuration_store.cpp
4430 4430
         SERIAL_ECHO_START;
4431 4431
         SERIAL_ECHOLNPGM(MSG_ZPROBE_ZOFFSET " " MSG_OK);
4432 4432
         SERIAL_EOL;
@@ -4790,6 +4790,12 @@ inline void gcode_T() {
4790 4790
  * This is called from the main loop()
4791 4791
  */
4792 4792
 void process_commands() {
4793
+
4794
+  if ((marlin_debug_flags & DEBUG_ECHO)) {
4795
+    SERIAL_ECHO_START;
4796
+    SERIAL_ECHOLN(command_queue[cmd_queue_index_r]);
4797
+  }
4798
+
4793 4799
   if (code_seen('G')) {
4794 4800
 
4795 4801
     int gCode = code_value_short();
@@ -4928,34 +4934,38 @@ void process_commands() {
4928 4934
         gcode_M104();
4929 4935
         break;
4930 4936
 
4931
-      case 112: //  M112 Emergency Stop
4937
+      case 111: //  M111: Set debug level
4938
+        gcode_M111();
4939
+        break;
4940
+
4941
+      case 112: //  M112: Emergency Stop
4932 4942
         gcode_M112();
4933 4943
         break;
4934 4944
 
4935
-      case 140: // M140 Set bed temp
4945
+      case 140: // M140: Set bed temp
4936 4946
         gcode_M140();
4937 4947
         break;
4938 4948
 
4939
-      case 105: // M105 Read current temperature
4949
+      case 105: // M105: Read current temperature
4940 4950
         gcode_M105();
4941 4951
         return;
4942 4952
         break;
4943 4953
 
4944
-      case 109: // M109 Wait for temperature
4954
+      case 109: // M109: Wait for temperature
4945 4955
         gcode_M109();
4946 4956
         break;
4947 4957
 
4948 4958
       #if HAS_TEMP_BED
4949
-        case 190: // M190 - Wait for bed heater to reach target.
4959
+        case 190: // M190: Wait for bed heater to reach target
4950 4960
           gcode_M190();
4951 4961
           break;
4952 4962
       #endif // HAS_TEMP_BED
4953 4963
 
4954 4964
       #if HAS_FAN
4955
-        case 106: //M106 Fan On
4965
+        case 106: // M106: Fan On
4956 4966
           gcode_M106();
4957 4967
           break;
4958
-        case 107: //M107 Fan Off
4968
+        case 107: // M107: Fan Off
4959 4969
           gcode_M107();
4960 4970
           break;
4961 4971
       #endif // HAS_FAN
@@ -4963,20 +4973,20 @@ void process_commands() {
4963 4973
       #ifdef BARICUDA
4964 4974
         // PWM for HEATER_1_PIN
4965 4975
         #if HAS_HEATER_1
4966
-          case 126: // M126 valve open
4976
+          case 126: // M126: valve open
4967 4977
             gcode_M126();
4968 4978
             break;
4969
-          case 127: // M127 valve closed
4979
+          case 127: // M127: valve closed
4970 4980
             gcode_M127();
4971 4981
             break;
4972 4982
         #endif // HAS_HEATER_1
4973 4983
 
4974 4984
         // PWM for HEATER_2_PIN
4975 4985
         #if HAS_HEATER_2
4976
-          case 128: // M128 valve open
4986
+          case 128: // M128: valve open
4977 4987
             gcode_M128();
4978 4988
             break;
4979
-          case 129: // M129 valve closed
4989
+          case 129: // M129: valve closed
4980 4990
             gcode_M129();
4981 4991
             break;
4982 4992
         #endif // HAS_HEATER_2
@@ -4984,13 +4994,13 @@ void process_commands() {
4984 4994
 
4985 4995
       #if HAS_POWER_SWITCH
4986 4996
 
4987
-        case 80: // M80 - Turn on Power Supply
4997
+        case 80: // M80: Turn on Power Supply
4988 4998
           gcode_M80();
4989 4999
           break;
4990 5000
 
4991 5001
       #endif // HAS_POWER_SWITCH
4992 5002
 
4993
-      case 81: // M81 - Turn off Power, including Power Supply, if possible
5003
+      case 81: // M81: Turn off Power, including Power Supply, if possible
4994 5004
         gcode_M81();
4995 5005
         break;
4996 5006
 
@@ -5000,7 +5010,7 @@ void process_commands() {
5000 5010
       case 83:
5001 5011
         gcode_M83();
5002 5012
         break;
5003
-      case 18: //compatibility
5013
+      case 18: // (for compatibility)
5004 5014
       case 84: // M84
5005 5015
         gcode_M18_M84();
5006 5016
         break;
@@ -5199,6 +5209,10 @@ void process_commands() {
5199 5209
           break;
5200 5210
       #endif // FILAMENT_SENSOR
5201 5211
 
5212
+      case 410: // M410 quickstop - Abort all the planned moves.
5213
+        gcode_M410();
5214
+        break;
5215
+
5202 5216
       case 500: // M500 Store settings in EEPROM
5203 5217
         gcode_M500();
5204 5218
         break;

+ 2
- 2
Marlin/SanityCheck.h View File

@@ -87,8 +87,8 @@
87 87
   /**
88 88
    * Required LCD language
89 89
    */
90
-  #if !defined(DOGLCD) && defined(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780_JAPAN) && !defined(DISPLAY_CHARSET_HD44780_WESTERN)
91
-    #error You must enable either DISPLAY_CHARSET_HD44780_JAPAN or DISPLAY_CHARSET_HD44780_WESTERN for your LCD controller.
90
+  #if !defined(DOGLCD) && defined(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780_JAPAN) && !defined(DISPLAY_CHARSET_HD44780_WESTERN)&& !defined(DISPLAY_CHARSET_HD44780_CYRILLIC)
91
+    #error You must enable either DISPLAY_CHARSET_HD44780_JAPAN or DISPLAY_CHARSET_HD44780_WESTERN  or DISPLAY_CHARSET_HD44780_CYRILLIC for your LCD controller.
92 92
   #endif
93 93
 
94 94
   /**

+ 2
- 2
Marlin/Servo.cpp View File

@@ -1,5 +1,5 @@
1 1
 /*
2
- Servo.cpp - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
2
+ servo.cpp - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
3 3
  Copyright (c) 2009 Michael Margolis.  All right reserved.
4 4
 
5 5
  This library is free software; you can redistribute it and/or
@@ -48,7 +48,7 @@
48 48
 #include <avr/interrupt.h>
49 49
 #include <Arduino.h>
50 50
 
51
-#include "Servo.h"
51
+#include "servo.h"
52 52
 
53 53
 #define usToTicks(_us)    (( clockCyclesPerMicrosecond()* _us) / 8)     // converts microseconds to tick (assumes prescale of 8)  // 12 Aug 2009
54 54
 #define ticksToUs(_ticks) (( (unsigned)_ticks * 8)/ clockCyclesPerMicrosecond() ) // converts from ticks back to microseconds

+ 3
- 3
Marlin/Servo.h View File

@@ -1,5 +1,5 @@
1 1
 /*
2
-  Servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
2
+  servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
3 3
   Copyright (c) 2009 Michael Margolis.  All right reserved.
4 4
 
5 5
   This library is free software; you can redistribute it and/or
@@ -42,8 +42,8 @@
42 42
    detach()    - Stops an attached servos from pulsing its i/o pin.
43 43
  */
44 44
 
45
-#ifndef Servo_h
46
-#define Servo_h
45
+#ifndef servo_h
46
+#define servo_h
47 47
 
48 48
 #include <inttypes.h>
49 49
 

Marlin/BlinkM.cpp → Marlin/blinkm.cpp View File

@@ -1,11 +1,11 @@
1 1
 /*
2
-  BlinkM.cpp - Library for controlling a BlinkM over i2c
2
+  blinkm.cpp - Library for controlling a BlinkM over i2c
3 3
   Created by Tim Koster, August 21 2013.
4 4
 */
5 5
 #include "Marlin.h"
6 6
 #ifdef BLINKM
7 7
 
8
-#include "BlinkM.h"
8
+#include "blinkm.h"
9 9
 
10 10
 void SendColors(byte red, byte grn, byte blu) {
11 11
   Wire.begin(); 

Marlin/BlinkM.h → Marlin/blinkm.h View File

@@ -1,5 +1,5 @@
1 1
 /*
2
-  BlinkM.h
2
+  blinkm.h
3 3
   Library header file for BlinkM library
4 4
  */
5 5
 #if ARDUINO >= 100

Marlin/ConfigurationStore.cpp → Marlin/configuration_store.cpp View File

@@ -1,5 +1,5 @@
1 1
 /**
2
- * ConfigurationStore.cpp
2
+ * configuration_store.cpp
3 3
  *
4 4
  * Configuration and EEPROM storage
5 5
  *
@@ -93,7 +93,7 @@
93 93
 #include "planner.h"
94 94
 #include "temperature.h"
95 95
 #include "ultralcd.h"
96
-#include "ConfigurationStore.h"
96
+#include "configuration_store.h"
97 97
 
98 98
 #ifdef MESH_BED_LEVELING
99 99
    #include "mesh_bed_leveling.h"

Marlin/ConfigurationStore.h → Marlin/configuration_store.h View File

@@ -1,5 +1,5 @@
1
-#ifndef CONFIGURATIONSTORE_H
2
-#define CONFIGURATIONSTORE_H
1
+#ifndef CONFIGURATION_STORE_H
2
+#define CONFIGURATION_STORE_H
3 3
 
4 4
 #include "Configuration.h"
5 5
 
@@ -19,4 +19,4 @@ void Config_ResetDefault();
19 19
   FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }
20 20
 #endif
21 21
 
22
-#endif //CONFIGURATIONSTORE_H
22
+#endif //CONFIGURATION_STORE_H

+ 3
- 2
Marlin/configurator/config/Configuration.h View File

@@ -364,6 +364,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
364 364
 #define E_ENABLE_ON 0 // For all extruders
365 365
 
366 366
 // Disables axis when it's not being used.
367
+// WARNING: When motors turn off there is a chance of losing position accuracy!
367 368
 #define DISABLE_X false
368 369
 #define DISABLE_Y false
369 370
 #define DISABLE_Z false
@@ -660,9 +661,9 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
660 661
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
661 662
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
662 663
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
663
-//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
664 664
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
665
-                                               // 0 to disable buzzer feedback  
665
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000         // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
666
+                                                 // 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms>
666 667
 
667 668
 // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
668 669
 // http://reprap.org/wiki/PanelOne

+ 3
- 2
Marlin/configurator/config/language.h View File

@@ -122,7 +122,8 @@
122 122
 #define MSG_PLANNER_BUFFER_BYTES            "  PlannerBufferBytes: "
123 123
 #define MSG_OK                              "ok"
124 124
 #define MSG_FILE_SAVED                      "Done saving file."
125
-#define MSG_ERR_LINE_NO                     "Line Number is not Last Line Number+1, Last Line: "
125
+#define MSG_ERR_LINE_NO1                    "Line Number out of sequence. Expected: "
126
+#define MSG_ERR_LINE_NO2                    " Got: "
126 127
 #define MSG_ERR_CHECKSUM_MISMATCH           "checksum mismatch, Last Line: "
127 128
 #define MSG_ERR_NO_CHECKSUM                 "No Checksum with line number, Last Line: "
128 129
 #define MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM "No Line Number with checksum, Last Line: "
@@ -209,7 +210,7 @@
209 210
 #define MSG_OK_B                            "ok B:"
210 211
 #define MSG_OK_T                            "ok T:"
211 212
 #define MSG_AT                              " @:"
212
-#define MSG_PID_AUTOTUNE_FINISHED           MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"
213
+#define MSG_PID_AUTOTUNE_FINISHED           MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h"
213 214
 #define MSG_PID_DEBUG                       " PID_DEBUG "
214 215
 #define MSG_PID_DEBUG_INPUT                 ": Input "
215 216
 #define MSG_PID_DEBUG_OUTPUT                " Output "

Marlin/DOGMbitmaps.h → Marlin/dogm_bitmaps.h View File


+ 1
- 1
Marlin/dogm_lcd_implementation.h View File

@@ -29,7 +29,7 @@
29 29
 #endif
30 30
 
31 31
 #include <U8glib.h>
32
-#include "DOGMbitmaps.h"
32
+#include "dogm_bitmaps.h"
33 33
 
34 34
 #include "ultralcd.h"
35 35
 #include "ultralcd_st7920_u8glib_rrd.h"

+ 4
- 3
Marlin/example_configurations/Felix/Configuration.h View File

@@ -1,4 +1,4 @@
1
-#ifndef CONFIGURATION_H
1
+#ifndef CONFIGURATION_H
2 2
 #define CONFIGURATION_H
3 3
 
4 4
 #include "boards.h"
@@ -317,6 +317,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
317 317
 #define E_ENABLE_ON 0 // For all extruders
318 318
 
319 319
 // Disables axis when it's not being used.
320
+// WARNING: When motors turn off there is a chance of losing position accuracy!
320 321
 #define DISABLE_X false
321 322
 #define DISABLE_Y false
322 323
 #define DISABLE_Z false
@@ -594,9 +595,9 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
594 595
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
595 596
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
596 597
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
597
-//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
598 598
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
599
-                                               // 0 to disable buzzer feedback  
599
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000         // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
600
+                                                 // 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms>
600 601
 
601 602
 // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
602 603
 // http://reprap.org/wiki/PanelOne

+ 3
- 2
Marlin/example_configurations/Felix/Configuration_DUAL.h View File

@@ -317,6 +317,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
317 317
 #define E_ENABLE_ON 0 // For all extruders
318 318
 
319 319
 // Disables axis when it's not being used.
320
+// WARNING: When motors turn off there is a chance of losing position accuracy!
320 321
 #define DISABLE_X false
321 322
 #define DISABLE_Y false
322 323
 #define DISABLE_Z false
@@ -590,9 +591,9 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
590 591
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
591 592
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
592 593
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
593
-//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
594 594
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
595
-                                               // 0 to disable buzzer feedback  
595
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000         // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
596
+                                                 // 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms>
596 597
 
597 598
 // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
598 599
 // http://reprap.org/wiki/PanelOne

+ 4
- 3
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -1,4 +1,4 @@
1
-#ifndef CONFIGURATION_H
1
+#ifndef CONFIGURATION_H
2 2
 #define CONFIGURATION_H
3 3
 
4 4
 #include "boards.h"
@@ -338,6 +338,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
338 338
 #define E_ENABLE_ON 0 // For all extruders
339 339
 
340 340
 // Disables axis when it's not being used.
341
+// WARNING: When motors turn off there is a chance of losing position accuracy!
341 342
 #define DISABLE_X false
342 343
 #define DISABLE_Y false
343 344
 #define DISABLE_Z false
@@ -614,9 +615,9 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
614 615
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
615 616
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
616 617
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
617
-//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
618 618
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
619
-                                               // 0 to disable buzzer feedback  
619
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000         // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
620
+                                                 // 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms>
620 621
 
621 622
 // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
622 623
 // http://reprap.org/wiki/PanelOne

+ 4
- 3
Marlin/example_configurations/K8200/Configuration.h View File

@@ -1,4 +1,4 @@
1
-#ifndef CONFIGURATION_H
1
+#ifndef CONFIGURATION_H
2 2
 #define CONFIGURATION_H
3 3
 
4 4
 #include "boards.h"
@@ -375,6 +375,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
375 375
 #define E_ENABLE_ON 0 // For all extruders
376 376
 
377 377
 // Disables axis when it's not being used.
378
+// WARNING: When motors turn off there is a chance of losing position accuracy!
378 379
 #define DISABLE_X false
379 380
 #define DISABLE_Y false
380 381
 #define DISABLE_Z true
@@ -672,9 +673,9 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
672 673
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
673 674
 #define ULTIMAKERCONTROLLER // K8200: for Display VM8201 // as available from the Ultimaker online store.
674 675
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
675
-//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
676 676
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
677
-                                               // 0 to disable buzzer feedback  
677
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000         // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
678
+                                                 // 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms>
678 679
 
679 680
 // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
680 681
 // http://reprap.org/wiki/PanelOne

+ 4
- 3
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -1,4 +1,4 @@
1
-#ifndef CONFIGURATION_H
1
+#ifndef CONFIGURATION_H
2 2
 #define CONFIGURATION_H
3 3
 
4 4
 #include "boards.h"
@@ -369,6 +369,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
369 369
 #define E_ENABLE_ON 0 // For all extruders
370 370
 
371 371
 // Disables axis when it's not being used.
372
+// WARNING: When motors turn off there is a chance of losing position accuracy!
372 373
 #define DISABLE_X false
373 374
 #define DISABLE_Y false
374 375
 #define DISABLE_Z false
@@ -645,9 +646,9 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
645 646
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
646 647
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
647 648
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
648
-//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
649 649
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
650
-                                               // 0 to disable buzzer feedback  
650
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000         // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
651
+                                                 // 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms>
651 652
 
652 653
 // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
653 654
 // http://reprap.org/wiki/PanelOne

+ 4
- 3
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -1,4 +1,4 @@
1
-#ifndef CONFIGURATION_H
1
+#ifndef CONFIGURATION_H
2 2
 #define CONFIGURATION_H
3 3
 
4 4
 #include "boards.h"
@@ -337,6 +337,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
337 337
 #define E_ENABLE_ON 0 // For all extruders
338 338
 
339 339
 // Disables axis when it's not being used.
340
+// WARNING: When motors turn off there is a chance of losing position accuracy!
340 341
 #define DISABLE_X false
341 342
 #define DISABLE_Y false
342 343
 #define DISABLE_Z true
@@ -613,9 +614,9 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
613 614
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
614 615
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
615 616
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
616
-//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
617 617
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
618
-                                               // 0 to disable buzzer feedback  
618
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000         // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
619
+                                                 // 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms>
619 620
 
620 621
 // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
621 622
 // http://reprap.org/wiki/PanelOne

+ 4
- 3
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -1,4 +1,4 @@
1
-#ifndef CONFIGURATION_H
1
+#ifndef CONFIGURATION_H
2 2
 #define CONFIGURATION_H
3 3
 
4 4
 #include "boards.h"
@@ -367,6 +367,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
367 367
 #define E_ENABLE_ON 0 // For all extruders
368 368
 
369 369
 // Disables axis when it's not being used.
370
+// WARNING: When motors turn off there is a chance of losing position accuracy!
370 371
 #define DISABLE_X false
371 372
 #define DISABLE_Y false
372 373
 #define DISABLE_Z false
@@ -662,9 +663,9 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
662 663
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
663 664
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
664 665
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
665
-//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
666 666
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
667
-                                               // 0 to disable buzzer feedback  
667
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000         // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
668
+                                                 // 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms>
668 669
 
669 670
 // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
670 671
 // http://reprap.org/wiki/PanelOne

+ 4
- 3
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

@@ -1,4 +1,4 @@
1
-#ifndef CONFIGURATION_H
1
+#ifndef CONFIGURATION_H
2 2
 #define CONFIGURATION_H
3 3
 
4 4
 #include "boards.h"
@@ -367,6 +367,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
367 367
 #define E_ENABLE_ON 0 // For all extruders
368 368
 
369 369
 // Disables axis when it's not being used.
370
+// WARNING: When motors turn off there is a chance of losing position accuracy!
370 371
 #define DISABLE_X false
371 372
 #define DISABLE_Y false
372 373
 #define DISABLE_Z false
@@ -666,9 +667,9 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
666 667
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
667 668
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
668 669
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
669
-//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
670 670
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
671
-                                               // 0 to disable buzzer feedback  
671
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000         // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
672
+                                                 // 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms>
672 673
 
673 674
 // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
674 675
 // http://reprap.org/wiki/PanelOne

+ 4
- 3
Marlin/example_configurations/makibox/Configuration.h View File

@@ -1,4 +1,4 @@
1
-#ifndef CONFIGURATION_H
1
+#ifndef CONFIGURATION_H
2 2
 #define CONFIGURATION_H
3 3
 
4 4
 #include "boards.h"
@@ -337,6 +337,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
337 337
 #define E_ENABLE_ON 0 // For all extruders
338 338
 
339 339
 // Disables axis when it's not being used.
340
+// WARNING: When motors turn off there is a chance of losing position accuracy!
340 341
 #define DISABLE_X false
341 342
 #define DISABLE_Y false
342 343
 #define DISABLE_Z false
@@ -613,9 +614,9 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
613 614
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
614 615
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
615 616
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
616
-//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
617 617
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
618
-                                               // 0 to disable buzzer feedback  
618
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000         // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
619
+                                                 // 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms>
619 620
 
620 621
 // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
621 622
 // http://reprap.org/wiki/PanelOne

+ 4
- 3
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

@@ -1,4 +1,4 @@
1
-#ifndef CONFIGURATION_H
1
+#ifndef CONFIGURATION_H
2 2
 #define CONFIGURATION_H
3 3
 
4 4
 #include "boards.h"
@@ -339,6 +339,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
339 339
 #define E_ENABLE_ON 1 // For all extruders
340 340
 
341 341
 // Disables axis when it's not being used.
342
+// WARNING: When motors turn off there is a chance of losing position accuracy!
342 343
 #define DISABLE_X false
343 344
 #define DISABLE_Y false
344 345
 #define DISABLE_Z false
@@ -619,9 +620,9 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
619 620
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
620 621
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
621 622
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
622
-//#define LCD_FEEDBACK_FREQUENCY_HZ 1000	// this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
623 623
 //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
624
-                                               // 0 to disable buzzer feedback  
624
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000         // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
625
+                                                 // 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms>
625 626
 
626 627
 // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
627 628
 // http://reprap.org/wiki/PanelOne

+ 20
- 1
Marlin/fonts/README.fonts View File

@@ -3,4 +3,23 @@ In Fony export the fonts to bdf-format. Maybe another one can edit them with Fon
3 3
 Then run make_fonts.bat what calls bdf2u8g.exe with the needed parameters to produce the .h files.
4 4
 The .h files must be edited to replace '#include "u8g.h"' with '#include <utility/u8g.h>', replace 'U8G_FONT_SECTION' with 'U8G_SECTION', insert '.progmem.' right behind the first '"' and moved to the main directory.
5 5
 
6
-Especially the Kana and Cyrillic fonts should be revised by someone who knows what he/she does. I am only a west-European with very little knowledge about this scripts.
6
+How to integrate a new font:
7
+Currently we are limited to 256 symbols per font. We use a menu system with 5 lines, on a display with 64 pixel height. That means we have 12 pixel for a line. To have some space in between the lines we can't use more then 10 pixel height for the symbols.
8
+We use fixed width fonts. To fit 22 Symbols on the 128 pixel wide screen, the symbols can't be wider than 5 pixel. Maybe you can work with half symbols - two places in the charset will than build one wide symbol.
9
+
10
+ * Get 'Fony.exe'
11
+ * Copy one of the existing *.fon files and work with this.
12
+ * Change the pixels. Don't change width or height.
13
+ * Export as *.bdf
14
+ * Use 'bdf2u8g.exe' to produce the *.h file. Examples for the existing fonts are in 'make_fonts.bat'
15
+ * Edit the produced .h file to match our needs. See hints in 'README.fonts' or the other 'dogm_font_data_.h' files.
16
+ * Make a new entry in the font list in 'dogm_lcd_implementation.h' before the '#else // fall back'
17
+    #elif defined( DISPLAY_CHARSET_NEWNAME )
18
+      #include "dogm_font_data_yourfont.h"
19
+      #define FONT_MENU_NAME YOURFONTNAME
20
+    #else // fall-back
21
+ * Add your font to the list of permitted fonts in 'language_en.h'
22
+    ... || defined(DISPLAY_CHARSET_YOUR_NEW_FONT) ... )
23
+
24
+
25
+Especially the Kana font should be revised by someone who knows what he/she does. I am only a west-European with very little knowledge about this script.

+ 3
- 2
Marlin/language.h View File

@@ -122,7 +122,8 @@
122 122
 #define MSG_PLANNER_BUFFER_BYTES            "  PlannerBufferBytes: "
123 123
 #define MSG_OK                              "ok"
124 124
 #define MSG_FILE_SAVED                      "Done saving file."
125
-#define MSG_ERR_LINE_NO                     "Line Number is not Last Line Number+1, Last Line: "
125
+#define MSG_ERR_LINE_NO1                    "Line Number out of sequence. Expected: "
126
+#define MSG_ERR_LINE_NO2                    " Got: "
126 127
 #define MSG_ERR_CHECKSUM_MISMATCH           "checksum mismatch, Last Line: "
127 128
 #define MSG_ERR_NO_CHECKSUM                 "No Checksum with line number, Last Line: "
128 129
 #define MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM "No Line Number with checksum, Last Line: "
@@ -209,7 +210,7 @@
209 210
 #define MSG_OK_B                            "ok B:"
210 211
 #define MSG_OK_T                            "ok T:"
211 212
 #define MSG_AT                              " @:"
212
-#define MSG_PID_AUTOTUNE_FINISHED           MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"
213
+#define MSG_PID_AUTOTUNE_FINISHED           MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h"
213 214
 #define MSG_PID_DEBUG                       " PID_DEBUG "
214 215
 #define MSG_PID_DEBUG_INPUT                 ": Input "
215 216
 #define MSG_PID_DEBUG_OUTPUT                " Output "

+ 1
- 3
Marlin/pins_AZTEEG_X3.h View File

@@ -28,9 +28,7 @@
28 28
    #define STAT_LED_RED 64
29 29
    #define STAT_LED_BLUE 63
30 30
   #endif
31
-#endif
32
-
33
-#elif define TEMP_STAT_LEDS
31
+#elif defined(TEMP_STAT_LEDS)
34 32
   #define STAT_LED_RED       6
35 33
   #define STAT_LED_BLUE     11
36 34
 #endif

+ 1
- 1
Marlin/pins_SAV_MKI.h View File

@@ -82,7 +82,7 @@
82 82
   #define HOME_PIN          -1 // A4 = marlin 44 - teensy = 42
83 83
 
84 84
   #ifdef NUM_SERVOS
85
-    #define SERVO0_PIN       41 // In teensy's pin definition for pinMode (in Servo.cpp)
85
+    #define SERVO0_PIN       41 // In teensy's pin definition for pinMode (in servo.cpp)
86 86
   #endif
87 87
 
88 88
 #endif // SAV_3DLCD

+ 92
- 60
Marlin/stepper.cpp View File

@@ -46,7 +46,7 @@ block_t *current_block;  // A pointer to the block currently being traced
46 46
 
47 47
 // Variables used by The Stepper Driver Interrupt
48 48
 static unsigned char out_bits;        // The next stepping-bits to be output
49
-static unsigned int cleaning_buffer_counter;  
49
+static unsigned int cleaning_buffer_counter;
50 50
 
51 51
 #ifdef Z_DUAL_ENDSTOPS
52 52
   static bool performing_homing = false, 
@@ -54,7 +54,7 @@ static unsigned int cleaning_buffer_counter;
54 54
               locked_z2_motor = false;
55 55
 #endif
56 56
 
57
-// Counter variables for the bresenham line tracer
57
+// Counter variables for the Bresenham line tracer
58 58
 static long counter_x, counter_y, counter_z, counter_e;
59 59
 volatile static unsigned long step_events_completed; // The number of step events executed in the current block
60 60
 
@@ -66,7 +66,7 @@ volatile static unsigned long step_events_completed; // The number of step event
66 66
 
67 67
 static long acceleration_time, deceleration_time;
68 68
 //static unsigned long accelerate_until, decelerate_after, acceleration_rate, initial_rate, final_rate, nominal_rate;
69
-static unsigned short acc_step_rate; // needed for deccelaration start point
69
+static unsigned short acc_step_rate; // needed for deceleration start point
70 70
 static char step_loops;
71 71
 static unsigned short OCR1A_nominal;
72 72
 static unsigned short step_loops_nominal;
@@ -205,8 +205,14 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 };
205 205
 // intRes = longIn1 * longIn2 >> 24
206 206
 // uses:
207 207
 // r26 to store 0
208
-// r27 to store the byte 1 of the 48bit result
209
-#define MultiU24X24toH16(intRes, longIn1, longIn2) \
208
+// r27 to store bits 16-23 of the 48bit result. The top bit is used to round the two byte result.
209
+// note that the lower two bytes and the upper byte of the 48bit result are not calculated.
210
+// this can cause the result to be out by one as the lower bytes may cause carries into the upper ones.
211
+// B0 A0 are bits 24-39 and are the returned value
212
+// C1 B1 A1 is longIn1
213
+// D2 C2 B2 A2 is longIn2
214
+//
215
+#define MultiU24X32toH16(intRes, longIn1, longIn2) \
210 216
   asm volatile ( \
211 217
     "clr r26 \n\t" \
212 218
     "mul %A1, %B2 \n\t" \
@@ -237,6 +243,11 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 };
237 243
     "lsr r27 \n\t" \
238 244
     "adc %A0, r26 \n\t" \
239 245
     "adc %B0, r26 \n\t" \
246
+    "mul %D2, %A1 \n\t" \
247
+    "add %A0, r0 \n\t" \
248
+    "adc %B0, r1 \n\t" \
249
+    "mul %D2, %B1 \n\t" \
250
+    "add %B0, r0 \n\t" \
240 251
     "clr r1 \n\t" \
241 252
     : \
242 253
     "=&r" (intRes) \
@@ -274,8 +285,8 @@ void checkHitEndstops() {
274 285
     }
275 286
     #ifdef Z_PROBE_ENDSTOP
276 287
     if (endstop_z_probe_hit) {
277
-    	SERIAL_ECHOPAIR(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
278
-    	LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "ZP");
288
+      SERIAL_ECHOPAIR(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
289
+      LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "ZP");
279 290
     }
280 291
     #endif
281 292
     SERIAL_EOL;
@@ -313,7 +324,7 @@ void enable_endstops(bool check) { check_endstops = check; }
313 324
 //  The trapezoid is the shape the speed curve over time. It starts at block->initial_rate, accelerates
314 325
 //  first block->accelerate_until step_events_completed, then keeps going at constant speed until
315 326
 //  step_events_completed reaches block->decelerate_after after which it decelerates until the trapezoid generator is reset.
316
-//  The slope of acceleration is calculated with the leib ramp alghorithm.
327
+//  The slope of acceleration is calculated using v = u + at where t is the accumulated timer values of the steps so far.
317 328
 
318 329
 void st_wake_up() {
319 330
   //  TCNT1 = 0;
@@ -400,7 +411,7 @@ ISR(TIMER1_COMPA_vect) {
400 411
     OCR1A = 200;
401 412
     return;
402 413
   }
403
-  
414
+
404 415
   // If there is no current block, attempt to pop one from the buffer
405 416
   if (!current_block) {
406 417
     // Anything in the buffer?
@@ -452,14 +463,22 @@ ISR(TIMER1_COMPA_vect) {
452 463
       count_direction[Y_AXIS] = 1;
453 464
     }
454 465
 
466
+    #define _ENDSTOP(axis, minmax) axis ##_## minmax ##_endstop
467
+    #define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
468
+    #define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING
469
+    #define _OLD_ENDSTOP(axis, minmax) old_## axis ##_## minmax ##_endstop
470
+    #define _AXIS(AXIS) AXIS ##_AXIS
471
+    #define _ENDSTOP_HIT(axis) endstop_## axis ##_hit
472
+
455 473
     #define UPDATE_ENDSTOP(axis,AXIS,minmax,MINMAX) \
456
-      bool axis ##_## minmax ##_endstop = (READ(AXIS ##_## MINMAX ##_PIN) != AXIS ##_## MINMAX ##_ENDSTOP_INVERTING); \
457
-      if (axis ##_## minmax ##_endstop && old_## axis ##_## minmax ##_endstop && (current_block->steps[AXIS ##_AXIS] > 0)) { \
458
-        endstops_trigsteps[AXIS ##_AXIS] = count_position[AXIS ##_AXIS]; \
459
-        endstop_## axis ##_hit = true; \
474
+      bool _ENDSTOP(axis, minmax) = (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)); \
475
+      if (_ENDSTOP(axis, minmax) && _OLD_ENDSTOP(axis, minmax) && (current_block->steps[_AXIS(AXIS)] > 0)) { \
476
+        endstops_trigsteps[_AXIS(AXIS)] = count_position[_AXIS(AXIS)]; \
477
+        _ENDSTOP_HIT(axis) = true; \
460 478
         step_events_completed = current_block->step_event_count; \
461 479
       } \
462
-      old_## axis ##_## minmax ##_endstop = axis ##_## minmax ##_endstop;
480
+      _OLD_ENDSTOP(axis, minmax) = _ENDSTOP(axis, minmax);
481
+
463 482
 
464 483
     // Check X and Y endstops
465 484
     if (check_endstops) {
@@ -469,13 +488,13 @@ ISR(TIMER1_COMPA_vect) {
469 488
         if ((current_block->steps[A_AXIS] != current_block->steps[B_AXIS]) || (TEST(out_bits, A_AXIS) == TEST(out_bits, B_AXIS))) {
470 489
           if (TEST(out_bits, X_HEAD))
471 490
       #else
472
-          if (TEST(out_bits, X_AXIS))   // stepping along -X axis (regular cartesians bot)
491
+          if (TEST(out_bits, X_AXIS))   // stepping along -X axis (regular Cartesian bot)
473 492
       #endif
474 493
           { // -direction
475 494
             #ifdef DUAL_X_CARRIAGE
476 495
               // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
477 496
               if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
478
-            #endif          
497
+            #endif
479 498
               {
480 499
                 #if HAS_X_MIN
481 500
                   UPDATE_ENDSTOP(x, X, min, MIN);
@@ -561,14 +580,14 @@ ISR(TIMER1_COMPA_vect) {
561 580
           z_probe_endstop=(READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
562 581
           if(z_probe_endstop && old_z_probe_endstop)
563 582
           {
564
-        	  endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
565
-        	  endstop_z_probe_hit=true;
583
+            endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
584
+            endstop_z_probe_hit=true;
566 585
 
567
-//        	  if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
586
+//            if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
568 587
           }
569 588
           old_z_probe_endstop = z_probe_endstop;
570 589
         #endif
571
-        
590
+
572 591
       } // check_endstops
573 592
 
574 593
     }
@@ -614,15 +633,15 @@ ISR(TIMER1_COMPA_vect) {
614 633
           #endif // !Z_DUAL_ENDSTOPS
615 634
 
616 635
         #endif // Z_MAX_PIN
617
-        
636
+
618 637
         #ifdef Z_PROBE_ENDSTOP
619 638
           UPDATE_ENDSTOP(z, Z, probe, PROBE);
620 639
           z_probe_endstop=(READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
621 640
           if(z_probe_endstop && old_z_probe_endstop)
622 641
           {
623
-        	  endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
624
-        	  endstop_z_probe_hit=true;
625
-//        	  if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
642
+            endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
643
+            endstop_z_probe_hit=true;
644
+//            if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
626 645
           }
627 646
           old_z_probe_endstop = z_probe_endstop;
628 647
         #endif
@@ -656,6 +675,11 @@ ISR(TIMER1_COMPA_vect) {
656 675
         }
657 676
       #endif //ADVANCE
658 677
 
678
+      #define _COUNTER(axis) counter_## axis
679
+      #define _WRITE_STEP(AXIS, HIGHLOW) AXIS ##_STEP_WRITE(HIGHLOW)
680
+      #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP
681
+      #define _INVERT_STEP_PIN(AXIS) INVERT_## AXIS ##_STEP_PIN
682
+
659 683
       #ifdef CONFIG_STEPPERS_TOSHIBA
660 684
         /**
661 685
          * The Toshiba stepper controller require much longer pulses.
@@ -664,8 +688,8 @@ ISR(TIMER1_COMPA_vect) {
664 688
          * lag to allow it work with without needing NOPs
665 689
          */
666 690
         #define STEP_ADD(axis, AXIS) \
667
-         counter_## axis += current_block->steps[AXIS ##_AXIS]; \
668
-         if (counter_## axis > 0) { AXIS ##_STEP_WRITE(HIGH); }
691
+         _COUNTER(axis) += current_block->steps[_AXIS(AXIS)]; \
692
+         if (_COUNTER(axis) > 0) { _WRITE_STEP(AXIS, HIGH); }
669 693
         STEP_ADD(x,X);
670 694
         STEP_ADD(y,Y);
671 695
         STEP_ADD(z,Z);
@@ -674,10 +698,10 @@ ISR(TIMER1_COMPA_vect) {
674 698
         #endif
675 699
 
676 700
         #define STEP_IF_COUNTER(axis, AXIS) \
677
-          if (counter_## axis > 0) { \
678
-            counter_## axis -= current_block->step_event_count; \
679
-            count_position[AXIS ##_AXIS] += count_direction[AXIS ##_AXIS]; \
680
-            AXIS ##_STEP_WRITE(LOW); \
701
+          if (_COUNTER(axis) > 0) { \
702
+            _COUNTER(axis) -= current_block->step_event_count; \
703
+            count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \
704
+            _WRITE_STEP(AXIS, LOW); \
681 705
           }
682 706
 
683 707
         STEP_IF_COUNTER(x, X);
@@ -690,12 +714,12 @@ ISR(TIMER1_COMPA_vect) {
690 714
       #else // !CONFIG_STEPPERS_TOSHIBA
691 715
 
692 716
         #define APPLY_MOVEMENT(axis, AXIS) \
693
-          counter_## axis += current_block->steps[AXIS ##_AXIS]; \
694
-          if (counter_## axis > 0) { \
695
-            AXIS ##_APPLY_STEP(!INVERT_## AXIS ##_STEP_PIN,0); \
696
-            counter_## axis -= current_block->step_event_count; \
697
-            count_position[AXIS ##_AXIS] += count_direction[AXIS ##_AXIS]; \
698
-            AXIS ##_APPLY_STEP(INVERT_## AXIS ##_STEP_PIN,0); \
717
+          _COUNTER(axis) += current_block->steps[_AXIS(AXIS)]; \
718
+          if (_COUNTER(axis) > 0) { \
719
+            _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS),0); \
720
+            _COUNTER(axis) -= current_block->step_event_count; \
721
+            count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \
722
+            _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS),0); \
699 723
           }
700 724
 
701 725
         APPLY_MOVEMENT(x, X);
@@ -714,7 +738,7 @@ ISR(TIMER1_COMPA_vect) {
714 738
     unsigned short step_rate;
715 739
     if (step_events_completed <= (unsigned long)current_block->accelerate_until) {
716 740
 
717
-      MultiU24X24toH16(acc_step_rate, acceleration_time, current_block->acceleration_rate);
741
+      MultiU24X32toH16(acc_step_rate, acceleration_time, current_block->acceleration_rate);
718 742
       acc_step_rate += current_block->initial_rate;
719 743
 
720 744
       // upper limit
@@ -737,7 +761,7 @@ ISR(TIMER1_COMPA_vect) {
737 761
       #endif
738 762
     }
739 763
     else if (step_events_completed > (unsigned long)current_block->decelerate_after) {
740
-      MultiU24X24toH16(step_rate, deceleration_time, current_block->acceleration_rate);
764
+      MultiU24X32toH16(step_rate, deceleration_time, current_block->acceleration_rate);
741 765
 
742 766
       if (step_rate > acc_step_rate) { // Check step_rate stays positive
743 767
         step_rate = current_block->final_rate;
@@ -863,7 +887,7 @@ void st_init() {
863 887
   #ifdef HAVE_L6470DRIVER
864 888
     L6470_init();
865 889
   #endif
866
-  
890
+
867 891
   // Initialize Dir Pins
868 892
   #if HAS_X_DIR
869 893
     X_DIR_INIT;
@@ -909,11 +933,11 @@ void st_init() {
909 933
   #if HAS_Y_ENABLE
910 934
     Y_ENABLE_INIT;
911 935
     if (!Y_ENABLE_ON) Y_ENABLE_WRITE(HIGH);
912
-	
913
-	#if defined(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_ENABLE
914
-	  Y2_ENABLE_INIT;
915
-	  if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH);
916
-	#endif
936
+
937
+  #if defined(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_ENABLE
938
+    Y2_ENABLE_INIT;
939
+    if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH);
940
+  #endif
917 941
   #endif
918 942
   #if HAS_Z_ENABLE
919 943
     Z_ENABLE_INIT;
@@ -990,8 +1014,8 @@ void st_init() {
990 1014
     #ifdef ENDSTOPPULLUP_ZMAX
991 1015
       WRITE(Z2_MAX_PIN,HIGH);
992 1016
     #endif
993
-  #endif  
994
-  
1017
+  #endif
1018
+
995 1019
 #if (defined(Z_PROBE_PIN) && Z_PROBE_PIN >= 0) && defined(Z_PROBE_ENDSTOP) // Check for Z_PROBE_ENDSTOP so we don't pull a pin high unless it's to be used.
996 1020
   SET_INPUT(Z_PROBE_PIN);
997 1021
   #ifdef ENDSTOPPULLUP_ZPROBE
@@ -999,10 +1023,13 @@ void st_init() {
999 1023
   #endif
1000 1024
 #endif
1001 1025
 
1026
+  #define _STEP_INIT(AXIS) AXIS ##_STEP_INIT
1027
+  #define _DISABLE(axis) disable_## axis()
1028
+
1002 1029
   #define AXIS_INIT(axis, AXIS, PIN) \
1003
-    AXIS ##_STEP_INIT; \
1004
-    AXIS ##_STEP_WRITE(INVERT_## PIN ##_STEP_PIN); \
1005
-    disable_## axis()
1030
+    _STEP_INIT(AXIS); \
1031
+    _WRITE_STEP(AXIS, _INVERT_STEP_PIN(PIN)); \
1032
+    _DISABLE(axis)
1006 1033
 
1007 1034
   #define E_AXIS_INIT(NUM) AXIS_INIT(e## NUM, E## NUM, E)
1008 1035
 
@@ -1135,14 +1162,19 @@ void quickStop() {
1135 1162
   // No other ISR should ever interrupt this!
1136 1163
   void babystep(const uint8_t axis, const bool direction) {
1137 1164
 
1165
+    #define _ENABLE(axis) enable_## axis()
1166
+    #define _READ_DIR(AXIS) AXIS ##_DIR_READ
1167
+    #define _INVERT_DIR(AXIS) INVERT_## AXIS ##_DIR
1168
+    #define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true)
1169
+
1138 1170
     #define BABYSTEP_AXIS(axis, AXIS, INVERT) { \
1139
-        enable_## axis(); \
1140
-        uint8_t old_pin = AXIS ##_DIR_READ; \
1141
-        AXIS ##_APPLY_DIR(INVERT_## AXIS ##_DIR^direction^INVERT, true); \
1142
-        AXIS ##_APPLY_STEP(!INVERT_## AXIS ##_STEP_PIN, true); \
1143
-        _delay_us(1U); \
1144
-        AXIS ##_APPLY_STEP(INVERT_## AXIS ##_STEP_PIN, true); \
1145
-        AXIS ##_APPLY_DIR(old_pin, true); \
1171
+        _ENABLE(axis); \
1172
+        uint8_t old_pin = _READ_DIR(AXIS); \
1173
+        _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^direction^INVERT); \
1174
+        _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \
1175
+        delayMicroseconds(2); \
1176
+        _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \
1177
+        _APPLY_DIR(AXIS, old_pin); \
1146 1178
       }
1147 1179
 
1148 1180
     switch(axis) {
@@ -1154,7 +1186,7 @@ void quickStop() {
1154 1186
       case Y_AXIS:
1155 1187
         BABYSTEP_AXIS(y, Y, false);
1156 1188
         break;
1157
-     
1189
+ 
1158 1190
       case Z_AXIS: {
1159 1191
 
1160 1192
         #ifndef DELTA
@@ -1179,7 +1211,7 @@ void quickStop() {
1179 1211
           X_STEP_WRITE(!INVERT_X_STEP_PIN);
1180 1212
           Y_STEP_WRITE(!INVERT_Y_STEP_PIN);
1181 1213
           Z_STEP_WRITE(!INVERT_Z_STEP_PIN);
1182
-          _delay_us(1U);
1214
+          delayMicroseconds(2);
1183 1215
           X_STEP_WRITE(INVERT_X_STEP_PIN); 
1184 1216
           Y_STEP_WRITE(INVERT_Y_STEP_PIN); 
1185 1217
           Z_STEP_WRITE(INVERT_Z_STEP_PIN);
@@ -1191,7 +1223,7 @@ void quickStop() {
1191 1223
         #endif
1192 1224
 
1193 1225
       } break;
1194
-     
1226
+ 
1195 1227
       default: break;
1196 1228
     }
1197 1229
   }
@@ -1255,7 +1287,7 @@ void microstep_init() {
1255 1287
 
1256 1288
   #if HAS_MICROSTEPS
1257 1289
     pinMode(X_MS1_PIN,OUTPUT);
1258
-    pinMode(X_MS2_PIN,OUTPUT);  
1290
+    pinMode(X_MS2_PIN,OUTPUT);
1259 1291
     pinMode(Y_MS1_PIN,OUTPUT);
1260 1292
     pinMode(Y_MS2_PIN,OUTPUT);
1261 1293
     pinMode(Z_MS1_PIN,OUTPUT);

+ 3
- 0
Marlin/temperature.cpp View File

@@ -341,6 +341,9 @@ void PID_autotune(float temp, int extruder, int ncycles)
341 341
     }
342 342
     if (cycles > ncycles) {
343 343
       SERIAL_PROTOCOLLNPGM(MSG_PID_AUTOTUNE_FINISHED);
344
+      SERIAL_PROTOCOLPGM("#define  DEFAULT_Kp "); SERIAL_PROTOCOLLN(Kp);
345
+      SERIAL_PROTOCOLPGM("#define  DEFAULT_Ki "); SERIAL_PROTOCOLLN(Ki);
346
+      SERIAL_PROTOCOLPGM("#define  DEFAULT_Kd "); SERIAL_PROTOCOLLN(Kd);
344 347
       return;
345 348
     }
346 349
     lcd_update();

+ 54
- 52
Marlin/ultralcd.cpp View File

@@ -5,7 +5,7 @@
5 5
 #include "cardreader.h"
6 6
 #include "temperature.h"
7 7
 #include "stepper.h"
8
-#include "ConfigurationStore.h"
8
+#include "configuration_store.h"
9 9
 
10 10
 int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */
11 11
 
@@ -267,28 +267,28 @@ static void lcd_status_screen() {
267 267
   #ifdef LCD_PROGRESS_BAR
268 268
     millis_t ms = millis();
269 269
     #ifndef PROGRESS_MSG_ONCE
270
-      if (ms > progressBarTick + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME) {
271
-        progressBarTick = ms;
270
+      if (ms > progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME) {
271
+        progress_bar_ms = ms;
272 272
       }
273 273
     #endif
274 274
     #if PROGRESS_MSG_EXPIRE > 0
275 275
       // Handle message expire
276
-      if (expireStatusMillis > 0) {
276
+      if (expire_status_ms > 0) {
277 277
         if (card.isFileOpen()) {
278 278
           // Expire the message when printing is active
279 279
           if (IS_SD_PRINTING) {
280 280
             // Expire the message when printing is active
281
-            if (ms >= expireStatusMillis) {
281
+            if (ms >= expire_status_ms) {
282 282
               lcd_status_message[0] = '\0';
283
-              expireStatusMillis = 0;
283
+              expire_status_ms = 0;
284 284
             }
285 285
           }
286 286
           else {
287
-            expireStatusMillis += LCD_UPDATE_INTERVAL;
287
+            expire_status_ms += LCD_UPDATE_INTERVAL;
288 288
           }
289 289
         }
290 290
         else {
291
-          expireStatusMillis = 0;
291
+          expire_status_ms = 0;
292 292
         }
293 293
       }
294 294
     #endif
@@ -648,26 +648,26 @@ static void lcd_prepare_menu() {
648 648
 
649 649
 #endif // DELTA_CALIBRATION_MENU
650 650
 
651
-inline void line_to_current() {
651
+inline void line_to_current(AxisEnum axis) {
652 652
   #ifdef DELTA
653 653
     calculate_delta(current_position);
654
-    plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[X_AXIS]/60, active_extruder);
654
+    plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder);
655 655
   #else
656
-    plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[X_AXIS]/60, active_extruder);
656
+    plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder);
657 657
   #endif
658 658
 }
659 659
 
660 660
 float move_menu_scale;
661 661
 static void lcd_move_menu_axis();
662 662
 
663
-static void _lcd_move(const char *name, int axis, int min, int max) {
663
+static void _lcd_move(const char *name, AxisEnum axis, int min, int max) {
664 664
   if (encoderPosition != 0) {
665 665
     refresh_cmd_timeout();
666 666
     current_position[axis] += float((int)encoderPosition) * move_menu_scale;
667 667
     if (min_software_endstops && current_position[axis] < min) current_position[axis] = min;
668 668
     if (max_software_endstops && current_position[axis] > max) current_position[axis] = max;
669 669
     encoderPosition = 0;
670
-    line_to_current();
670
+    line_to_current(axis);
671 671
     lcdDrawUpdate = 1;
672 672
   }
673 673
   if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis]));
@@ -680,7 +680,7 @@ static void lcd_move_e() {
680 680
   if (encoderPosition != 0) {
681 681
     current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
682 682
     encoderPosition = 0;
683
-    line_to_current();
683
+    line_to_current(E_AXIS);
684 684
     lcdDrawUpdate = 1;
685 685
   }
686 686
   if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Extruder"), ftostr31(current_position[E_AXIS]));
@@ -1131,23 +1131,18 @@ void lcd_quick_feedback() {
1131 1131
     #endif    
1132 1132
     lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
1133 1133
   #elif defined(BEEPER) && BEEPER > -1
1134
-    SET_OUTPUT(BEEPER);
1135 1134
     #ifndef LCD_FEEDBACK_FREQUENCY_HZ
1136 1135
       #define LCD_FEEDBACK_FREQUENCY_HZ 5000
1137 1136
     #endif
1138 1137
     #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
1139 1138
       #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2
1140 1139
     #endif
1141
-    const uint16_t delay = 1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2;
1142
-    uint16_t i = LCD_FEEDBACK_FREQUENCY_DURATION_MS * LCD_FEEDBACK_FREQUENCY_HZ / 1000;
1143
-    while (i--) {
1144
-      WRITE(BEEPER,HIGH);
1145
-      delayMicroseconds(delay);
1146
-      WRITE(BEEPER,LOW);
1147
-      delayMicroseconds(delay);
1148
-    }
1149
-    const uint16_t j = max(10000 - LCD_FEEDBACK_FREQUENCY_DURATION_MS * 1000, 0);
1150
-    if (j) delayMicroseconds(j);
1140
+    lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
1141
+  #else
1142
+    #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
1143
+      #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2
1144
+    #endif
1145
+    delay(LCD_FEEDBACK_FREQUENCY_DURATION_MS);
1151 1146
   #endif
1152 1147
 }
1153 1148
 
@@ -1397,9 +1392,9 @@ void lcd_ignore_click(bool b) {
1397 1392
 
1398 1393
 void lcd_finishstatus(bool persist=false) {
1399 1394
   #ifdef LCD_PROGRESS_BAR
1400
-    progressBarTick = millis();
1395
+    progress_bar_ms = millis();
1401 1396
     #if PROGRESS_MSG_EXPIRE > 0
1402
-      expireStatusMillis = persist ? 0 : progressBarTick + PROGRESS_MSG_EXPIRE;
1397
+      expire_status_ms = persist ? 0 : progress_bar_ms + PROGRESS_MSG_EXPIRE;
1403 1398
     #endif
1404 1399
   #endif
1405 1400
   lcdDrawUpdate = 2;
@@ -1410,7 +1405,7 @@ void lcd_finishstatus(bool persist=false) {
1410 1405
 }
1411 1406
 
1412 1407
 #if defined(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
1413
-  void dontExpireStatus() { expireStatusMillis = 0; }
1408
+  void dontExpireStatus() { expire_status_ms = 0; }
1414 1409
 #endif
1415 1410
 
1416 1411
 void set_utf_strlen(char *s, uint8_t n) {
@@ -1423,6 +1418,8 @@ void set_utf_strlen(char *s, uint8_t n) {
1423 1418
   s[i] = 0;
1424 1419
 }
1425 1420
 
1421
+bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); }
1422
+
1426 1423
 void lcd_setstatus(const char* message, bool persist) {
1427 1424
   if (lcd_status_message_level > 0) return;
1428 1425
   strncpy(lcd_status_message, message, 3*LCD_WIDTH);
@@ -1544,9 +1541,20 @@ bool lcd_detected(void) {
1544 1541
 }
1545 1542
 
1546 1543
 void lcd_buzz(long duration, uint16_t freq) {
1547
-  #ifdef LCD_USE_I2C_BUZZER
1548
-    lcd.buzz(duration,freq);
1549
-  #endif
1544
+  if (freq > 0) {
1545
+    #if BEEPER > 0
1546
+      SET_OUTPUT(BEEPER);
1547
+      tone(BEEPER, freq, duration);
1548
+      delay(duration);
1549
+    #elif defined(LCD_USE_I2C_BUZZER)
1550
+      lcd.buzz(duration, freq);
1551
+    #else
1552
+      delay(duration);
1553
+    #endif
1554
+  }
1555
+  else {
1556
+    delay(duration);
1557
+  }
1550 1558
 }
1551 1559
 
1552 1560
 bool lcd_clicked() { return LCD_CLICKED; }
@@ -1798,7 +1806,7 @@ char *ftostr52(const float &x) {
1798 1806
       if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS) current_position[Z_AXIS] = Z_MIN_POS;
1799 1807
       if (max_software_endstops && current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS;
1800 1808
       encoderPosition = 0;
1801
-      line_to_current();
1809
+      line_to_current(Z_AXIS);
1802 1810
       lcdDrawUpdate = 2;
1803 1811
     }
1804 1812
     if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Z"), ftostr43(current_position[Z_AXIS]));
@@ -1806,48 +1814,44 @@ char *ftostr52(const float &x) {
1806 1814
     if (LCD_CLICKED) {
1807 1815
       if (!debounce_click) {
1808 1816
         debounce_click = true;
1809
-        int ix = _lcd_level_bed_position % MESH_NUM_X_POINTS;
1810
-        int iy = _lcd_level_bed_position / MESH_NUM_X_POINTS;
1811
-        if (iy&1) { // Zig zag
1812
-          ix = (MESH_NUM_X_POINTS - 1) - ix;
1813
-        }
1817
+        int ix = _lcd_level_bed_position % MESH_NUM_X_POINTS,
1818
+            iy = _lcd_level_bed_position / MESH_NUM_X_POINTS;
1819
+        if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // Zig zag
1814 1820
         mbl.set_z(ix, iy, current_position[Z_AXIS]);
1815 1821
         _lcd_level_bed_position++;
1816 1822
         if (_lcd_level_bed_position == MESH_NUM_X_POINTS*MESH_NUM_Y_POINTS) {
1817 1823
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
1818
-          line_to_current();
1824
+          line_to_current(Z_AXIS);
1819 1825
           mbl.active = 1;
1820 1826
           enqueuecommands_P(PSTR("G28"));
1821 1827
           lcd_return_to_status();
1822
-        } else {
1828
+        }
1829
+        else {
1823 1830
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
1824
-          line_to_current();
1831
+          line_to_current(Z_AXIS);
1825 1832
           ix = _lcd_level_bed_position % MESH_NUM_X_POINTS;
1826 1833
           iy = _lcd_level_bed_position / MESH_NUM_X_POINTS;
1827
-          if (iy&1) { // Zig zag
1828
-            ix = (MESH_NUM_X_POINTS - 1) - ix;
1829
-          }
1834
+          if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // Zig zag
1830 1835
           current_position[X_AXIS] = mbl.get_x(ix);
1831 1836
           current_position[Y_AXIS] = mbl.get_y(iy);
1832
-          line_to_current();
1837
+          line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS);
1833 1838
           lcdDrawUpdate = 2;
1834 1839
         }
1835 1840
       }
1836
-    } else {
1841
+    }
1842
+    else {
1837 1843
       debounce_click = false;
1838 1844
     }
1839 1845
   }
1840 1846
 
1841 1847
   static void _lcd_level_bed_homing() {
1842 1848
     if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("XYZ"), "Homing");
1843
-    if (axis_known_position[X_AXIS] &&
1844
-        axis_known_position[Y_AXIS] &&
1845
-        axis_known_position[Z_AXIS]) {
1849
+    if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]) {
1846 1850
       current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
1847 1851
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1848 1852
       current_position[X_AXIS] = MESH_MIN_X;
1849 1853
       current_position[Y_AXIS] = MESH_MIN_Y;
1850
-      line_to_current();
1854
+      line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS);
1851 1855
       _lcd_level_bed_position = 0;
1852 1856
       lcd_goto_menu(_lcd_level_bed);
1853 1857
     }
@@ -1855,9 +1859,7 @@ char *ftostr52(const float &x) {
1855 1859
   }
1856 1860
 
1857 1861
   static void lcd_level_bed() {
1858
-    axis_known_position[X_AXIS] = false;
1859
-    axis_known_position[Y_AXIS] = false;
1860
-    axis_known_position[Z_AXIS] = false;
1862
+    axis_known_position[X_AXIS] = axis_known_position[Y_AXIS] = axis_known_position[Z_AXIS] = false;
1861 1863
     mbl.reset();
1862 1864
     enqueuecommands_P(PSTR("G28"));
1863 1865
     lcdDrawUpdate = 2;

+ 4
- 2
Marlin/ultralcd.h View File

@@ -8,6 +8,7 @@
8 8
   int lcd_strlen_P(const char *s);
9 9
   void lcd_update();
10 10
   void lcd_init();
11
+  bool lcd_hasstatus();
11 12
   void lcd_setstatus(const char* message, const bool persist=false);
12 13
   void lcd_setstatuspgm(const char* message, const uint8_t level=0);
13 14
   void lcd_setalertstatuspgm(const char* message);
@@ -100,6 +101,7 @@
100 101
 #else //no LCD
101 102
   FORCE_INLINE void lcd_update() {}
102 103
   FORCE_INLINE void lcd_init() {}
104
+  FORCE_INLINE bool lcd_hasstatus() { return false; }
103 105
   FORCE_INLINE void lcd_setstatus(const char* message, const bool persist=false) {}
104 106
   FORCE_INLINE void lcd_setstatuspgm(const char* message, const uint8_t level=0) {}
105 107
   FORCE_INLINE void lcd_buttons_update() {}
@@ -107,8 +109,8 @@
107 109
   FORCE_INLINE void lcd_buzz(long duration,uint16_t freq) {}
108 110
   FORCE_INLINE bool lcd_detected(void) { return true; }
109 111
 
110
-  #define LCD_MESSAGEPGM(x) 
111
-  #define LCD_ALERTMESSAGEPGM(x) 
112
+  #define LCD_MESSAGEPGM(x) do{}while(0)
113
+  #define LCD_ALERTMESSAGEPGM(x) do{}while(0)
112 114
 
113 115
 #endif //ULTRA_LCD
114 116
 

+ 5
- 4
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -194,9 +194,9 @@
194 194
 #include "utf_mapper.h"
195 195
 
196 196
 #ifdef LCD_PROGRESS_BAR
197
-  static uint16_t progressBarTick = 0;
197
+  static millis_t progress_bar_ms = 0;
198 198
   #if PROGRESS_MSG_EXPIRE > 0
199
-    static uint16_t expireStatusMillis = 0;
199
+    static millis_t expire_status_ms = 0;
200 200
   #endif
201 201
   #define LCD_STR_PROGRESS  "\x03\x04\x05"
202 202
 #endif
@@ -588,8 +588,9 @@ static void lcd_implementation_status_screen() {
588 588
   #ifdef LCD_PROGRESS_BAR
589 589
 
590 590
     if (card.isFileOpen()) {
591
-      if (millis() >= progressBarTick + PROGRESS_BAR_MSG_TIME || !lcd_status_message[0]) {
592
-        // draw the progress bar
591
+      // Draw the progress bar if the message has shown long enough
592
+      // or if there is no message set.
593
+      if (millis() >= progress_bar_ms + PROGRESS_BAR_MSG_TIME || !lcd_status_message[0]) {
593 594
         int tix = (int)(card.percentDone() * LCD_WIDTH * 3) / 100,
594 595
           cel = tix / 3, rem = tix % 3, i = LCD_WIDTH;
595 596
         char msg[LCD_WIDTH+1], b = ' ';

+ 6
- 8
README.md View File

@@ -24,14 +24,13 @@ This firmware is a mashup between [Sprinter](https://github.com/kliment/Sprinter
24 24
 ## Current Status: Bug Fixing
25 25
 
26 26
 The Marlin development is currently revived. There's a long list of reported issues and pull requests, which we are working on currently.
27
-We are actively looking for testers. So please try the current development version and report new issues and feedback.
28 27
 
29 28
 [![Coverity Scan Build Status](https://scan.coverity.com/projects/2224/badge.svg)](https://scan.coverity.com/projects/2224)
30 29
 [![Travis Build Status](https://travis-ci.org/MarlinFirmware/Marlin.svg)](https://travis-ci.org/MarlinFirmware/Marlin)
31 30
 
32 31
 ## Contact
33 32
 
34
-__Google Hangout:__ <a href="https://plus.google.com/hangouts/_/g2wp5duzb2y6ahikg6tmwao3kua" target="_blank">Hangout</a>
33
+__Google Hangout:__ <a href="https://plus.google.com/hangouts/_/gxn3wrea5gdhoo223yimsiforia" target="_blank">Hangout</a>
35 34
 
36 35
 ## Credits
37 36
 
@@ -40,10 +39,9 @@ The current Marlin dev team consists of:
40 39
  - Scott Lahteine [@thinkyhead]
41 40
  - 
42 41
 
43
-Sprinters lead developers are Kliment and caru.
44
-Grbl's lead developer is Simen Svale Skogsrud.
45
-Sonney Jeon (Chamnit) improved some parts of grbl.
46
-A fork by bkubicek for the Ultimaker was merged.
42
+## Donation
43
+
44
+If you find our work usefull please consider donating. Donations will be used to pay for our website http://www.marlinfirmware.org/ and to pay some food or rent money for the very active Collaborators
47 45
 
48 46
 More features have been added by:
49 47
   - Lampmaker,
@@ -52,7 +50,7 @@ More features have been added by:
52 50
 
53 51
 ## License
54 52
 
55
-Marlin is published under the [GPL license](/Documentation/COPYING.md) because I believe in open development.
56
-Please do not use this code in products (3D printers, CNC etc) that are closed source or are crippled by a patent.
53
+Marlin is published under the [GPL license](/Documentation/COPYING.md) because We believe in open development.
54
+Do not use this code in products (3D printers, CNC etc) that are closed source or are crippled by a patent.
57 55
 
58 56
 [![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=ErikZalm&url=https://github.com/MarlinFirmware/Marlin&title=Marlin&language=&tags=github&category=software)

Loading…
Cancel
Save