Merge pull request #27 from tscofield/probe
changes to allow probing on pin 1.27
This commit is contained in:
commit
04f8621ef9
@ -534,10 +534,11 @@
|
||||
#define CONTROL_INVERT_MASK CONTROL_MASK // May be re-defined to only invert certain control pins.
|
||||
|
||||
// Define probe switch input pin.
|
||||
#define PROBE_DDR NotUsed
|
||||
#define PROBE_PIN NotUsed
|
||||
#define PROBE_PORT NotUsed
|
||||
#define PROBE_BIT 5 // Uno Analog Pin 5
|
||||
// Borrow Y Max limit port for probe
|
||||
#define PROBE_DDR LPC_GPIO1->FIODIR
|
||||
#define PROBE_PIN LPC_GPIO1->FIOPIN
|
||||
#define PROBE_PORT LPC_GPIO1->FIOPIN
|
||||
#define PROBE_BIT 27 // borrowing y-max pin
|
||||
#define PROBE_MASK (1<<PROBE_BIT)
|
||||
|
||||
// The LPC17xx has 6 PWM channels. Each channel has 2 pins. It can drive both pins simultaneously to the same value.
|
||||
|
10
grbl/probe.c
10
grbl/probe.c
@ -22,7 +22,7 @@
|
||||
|
||||
|
||||
// Inverts the probe pin state depending on user settings and probing cycle mode.
|
||||
uint8_t probe_invert_mask;
|
||||
uint32_t probe_invert_mask;
|
||||
|
||||
|
||||
// Probe pin initialization routine.
|
||||
@ -50,7 +50,13 @@ void probe_configure_invert_mask(uint8_t is_probe_away)
|
||||
|
||||
|
||||
// Returns the probe pin state. Triggered = true. Called by gcode parser and probe state monitor.
|
||||
uint8_t probe_get_state() { return((PROBE_PIN & PROBE_MASK) ^ probe_invert_mask); }
|
||||
uint8_t probe_get_state() {
|
||||
if ((PROBE_PIN & PROBE_MASK) ^ probe_invert_mask) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Monitors probe pin state and records the system position when detected. Called by the
|
||||
|
Loading…
Reference in New Issue
Block a user