Skip to content

Commit

Permalink
added option to ignore limits in rotation axis
Browse files Browse the repository at this point in the history
- added option to ignore limits in rotation axis
  • Loading branch information
Paciente8159 committed Jan 15, 2025
1 parent 1ed8542 commit 0b000ba
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 36 deletions.
8 changes: 8 additions & 0 deletions uCNC/cnc_hal_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ extern "C"
*/
// #define ENABLE_XY_SIMULTANEOUS_HOMING

/**
* Rotational axis - disable limits after homing
* Enable this option if you want to disable the limits for rotation axis to work
* allowing them to rotatle freely
*
*/
// #define DISABLE_ROTATIONAL_AXIS_LIMITS_AFTER_HOMING

/**
* Rotational axis - force relative distances
* Enable this option if you want the rotation axis to work in relative distance mode only
Expand Down
8 changes: 8 additions & 0 deletions uCNC/src/cnc_hal_config_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,14 @@ extern "C"
#define LIMITS_INV_MASK (LIMIT_X_INV_MASK | LIMIT_Y_INV_MASK | LIMIT_Z_INV_MASK | LIMIT_A_INV_MASK | LIMIT_B_INV_MASK | LIMIT_C_INV_MASK)
#define LIMITS_DUAL_INV_MASK (LIMIT_X2_INV_MASK | LIMIT_Y2_INV_MASK | LIMIT_Z2_INV_MASK)

#ifndef LIMITS_NORMAL_OPERATION_MASK
#ifdef DISABLE_ROTATIONAL_AXIS_LIMITS_AFTER_HOMING
#define LIMITS_NORMAL_OPERATION_MASK (LIMIT_A_IO_MASK | LIMIT_B_IO_MASK | LIMIT_C_IO_MASK)
#else
#define LIMITS_NORMAL_OPERATION_MASK 0
#endif
#endif

#if (ASSERT_PIN(DIN0) && defined(DIN0_ISR))
#define DIN0_MASK 1
#else
Expand Down
79 changes: 43 additions & 36 deletions uCNC/src/core/io_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,13 @@ uint8_t io_get_limits(void)
result ^= io_invert_limits_mask;
}

#if (LIMITS_NORMAL_OPERATION_MASK != 0)
if (!cnc_get_exec_state(EXEC_HOMING))
{
result &= ~LIMITS_NORMAL_OPERATION_MASK;
}
#endif

return result;
}

Expand Down Expand Up @@ -2366,76 +2373,76 @@ int16_t io_get_pinvalue(uint8_t pin)
return (io_get_input(DIN31) != 0);
#endif
#if ASSERT_PIN(DIN32)
case DIN32:
return (io_get_input(DIN32) != 0);
case DIN32:
return (io_get_input(DIN32) != 0);
#endif
#if ASSERT_PIN(DIN33)
case DIN33:
return (io_get_input(DIN33) != 0);
case DIN33:
return (io_get_input(DIN33) != 0);
#endif
#if ASSERT_PIN(DIN34)
case DIN34:
return (io_get_input(DIN34) != 0);
case DIN34:
return (io_get_input(DIN34) != 0);
#endif
#if ASSERT_PIN(DIN35)
case DIN35:
return (io_get_input(DIN35) != 0);
case DIN35:
return (io_get_input(DIN35) != 0);
#endif
#if ASSERT_PIN(DIN36)
case DIN36:
return (io_get_input(DIN36) != 0);
case DIN36:
return (io_get_input(DIN36) != 0);
#endif
#if ASSERT_PIN(DIN37)
case DIN37:
return (io_get_input(DIN37) != 0);
case DIN37:
return (io_get_input(DIN37) != 0);
#endif
#if ASSERT_PIN(DIN38)
case DIN38:
return (io_get_input(DIN38) != 0);
case DIN38:
return (io_get_input(DIN38) != 0);
#endif
#if ASSERT_PIN(DIN39)
case DIN39:
return (io_get_input(DIN39) != 0);
case DIN39:
return (io_get_input(DIN39) != 0);
#endif
#if ASSERT_PIN(DIN40)
case DIN40:
return (io_get_input(DIN40) != 0);
case DIN40:
return (io_get_input(DIN40) != 0);
#endif
#if ASSERT_PIN(DIN41)
case DIN41:
return (io_get_input(DIN41) != 0);
case DIN41:
return (io_get_input(DIN41) != 0);
#endif
#if ASSERT_PIN(DIN42)
case DIN42:
return (io_get_input(DIN42) != 0);
case DIN42:
return (io_get_input(DIN42) != 0);
#endif
#if ASSERT_PIN(DIN43)
case DIN43:
return (io_get_input(DIN43) != 0);
case DIN43:
return (io_get_input(DIN43) != 0);
#endif
#if ASSERT_PIN(DIN44)
case DIN44:
return (io_get_input(DIN44) != 0);
case DIN44:
return (io_get_input(DIN44) != 0);
#endif
#if ASSERT_PIN(DIN45)
case DIN45:
return (io_get_input(DIN45) != 0);
case DIN45:
return (io_get_input(DIN45) != 0);
#endif
#if ASSERT_PIN(DIN46)
case DIN46:
return (io_get_input(DIN46) != 0);
case DIN46:
return (io_get_input(DIN46) != 0);
#endif
#if ASSERT_PIN(DIN47)
case DIN47:
return (io_get_input(DIN47) != 0);
case DIN47:
return (io_get_input(DIN47) != 0);
#endif
#if ASSERT_PIN(DIN48)
case DIN48:
return (io_get_input(DIN48) != 0);
case DIN48:
return (io_get_input(DIN48) != 0);
#endif
#if ASSERT_PIN(DIN49)
case DIN49:
return (io_get_input(DIN49) != 0);
case DIN49:
return (io_get_input(DIN49) != 0);
#endif
#if ASSERT_PIN(SERVO0)
case SERVO0:
Expand Down

0 comments on commit 0b000ba

Please sign in to comment.