Browse Source

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

pull/1/head
Bob-the-Kuhn 6 years ago
committed by Scott Lahteine
parent
commit
9656a82609
  1. 11
      .travis.yml
  2. 117
      Marlin/src/gcode/geometry/G53-G59.cpp
  3. 2
      Marlin/src/module/configuration_store.cpp

11
.travis.yml

@ -63,13 +63,13 @@ script:
- opt_set TEMP_SENSOR_1 1 - opt_set TEMP_SENSOR_1 1
- opt_set TEMP_SENSOR_BED 1 - opt_set TEMP_SENSOR_BED 1
- opt_set POWER_SUPPLY 1 - opt_set POWER_SUPPLY 1
- opt_enable PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS - opt_enable PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING
- opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS - opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS
- opt_enable BLINKM PCA9632 RGB_LED NEOPIXEL_LED AUTO_POWER_CONTROL NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR - opt_enable BLINKM PCA9632 RGB_LED NEOPIXEL_LED AUTO_POWER_CONTROL NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR
- opt_enable AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE - opt_enable AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE
- opt_enable_adv FWRETRACT MAX7219_DEBUG LED_CONTROL_MENU CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CODEPENDENT_XY_HOMING ADVANCED_PAUSE_FEATURE - opt_enable_adv ARC_P_CIRCLES ADVANCED_PAUSE_FEATURE CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS
- opt_set ABL_GRID_POINTS_X 16 - opt_enable_adv FWRETRACT MAX7219_DEBUG LED_CONTROL_MENU CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CODEPENDENT_XY_HOMING
- opt_set ABL_GRID_POINTS_Y 16 - opt_set GRID_MAX_POINTS_X 16
- opt_set_adv FANMUX0_PIN 53 - opt_set_adv FANMUX0_PIN 53
- build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM} - build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}
# #
@ -363,8 +363,7 @@ script:
- 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 - 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
- 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 - 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
- opt_set_adv I2C_SLAVE_ADDRESS 63 - opt_set_adv I2C_SLAVE_ADDRESS 63
- opt_set ABL_GRID_POINTS_X 16 - opt_set GRID_MAX_POINTS_X 16
- opt_set ABL_GRID_POINTS_Y 16
- build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM} - build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}
# #
# Test a Sled Z Probe with Linear leveling # Test a Sled Z Probe with Linear leveling

117
Marlin/src/gcode/geometry/G53-G59.cpp

@ -24,70 +24,71 @@
#include "../../module/motion.h" #include "../../module/motion.h"
#if ENABLED(CNC_COORDINATE_SYSTEMS) #if ENABLED(CNC_COORDINATE_SYSTEMS)
#include "../../module/stepper.h"
/** #include "../../module/stepper.h"
* Select a coordinate system and update the workspace offset.
* System index -1 is used to specify machine-native. /**
*/ * Select a coordinate system and update the workspace offset.
bool GcodeSuite::select_coordinate_system(const int8_t _new) { * System index -1 is used to specify machine-native.
if (active_coordinate_system == _new) return false; */
stepper.synchronize(); bool GcodeSuite::select_coordinate_system(const int8_t _new) {
float old_offset[XYZ] = { 0 }, new_offset[XYZ] = { 0 }; if (active_coordinate_system == _new) return false;
if (WITHIN(active_coordinate_system, 0, MAX_COORDINATE_SYSTEMS - 1)) stepper.synchronize();
COPY(old_offset, coordinate_system[active_coordinate_system]); float old_offset[XYZ] = { 0 }, new_offset[XYZ] = { 0 };
if (WITHIN(_new, 0, MAX_COORDINATE_SYSTEMS - 1)) if (WITHIN(active_coordinate_system, 0, MAX_COORDINATE_SYSTEMS - 1))
COPY(new_offset, coordinate_system[_new]); COPY(old_offset, coordinate_system[active_coordinate_system]);
active_coordinate_system = _new; if (WITHIN(_new, 0, MAX_COORDINATE_SYSTEMS - 1))
LOOP_XYZ(i) { COPY(new_offset, coordinate_system[_new]);
const float diff = new_offset[i] - old_offset[i]; active_coordinate_system = _new;
if (diff) { LOOP_XYZ(i) {
position_shift[i] += diff; const float diff = new_offset[i] - old_offset[i];
update_software_endstops((AxisEnum)i); if (diff) {
} position_shift[i] += diff;
update_software_endstops((AxisEnum)i);
} }
return true;
} }
return true;
}
/** /**
* G53: Apply native workspace to the current move * G53: Apply native workspace to the current move
* *
* In CNC G-code G53 is a modifier. * In CNC G-code G53 is a modifier.
* It precedes a movement command (or other modifiers) on the same line. * It precedes a movement command (or other modifiers) on the same line.
* This is the first command to use parser.chain() to make this possible. * This is the first command to use parser.chain() to make this possible.
* *
* Marlin also uses G53 on a line by itself to go back to native space. * Marlin also uses G53 on a line by itself to go back to native space.
*/ */
inline void gcode_G53() { inline void GcodeSuite::G53() {
const int8_t _system = active_coordinate_system; const int8_t _system = active_coordinate_system;
active_coordinate_system = -1; active_coordinate_system = -1;
if (parser.chain()) { // If this command has more following... if (parser.chain()) { // If this command has more following...
process_parsed_command(); process_parsed_command();
active_coordinate_system = _system; active_coordinate_system = _system;
}
} }
}
/** /**
* G54-G59.3: Select a new workspace * G54-G59.3: Select a new workspace
* *
* A workspace is an XYZ offset to the machine native space. * A workspace is an XYZ offset to the machine native space.
* All workspaces default to 0,0,0 at start, or with EEPROM * All workspaces default to 0,0,0 at start, or with EEPROM
* support they may be restored from a previous session. * support they may be restored from a previous session.
* *
* G92 is used to set the current workspace's offset. * G92 is used to set the current workspace's offset.
*/ */
void G54_59(uint8_t subcode=0) { void G54_59(uint8_t subcode=0) {
const int8_t _space = parser.codenum - 54 + subcode; const int8_t _space = parser.codenum - 54 + subcode;
if (gcode.select_coordinate_system(_space)) { if (gcode.select_coordinate_system(_space)) {
SERIAL_PROTOCOLLNPAIR("Select workspace ", _space); SERIAL_PROTOCOLLNPAIR("Select workspace ", _space);
report_current_position(); report_current_position();
}
} }
void GcodeSuite::G54() { G54_59(); } }
void GcodeSuite::G55() { G54_59(); } void GcodeSuite::G54() { G54_59(); }
void GcodeSuite::G56() { G54_59(); } void GcodeSuite::G55() { G54_59(); }
void GcodeSuite::G57() { G54_59(); } void GcodeSuite::G56() { G54_59(); }
void GcodeSuite::G58() { G54_59(); } void GcodeSuite::G57() { G54_59(); }
void GcodeSuite::G59() { G54_59(parser.subcode); } void GcodeSuite::G58() { G54_59(); }
void GcodeSuite::G59() { G54_59(parser.subcode); }
#endif // CNC_COORDINATE_SYSTEMS #endif // CNC_COORDINATE_SYSTEMS

2
Marlin/src/module/configuration_store.cpp

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

Loading…
Cancel
Save