Added compiletime check for added acceleration profile code

This commit is contained in:
Dietz0r
2024-01-04 00:30:18 +01:00
committed by GitHub
parent 860659f282
commit 4cc7aaf171
4 changed files with 9 additions and 0 deletions

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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
// ---