Merge pull request #3005 from wavexx/remove_mres_limits

Allow all microstep resolutions for all axes
This commit is contained in:
Alex Voinea 2022-02-09 13:48:51 +01:00 committed by GitHub
commit e35b21569d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -8801,9 +8801,13 @@ Sigma_Exit:
if(code_seen(axis_codes[i]))
{
uint16_t res_new = code_value();
#ifdef ALLOW_ALL_MRES
bool res_valid = res_new > 0 && res_new <= 256 && !(res_new & (res_new - 1)); // must be a power of two
#else
bool res_valid = (res_new == 8) || (res_new == 16) || (res_new == 32); // resolutions valid for all axis
res_valid |= (i != E_AXIS) && ((res_new == 1) || (res_new == 2) || (res_new == 4)); // resolutions valid for X Y Z only
res_valid |= (i == E_AXIS) && ((res_new == 64) || (res_new == 128)); // resolutions valid for E only
#endif
if (res_valid)
{
st_synchronize();

View File

@ -224,6 +224,7 @@
#define TMC2130_INTPOL_XY 1 // extrapolate 256 for XY axes
#define TMC2130_INTPOL_Z 1 // extrapolate 256 for Z axis
#define TMC2130_INTPOL_E 1 // extrapolate 256 for E axis
// #define ALLOW_ALL_MRES
#define TMC2130_PWM_GRAD_X 2 // PWMCONF
#define TMC2130_PWM_AMPL_X 230 // PWMCONF

View File

@ -226,6 +226,7 @@
#define TMC2130_INTPOL_XY 1 // extrapolate 256 for XY axes
#define TMC2130_INTPOL_Z 1 // extrapolate 256 for Z axis
#define TMC2130_INTPOL_E 1 // extrapolate 256 for E axis
// #define ALLOW_ALL_MRES
#define TMC2130_PWM_GRAD_X 2 // PWMCONF
#define TMC2130_PWM_AMPL_X 230 // PWMCONF