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
   - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR SERVO_ENDSTOP_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE
105
   - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR SERVO_ENDSTOP_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE
106
   - build_marlin
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
   - restore_configs
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
   - build_marlin
112
   - build_marlin
113
   #
113
   #
114
   # Test DUAL_X_CARRIAGE
114
   # Test DUAL_X_CARRIAGE

+ 10
- 0
Marlin/Configuration.h View File

749
 //
749
 //
750
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
762
 // @section temperature
753
 
763
 
754
 // Preheat Constants
764
 // Preheat Constants

+ 1
- 18
Marlin/M100_Free_Mem_Chk.cpp View File

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
 // Utility functions used by M100 to get its work done.
51
 // Utility functions used by M100 to get its work done.
68
 //
52
 //
69
 
53
 
176
   //
160
   //
177
 #if ENABLED(M100_FREE_MEMORY_CORRUPTOR)
161
 #if ENABLED(M100_FREE_MEMORY_CORRUPTOR)
178
   if (code_seen('C')) {
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
     SERIAL_ECHOLNPGM("Corrupting free memory block.\n");
164
     SERIAL_ECHOLNPGM("Corrupting free memory block.\n");
182
     ptr = (unsigned char*) __brkval;
165
     ptr = (unsigned char*) __brkval;
183
     SERIAL_ECHOPAIR("\n__brkval : ", ptr);
166
     SERIAL_ECHOPAIR("\n__brkval : ", ptr);

+ 6
- 3
Marlin/Marlin.h View File

217
 
217
 
218
 #define _AXIS(AXIS) AXIS ##_AXIS
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
 void enable_all_steppers();
223
 void enable_all_steppers();
221
 void disable_all_steppers();
224
 void disable_all_steppers();
222
 
225
 
288
 
291
 
289
 // GCode support for external objects
292
 // GCode support for external objects
290
 bool code_seen(char);
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
 #if ENABLED(DELTA)
298
 #if ENABLED(DELTA)
296
   extern float delta[3];
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
 //
732
 //
733
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
745
 // @section temperature
736
 
746
 
737
 // Preheat Constants
747
 // Preheat Constants

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

730
 //
730
 //
731
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
743
 // @section temperature
734
 
744
 
735
 // Preheat Constants
745
 // Preheat Constants

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

741
 //
741
 //
742
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
754
 // @section temperature
745
 
755
 
746
 // Preheat Constants
756
 // Preheat Constants

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

743
 //
743
 //
744
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
756
 // @section temperature
747
 
757
 
748
 // Preheat Constants
758
 // Preheat Constants

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

766
 //
766
 //
767
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
779
 // @section temperature
770
 
780
 
771
 // Preheat Constants
781
 // Preheat Constants

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

749
 //
749
 //
750
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
762
 // @section temperature
753
 
763
 
754
 // Preheat Constants
764
 // Preheat Constants

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

744
 //
744
 //
745
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
757
 // @section temperature
748
 
758
 
749
 // Preheat Constants
759
 // Preheat Constants

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

757
 //
757
 //
758
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
770
 // @section temperature
761
 
771
 
762
 // Preheat Constants
772
 // Preheat Constants

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

770
 //
770
 //
771
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
783
 // @section temperature
774
 
784
 
775
 // Preheat Constants
785
 // Preheat Constants

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

741
 //
741
 //
742
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
754
 // @section temperature
745
 
755
 
746
 // Preheat Constants
756
 // Preheat Constants

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

749
 //
749
 //
750
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
762
 // @section temperature
753
 
763
 
754
 // Preheat Constants
764
 // Preheat Constants

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

838
 //
838
 //
839
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
851
 // @section temperature
842
 
852
 
843
 // Preheat Constants
853
 // Preheat Constants

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

832
 //
832
 //
833
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
845
 // @section temperature
836
 
846
 
837
 // Preheat Constants
847
 // Preheat Constants

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

835
 //
835
 //
836
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
848
 // @section temperature
839
 
849
 
840
 // Preheat Constants
850
 // Preheat Constants

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

835
 //
835
 //
836
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
848
 // @section temperature
839
 
849
 
840
 // Preheat Constants
850
 // Preheat Constants

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

837
 //
837
 //
838
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
850
 // @section temperature
841
 
851
 
842
 // Preheat Constants
852
 // Preheat Constants

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

752
 //
752
 //
753
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
765
 // @section temperature
756
 
766
 
757
 // Preheat Constants
767
 // Preheat Constants

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

743
 //
743
 //
744
 //#define M100_FREE_MEMORY_WATCHER // uncomment to add the M100 Free Memory Watcher for debug purpose
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
 // @section temperature
756
 // @section temperature
747
 
757
 
748
 // Preheat Constants
758
 // Preheat Constants

+ 3
- 3
Marlin/planner.cpp View File

1155
 
1155
 
1156
   void Planner::autotemp_M109() {
1156
   void Planner::autotemp_M109() {
1157
     autotemp_enabled = code_seen('F');
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
 #endif
1163
 #endif

Loading…
Cancel
Save