diff --git a/config.h b/config.h index c5fbb7a..f4ad7bf 100644 --- a/config.h +++ b/config.h @@ -190,6 +190,7 @@ or EMI triggering the related interrupt falsely or too many times. // ADVANCED CONFIGURATION OPTIONS: #define ENABLE_PATH_BLENDING Off // Do NOT enable unless working on adding this feature! +#define ENABLE_ACCELERATION_PROFILES Off // Enable to allow G-Code changeable acceleration profiles. // Enables code for debugging purposes. Not for general use and always in constant flux. //#define DEBUG // Uncomment to enable. Default disabled. diff --git a/gcode.c b/gcode.c index 27e6e76..b83490d 100644 --- a/gcode.c +++ b/gcode.c @@ -1130,12 +1130,14 @@ status_code_t gc_execute_block (char *block) gc_block.modal.scaling_active = int_value == 51; break; +#if ENABLE_ACCELERATION_PROFILES case 187: word_bit.modal_group.G0 = On; gc_block.non_modal_command = (non_modal_t)int_value; if(mantissa != 0) FAIL(Status_GcodeUnsupportedCommand); break; +#endif default: FAIL(Status_GcodeUnsupportedCommand); // [Unsupported G command] } // end G-value switch diff --git a/gcode.h b/gcode.h index 3c19cb9..208535b 100644 --- a/gcode.h +++ b/gcode.h @@ -56,8 +56,12 @@ typedef enum { NonModal_SetCoordinateOffset = 92, //!< 92 - G92 NonModal_ResetCoordinateOffset = 102, //!< 102 - G92.1 NonModal_ClearCoordinateOffset = 112, //!< 112 - G92.2 + #if ENABLE_ACCELERATION_PROFILES NonModal_RestoreCoordinateOffset = 122, //!< 122 - G92.3 NonModal_SetAccelerationProfile = 187 //!< 187 - G187 + #else + NonModal_RestoreCoordinateOffset = 122 //!< 122 - G92.3 + #endif } non_modal_t; /*! Modal Group G1: Motion modes diff --git a/settings.c b/settings.c index d5827ac..fab733f 100644 --- a/settings.c +++ b/settings.c @@ -884,6 +884,7 @@ bool settings_override_acceleration (uint8_t axis, float acceleration, float jer return true; } +#if ENABLE_ACCELERATION_PROFILES //Acceleration Profiles for G187 P[x] in percent of maximum machine acceleration. float AccelerationProfile(uint8_t Profile) { static const float lookup[5] = { @@ -896,6 +897,7 @@ float AccelerationProfile(uint8_t Profile) { Profile = lookup[Profile]; return Profile; } +#endif // ---