mirror of
https://github.com/grblHAL/core.git
synced 2026-03-24 05:12:31 +08:00
Added compiletime check for added acceleration profile code
This commit is contained in:
1
config.h
1
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.
|
||||
|
||||
2
gcode.c
2
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
|
||||
|
||||
4
gcode.h
4
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
|
||||
|
||||
@@ -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
|
||||
|
||||
// ---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user