Procházet zdrojové kódy

Fix G53/CNC_COORDINATE_SYSTEMS compilation, Travis testing (#10227)

Bob-the-Kuhn před 6 roky
rodič
revize
9656a82609

+ 5
- 6
.travis.yml Zobrazit soubor

@@ -63,13 +63,13 @@ script:
63 63
   - opt_set TEMP_SENSOR_1 1
64 64
   - opt_set TEMP_SENSOR_BED 1
65 65
   - opt_set POWER_SUPPLY 1
66
-  - opt_enable PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS
66
+  - opt_enable PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING
67 67
   - opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS
68 68
   - opt_enable BLINKM PCA9632 RGB_LED NEOPIXEL_LED AUTO_POWER_CONTROL NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR
69 69
   - opt_enable AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE
70
-  - opt_enable_adv FWRETRACT MAX7219_DEBUG LED_CONTROL_MENU CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CODEPENDENT_XY_HOMING ADVANCED_PAUSE_FEATURE
71
-  - opt_set ABL_GRID_POINTS_X 16
72
-  - opt_set ABL_GRID_POINTS_Y 16
70
+  - opt_enable_adv ARC_P_CIRCLES ADVANCED_PAUSE_FEATURE CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS
71
+  - opt_enable_adv FWRETRACT MAX7219_DEBUG LED_CONTROL_MENU CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CODEPENDENT_XY_HOMING
72
+  - opt_set GRID_MAX_POINTS_X 16
73 73
   - opt_set_adv FANMUX0_PIN 53
74 74
   - build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}
75 75
   #
@@ -363,8 +363,7 @@ script:
363 363
   - opt_enable PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT M100_FREE_MEMORY_WATCHER
364 364
   - opt_enable_adv ADVANCED_PAUSE_FEATURE LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA PARK_HEAD_ON_PAUSE
365 365
   - opt_set_adv I2C_SLAVE_ADDRESS 63
366
-  - opt_set ABL_GRID_POINTS_X 16
367
-  - opt_set ABL_GRID_POINTS_Y 16
366
+  - opt_set GRID_MAX_POINTS_X 16
368 367
   - build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}
369 368
   #
370 369
   # Test a Sled Z Probe with Linear leveling

+ 59
- 58
Marlin/src/gcode/geometry/G53-G59.cpp Zobrazit soubor

@@ -24,70 +24,71 @@
24 24
 #include "../../module/motion.h"
25 25
 
26 26
 #if ENABLED(CNC_COORDINATE_SYSTEMS)
27
-  #include "../../module/stepper.h"
28 27
 
29
-  /**
30
-   * Select a coordinate system and update the workspace offset.
31
-   * System index -1 is used to specify machine-native.
32
-   */
33
-  bool GcodeSuite::select_coordinate_system(const int8_t _new) {
34
-    if (active_coordinate_system == _new) return false;
35
-    stepper.synchronize();
36
-    float old_offset[XYZ] = { 0 }, new_offset[XYZ] = { 0 };
37
-    if (WITHIN(active_coordinate_system, 0, MAX_COORDINATE_SYSTEMS - 1))
38
-      COPY(old_offset, coordinate_system[active_coordinate_system]);
39
-    if (WITHIN(_new, 0, MAX_COORDINATE_SYSTEMS - 1))
40
-      COPY(new_offset, coordinate_system[_new]);
41
-    active_coordinate_system = _new;
42
-    LOOP_XYZ(i) {
43
-      const float diff = new_offset[i] - old_offset[i];
44
-      if (diff) {
45
-        position_shift[i] += diff;
46
-        update_software_endstops((AxisEnum)i);
47
-      }
28
+#include "../../module/stepper.h"
29
+
30
+/**
31
+ * Select a coordinate system and update the workspace offset.
32
+ * System index -1 is used to specify machine-native.
33
+ */
34
+bool GcodeSuite::select_coordinate_system(const int8_t _new) {
35
+  if (active_coordinate_system == _new) return false;
36
+  stepper.synchronize();
37
+  float old_offset[XYZ] = { 0 }, new_offset[XYZ] = { 0 };
38
+  if (WITHIN(active_coordinate_system, 0, MAX_COORDINATE_SYSTEMS - 1))
39
+    COPY(old_offset, coordinate_system[active_coordinate_system]);
40
+  if (WITHIN(_new, 0, MAX_COORDINATE_SYSTEMS - 1))
41
+    COPY(new_offset, coordinate_system[_new]);
42
+  active_coordinate_system = _new;
43
+  LOOP_XYZ(i) {
44
+    const float diff = new_offset[i] - old_offset[i];
45
+    if (diff) {
46
+      position_shift[i] += diff;
47
+      update_software_endstops((AxisEnum)i);
48 48
     }
49
-    return true;
50 49
   }
50
+  return true;
51
+}
51 52
 
52
-  /**
53
-   * G53: Apply native workspace to the current move
54
-   *
55
-   * In CNC G-code G53 is a modifier.
56
-   * It precedes a movement command (or other modifiers) on the same line.
57
-   * This is the first command to use parser.chain() to make this possible.
58
-   *
59
-   * Marlin also uses G53 on a line by itself to go back to native space.
60
-   */
61
-  inline void gcode_G53() {
62
-    const int8_t _system = active_coordinate_system;
63
-    active_coordinate_system = -1;
64
-    if (parser.chain()) { // If this command has more following...
65
-      process_parsed_command();
66
-      active_coordinate_system = _system;
67
-    }
53
+/**
54
+ * G53: Apply native workspace to the current move
55
+ *
56
+ * In CNC G-code G53 is a modifier.
57
+ * It precedes a movement command (or other modifiers) on the same line.
58
+ * This is the first command to use parser.chain() to make this possible.
59
+ *
60
+ * Marlin also uses G53 on a line by itself to go back to native space.
61
+ */
62
+inline void GcodeSuite::G53() {
63
+  const int8_t _system = active_coordinate_system;
64
+  active_coordinate_system = -1;
65
+  if (parser.chain()) { // If this command has more following...
66
+    process_parsed_command();
67
+    active_coordinate_system = _system;
68 68
   }
69
+}
69 70
 
70
-  /**
71
-   * G54-G59.3: Select a new workspace
72
-   *
73
-   * A workspace is an XYZ offset to the machine native space.
74
-   * All workspaces default to 0,0,0 at start, or with EEPROM
75
-   * support they may be restored from a previous session.
76
-   *
77
-   * G92 is used to set the current workspace's offset.
78
-   */
79
-  void G54_59(uint8_t subcode=0) {
80
-    const int8_t _space = parser.codenum - 54 + subcode;
81
-    if (gcode.select_coordinate_system(_space)) {
82
-      SERIAL_PROTOCOLLNPAIR("Select workspace ", _space);
83
-      report_current_position();
84
-    }
71
+/**
72
+ * G54-G59.3: Select a new workspace
73
+ *
74
+ * A workspace is an XYZ offset to the machine native space.
75
+ * All workspaces default to 0,0,0 at start, or with EEPROM
76
+ * support they may be restored from a previous session.
77
+ *
78
+ * G92 is used to set the current workspace's offset.
79
+ */
80
+void G54_59(uint8_t subcode=0) {
81
+  const int8_t _space = parser.codenum - 54 + subcode;
82
+  if (gcode.select_coordinate_system(_space)) {
83
+    SERIAL_PROTOCOLLNPAIR("Select workspace ", _space);
84
+    report_current_position();
85 85
   }
86
-  void GcodeSuite::G54() { G54_59(); }
87
-  void GcodeSuite::G55() { G54_59(); }
88
-  void GcodeSuite::G56() { G54_59(); }
89
-  void GcodeSuite::G57() { G54_59(); }
90
-  void GcodeSuite::G58() { G54_59(); }
91
-  void GcodeSuite::G59() { G54_59(parser.subcode); }
86
+}
87
+void GcodeSuite::G54() { G54_59(); }
88
+void GcodeSuite::G55() { G54_59(); }
89
+void GcodeSuite::G56() { G54_59(); }
90
+void GcodeSuite::G57() { G54_59(); }
91
+void GcodeSuite::G58() { G54_59(); }
92
+void GcodeSuite::G59() { G54_59(parser.subcode); }
92 93
 
93 94
 #endif // CNC_COORDINATE_SYSTEMS

+ 1
- 1
Marlin/src/module/configuration_store.cpp Zobrazit soubor

@@ -851,7 +851,7 @@ void MarlinSettings::postprocess() {
851 851
     _FIELD_TEST(coordinate_system);
852 852
 
853 853
     #if ENABLED(CNC_COORDINATE_SYSTEMS)
854
-      EEPROM_WRITE(coordinate_system); // 27 floats
854
+      EEPROM_WRITE(gcode.coordinate_system); // 27 floats
855 855
     #else
856 856
       dummy = 0.0f;
857 857
       for (uint8_t q = MAX_COORDINATE_SYSTEMS * XYZ; q--;) EEPROM_WRITE(dummy);

Loading…
Zrušit
Uložit