Fully configurable pins for NO or NC switches.

- All pins, which include limits, control command, and probe pins, can
now all be configured to trigger as active-low or active-high and
whether the pin has its internal pull-up resistor enabled. This should
allow for just about all types of NO and NC switch configurations.

- The probe pin invert setting hasn’t been added to the Grbl settings,
like the others, and will have to wait until v1.0. But for now, it’s
available as a compile-time option in config.h.

- Fixed a variable spindle bug.
This commit is contained in:
Sonny Jeon
2015-01-17 08:12:37 -07:00
parent 9be7b3d930
commit bf37ab7e7b
10 changed files with 82 additions and 51 deletions

View File

@ -30,11 +30,11 @@ uint8_t probe_invert_mask;
void probe_init()
{
PROBE_DDR &= ~(PROBE_MASK); // Configure as input pins
if (bit_istrue(settings.flags,BITFLAG_INVERT_PROBE_PIN)) {
#ifdef DISABLE_PROBE_PIN_PULL_UP
PROBE_PORT &= ~(PROBE_MASK); // Normal low operation. Requires external pull-down.
} else {
#else
PROBE_PORT |= PROBE_MASK; // Enable internal pull-up resistors. Normal high operation.
}
#endif
// probe_configure_invert_mask(false); // Initialize invert mask. Not required. Updated when in-use.
}