Browse Source

Merge pull request #3985 from thinkyhead/rc_inch_fahrenheit_kelvin

Support inches, fahrenheit, and kelvin
Scott Lahteine 8 years ago
parent
commit
26f8f54c56

+ 2
- 2
.travis.yml View File

@@ -105,10 +105,10 @@ script:
105 105
   - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR SERVO_ENDSTOP_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE
106 106
   - build_marlin
107 107
   #
108
-  # Test EEPROM_SETTINGS & EEPROM_CHITCHAT
108
+  # Test EEPROM_SETTINGS, EEPROM_CHITCHAT, M100_FREE_MEMORY_WATCHER, INCH_MODE_SUPPORT, TEMPERATURE_UNITS_SUPPORT
109 109
   #
110 110
   - restore_configs
111
-  - opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT
111
+  - opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT M100_FREE_MEMORY_WATCHER INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT
112 112
   - build_marlin
113 113
   #
114 114
   # Test DUAL_X_CARRIAGE

+ 10
- 0
Marlin/Configuration.h View File

@@ -749,6 +749,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
749 749
 //
750 750
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
751 751
 
752
+//
753
+// G20/G21 Inch mode support
754
+//
755
+//#define INCH_MODE_SUPPORT
756
+
757
+//
758
+// M149 Set temperature units support
759
+//
760
+//#define TEMPERATURE_UNITS_SUPPORT
761
+
752 762
 // @section temperature
753 763
 
754 764
 // Preheat Constants

+ 1
- 18
Marlin/M100_Free_Mem_Chk.cpp View File

@@ -48,22 +48,6 @@ extern size_t  __heap_start, __heap_end, __flp;
48 48
 
49 49
 
50 50
 //
51
-// Declare all the functions we need from Marlin_Main.cpp to do the work!
52
-//
53
-
54
-float code_value();
55
-long code_value_long();
56
-bool code_seen(char);
57
-void serial_echopair_P(const char*, float);
58
-void serial_echopair_P(const char*, double);
59
-void serial_echopair_P(const char*, unsigned long);
60
-void serial_echopair_P(const char*, int);
61
-void serial_echopair_P(const char*, long);
62
-
63
-
64
-
65
-
66
-//
67 51
 // Utility functions used by M100 to get its work done.
68 52
 //
69 53
 
@@ -176,8 +160,7 @@ void gcode_M100() {
176 160
   //
177 161
 #if ENABLED(M100_FREE_MEMORY_CORRUPTOR)
178 162
   if (code_seen('C')) {
179
-    int x;      // x gets the # of locations to corrupt within the memory pool
180
-    x = code_value();
163
+    int x = code_value_int(); // x gets the # of locations to corrupt within the memory pool
181 164
     SERIAL_ECHOLNPGM("Corrupting free memory block.\n");
182 165
     ptr = (unsigned char*) __brkval;
183 166
     SERIAL_ECHOPAIR("\n__brkval : ", ptr);

+ 6
- 3
Marlin/Marlin.h View File

@@ -217,6 +217,9 @@ enum AxisEnum {NO_AXIS = -1, X_AXIS = 0, A_AXIS = 0, Y_AXIS = 1, B_AXIS = 1, Z_A
217 217
 
218 218
 #define _AXIS(AXIS) AXIS ##_AXIS
219 219
 
220
+typedef enum { LINEARUNIT_MM = 0, LINEARUNIT_INCH = 1 } LinearUnit;
221
+typedef enum { TEMPUNIT_C = 0, TEMPUNIT_K = 1, TEMPUNIT_F = 2 } TempUnit;
222
+
220 223
 void enable_all_steppers();
221 224
 void disable_all_steppers();
222 225
 
@@ -288,9 +291,9 @@ extern bool axis_homed[3]; // axis[n].is_homed
288 291
 
289 292
 // GCode support for external objects
290 293
 bool code_seen(char);
291
-float code_value();
292
-long code_value_long();
293
-int16_t code_value_short();
294
+int code_value_int();
295
+float code_value_temp_abs();
296
+float code_value_temp_diff();
294 297
 
295 298
 #if ENABLED(DELTA)
296 299
   extern float delta[3];

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


+ 10
- 0
Marlin/example_configurations/Felix/Configuration.h View File

@@ -732,6 +732,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
732 732
 //
733 733
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
734 734
 
735
+//
736
+// G20/G21 Inch mode support
737
+//
738
+//#define INCH_MODE_SUPPORT
739
+
740
+//
741
+// M149 Set temperature units support
742
+//
743
+//#define TEMPERATURE_UNITS_SUPPORT
744
+
735 745
 // @section temperature
736 746
 
737 747
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/Felix/DUAL/Configuration.h View File

@@ -730,6 +730,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
730 730
 //
731 731
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
732 732
 
733
+//
734
+// G20/G21 Inch mode support
735
+//
736
+//#define INCH_MODE_SUPPORT
737
+
738
+//
739
+// M149 Set temperature units support
740
+//
741
+//#define TEMPERATURE_UNITS_SUPPORT
742
+
733 743
 // @section temperature
734 744
 
735 745
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -741,6 +741,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
741 741
 //
742 742
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
743 743
 
744
+//
745
+// G20/G21 Inch mode support
746
+//
747
+//#define INCH_MODE_SUPPORT
748
+
749
+//
750
+// M149 Set temperature units support
751
+//
752
+//#define TEMPERATURE_UNITS_SUPPORT
753
+
744 754
 // @section temperature
745 755
 
746 756
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/Hephestos_2/Configuration.h View File

@@ -743,6 +743,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
743 743
 //
744 744
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
745 745
 
746
+//
747
+// G20/G21 Inch mode support
748
+//
749
+//#define INCH_MODE_SUPPORT
750
+
751
+//
752
+// M149 Set temperature units support
753
+//
754
+//#define TEMPERATURE_UNITS_SUPPORT
755
+
746 756
 // @section temperature
747 757
 
748 758
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/K8200/Configuration.h View File

@@ -766,6 +766,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
766 766
 //
767 767
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
768 768
 
769
+//
770
+// G20/G21 Inch mode support
771
+//
772
+//#define INCH_MODE_SUPPORT
773
+
774
+//
775
+// M149 Set temperature units support
776
+//
777
+//#define TEMPERATURE_UNITS_SUPPORT
778
+
769 779
 // @section temperature
770 780
 
771 781
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h View File

@@ -749,6 +749,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
749 749
 //
750 750
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
751 751
 
752
+//
753
+// G20/G21 Inch mode support
754
+//
755
+//#define INCH_MODE_SUPPORT
756
+
757
+//
758
+// M149 Set temperature units support
759
+//
760
+//#define TEMPERATURE_UNITS_SUPPORT
761
+
752 762
 // @section temperature
753 763
 
754 764
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/RigidBot/Configuration.h View File

@@ -744,6 +744,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
744 744
 //
745 745
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
746 746
 
747
+//
748
+// G20/G21 Inch mode support
749
+//
750
+//#define INCH_MODE_SUPPORT
751
+
752
+//
753
+// M149 Set temperature units support
754
+//
755
+//#define TEMPERATURE_UNITS_SUPPORT
756
+
747 757
 // @section temperature
748 758
 
749 759
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -757,6 +757,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
757 757
 //
758 758
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
759 759
 
760
+//
761
+// G20/G21 Inch mode support
762
+//
763
+//#define INCH_MODE_SUPPORT
764
+
765
+//
766
+// M149 Set temperature units support
767
+//
768
+//#define TEMPERATURE_UNITS_SUPPORT
769
+
760 770
 // @section temperature
761 771
 
762 772
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/TAZ4/Configuration.h View File

@@ -770,6 +770,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
770 770
 //
771 771
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
772 772
 
773
+//
774
+// G20/G21 Inch mode support
775
+//
776
+//#define INCH_MODE_SUPPORT
777
+
778
+//
779
+// M149 Set temperature units support
780
+//
781
+//#define TEMPERATURE_UNITS_SUPPORT
782
+
773 783
 // @section temperature
774 784
 
775 785
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -741,6 +741,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
741 741
 //
742 742
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
743 743
 
744
+//
745
+// G20/G21 Inch mode support
746
+//
747
+//#define INCH_MODE_SUPPORT
748
+
749
+//
750
+// M149 Set temperature units support
751
+//
752
+//#define TEMPERATURE_UNITS_SUPPORT
753
+
744 754
 // @section temperature
745 755
 
746 756
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/adafruit/ST7565/Configuration.h View File

@@ -749,6 +749,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
749 749
 //
750 750
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
751 751
 
752
+//
753
+// G20/G21 Inch mode support
754
+//
755
+//#define INCH_MODE_SUPPORT
756
+
757
+//
758
+// M149 Set temperature units support
759
+//
760
+//#define TEMPERATURE_UNITS_SUPPORT
761
+
752 762
 // @section temperature
753 763
 
754 764
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/delta/biv2.5/Configuration.h View File

@@ -838,6 +838,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
838 838
 //
839 839
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
840 840
 
841
+//
842
+// G20/G21 Inch mode support
843
+//
844
+//#define INCH_MODE_SUPPORT
845
+
846
+//
847
+// M149 Set temperature units support
848
+//
849
+//#define TEMPERATURE_UNITS_SUPPORT
850
+
841 851
 // @section temperature
842 852
 
843 853
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -832,6 +832,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
832 832
 //
833 833
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
834 834
 
835
+//
836
+// G20/G21 Inch mode support
837
+//
838
+//#define INCH_MODE_SUPPORT
839
+
840
+//
841
+// M149 Set temperature units support
842
+//
843
+//#define TEMPERATURE_UNITS_SUPPORT
844
+
835 845
 // @section temperature
836 846
 
837 847
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

@@ -835,6 +835,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
835 835
 //
836 836
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
837 837
 
838
+//
839
+// G20/G21 Inch mode support
840
+//
841
+//#define INCH_MODE_SUPPORT
842
+
843
+//
844
+// M149 Set temperature units support
845
+//
846
+//#define TEMPERATURE_UNITS_SUPPORT
847
+
838 848
 // @section temperature
839 849
 
840 850
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

@@ -835,6 +835,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
835 835
 //
836 836
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
837 837
 
838
+//
839
+// G20/G21 Inch mode support
840
+//
841
+//#define INCH_MODE_SUPPORT
842
+
843
+//
844
+// M149 Set temperature units support
845
+//
846
+//#define TEMPERATURE_UNITS_SUPPORT
847
+
838 848
 // @section temperature
839 849
 
840 850
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

@@ -837,6 +837,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
837 837
 //
838 838
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
839 839
 
840
+//
841
+// G20/G21 Inch mode support
842
+//
843
+//#define INCH_MODE_SUPPORT
844
+
845
+//
846
+// M149 Set temperature units support
847
+//
848
+//#define TEMPERATURE_UNITS_SUPPORT
849
+
840 850
 // @section temperature
841 851
 
842 852
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/makibox/Configuration.h View File

@@ -752,6 +752,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
752 752
 //
753 753
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
754 754
 
755
+//
756
+// G20/G21 Inch mode support
757
+//
758
+//#define INCH_MODE_SUPPORT
759
+
760
+//
761
+// M149 Set temperature units support
762
+//
763
+//#define TEMPERATURE_UNITS_SUPPORT
764
+
755 765
 // @section temperature
756 766
 
757 767
 // Preheat Constants

+ 10
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

@@ -743,6 +743,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
743 743
 //
744 744
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
745 745
 
746
+//
747
+// G20/G21 Inch mode support
748
+//
749
+//#define INCH_MODE_SUPPORT
750
+
751
+//
752
+// M149 Set temperature units support
753
+//
754
+//#define TEMPERATURE_UNITS_SUPPORT
755
+
746 756
 // @section temperature
747 757
 
748 758
 // Preheat Constants

+ 3
- 3
Marlin/planner.cpp View File

@@ -1155,9 +1155,9 @@ void Planner::reset_acceleration_rates() {
1155 1155
 
1156 1156
   void Planner::autotemp_M109() {
1157 1157
     autotemp_enabled = code_seen('F');
1158
-    if (autotemp_enabled) autotemp_factor = code_value();
1159
-    if (code_seen('S')) autotemp_min = code_value();
1160
-    if (code_seen('B')) autotemp_max = code_value();
1158
+    if (autotemp_enabled) autotemp_factor = code_value_temp_diff();
1159
+    if (code_seen('S')) autotemp_min = code_value_temp_abs();
1160
+    if (code_seen('B')) autotemp_max = code_value_temp_abs();
1161 1161
   }
1162 1162
 
1163 1163
 #endif

Loading…
Cancel
Save