1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-30 09:39:49 +02:00

Removed #define IGNORE_CONTROL_PINS

It was added before the test mode machine definition was created. People were loading other machine definitions to test drive without attached hardware. The floating, input only pins were typically used for control pins and creating a bad first experience.
This commit is contained in:
bdring
2020-04-27 09:00:04 -05:00
parent 04fb0b0921
commit c0c27a3fbd
10 changed files with 3 additions and 46 deletions

View File

@@ -67,10 +67,6 @@
#define REED_SW_PIN GPIO_NUM_17
#define LIMIT_MASK 0
#ifdef IGNORE_CONTROL_PINS // maybe set in config.h
#undef IGNORE_CONTROL_PINS
#endif
#ifndef ENABLE_CONTROL_SW_DEBOUNCE
#define ENABLE_CONTROL_SW_DEBOUNCE
#endif

View File

@@ -54,7 +54,6 @@
#define PROBE_PIN GPIO_NUM_39
// comment out #define IGNORE_CONTROL_PINS in config.h to use control pins
#define CONTROL_RESET_PIN GPIO_NUM_2
#define CONTROL_FEED_HOLD_PIN GPIO_NUM_4
#define CONTROL_CYCLE_START_PIN GPIO_NUM_35 // ESP32 needs external pullup

View File

@@ -80,7 +80,6 @@
#define INVERT_CONTROL_PIN_MASK B1110
// Note: check the #define IGNORE_CONTROL_PINS is the way you want in config.h
#define CONTROL_RESET_PIN GPIO_NUM_34 // needs external pullup
#define CONTROL_FEED_HOLD_PIN GPIO_NUM_36 // needs external pullup
#define CONTROL_CYCLE_START_PIN GPIO_NUM_39 // needs external pullup

View File

@@ -51,10 +51,6 @@
#define SERVO_Z_HOME_POS SERVO_Z_RANGE_MAX // move to max during homing
#define SERVO_Z_MPOS false // will not use mpos, uses work coordinates
#ifndef IGNORE_CONTROL_PINS // maybe set in config.h
#define IGNORE_CONTROL_PINS
#endif
// redefine some stuff from config.h
#ifdef HOMING_CYCLE_0
#undef HOMING_CYCLE_0

View File

@@ -79,15 +79,6 @@
#define INVERT_CONTROL_PIN_MASK B1110
// Note: default is #define IGNORE_CONTROL_PINS in config.h
// uncomment to these lines to use them
/*
#ifdef IGNORE_CONTROL_PINS
#undef IGNORE_CONTROL_PINS
#endif
*/
#define CONTROL_RESET_PIN GPIO_NUM_34 // needs external pullup
#define CONTROL_FEED_HOLD_PIN GPIO_NUM_36 // needs external pullup
#define CONTROL_CYCLE_START_PIN GPIO_NUM_39 // needs external pullup

View File

@@ -86,14 +86,6 @@
#define INVERT_CONTROL_PIN_MASK B1110
// Note: default is #define IGNORE_CONTROL_PINS in config.h
// uncomment to these lines to use them
/*
#ifdef IGNORE_CONTROL_PINS
#undef IGNORE_CONTROL_PINS
#endif
*/
#define CONTROL_RESET_PIN GPIO_NUM_34 // needs external pullup
#define CONTROL_FEED_HOLD_PIN GPIO_NUM_36 // needs external pullup

View File

@@ -59,10 +59,6 @@
#define SPINDLE_TYPE SPINDLE_TYPE_NONE
#ifdef IGNORE_CONTROL_PINS // maybe set in config.h
#undef IGNORE_CONTROL_PINS
#endif
#ifndef ENABLE_CONTROL_SW_DEBOUNCE
#define ENABLE_CONTROL_SW_DEBOUNCE
#endif

View File

@@ -175,11 +175,6 @@
// === Control Pins
// The control pins with names that begin with CONTROL_ are
// ignored by default, to avoid noise problems. To make them
// work, you must undefine IGNORE_CONTROL_PINS
// #undef IGNORE_CONTROL_PINS
// If some of the control pin switches are normally closed
// (the default is normally open), you can invert some of them
// with INVERT_CONTROL_PIN_MASK. The bits in the mask are

View File

@@ -76,11 +76,6 @@ Some features should not be changed. See notes below.
// For example B1101 will invert the function of the Reset pin.
#define INVERT_CONTROL_PIN_MASK B1111
// This allows control pins to be ignored.
// Since these are typically used on the pins that don't have pullups, they will float and cause
// problems if not externally pulled up. Ignoring will always return not activated when read.
#define IGNORE_CONTROL_PINS
#define ENABLE_CONTROL_SW_DEBOUNCE // Default disabled. Uncomment to enable.
#define CONTROL_SW_DEBOUNCE_PERIOD 32 // in milliseconds default 32 microseconds

View File

@@ -26,7 +26,7 @@ bool debouncing = false; // debouncing in process
void system_ini() { // Renamed from system_init() due to conflict with esp32 files
// setup control inputs
#ifndef IGNORE_CONTROL_PINS
#ifdef CONTROL_SAFETY_DOOR_PIN
pinMode(CONTROL_SAFETY_DOOR_PIN, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(CONTROL_SAFETY_DOOR_PIN), isr_control_inputs, CHANGE);
@@ -73,7 +73,7 @@ void system_ini() { // Renamed from system_init() due to conflict with esp32 fil
5, // priority
NULL);
#endif
#endif
//customize pin definition if needed
#if (GRBL_SPI_SS != -1) || (GRBL_SPI_MISO != -1) || (GRBL_SPI_MOSI != -1) || (GRBL_SPI_SCK != -1)
SPI.begin(GRBL_SPI_SCK, GRBL_SPI_MISO, GRBL_SPI_MOSI, GRBL_SPI_SS);
@@ -453,10 +453,8 @@ uint8_t system_check_travel_limits(float* target) {
// defined by the CONTROL_PIN_INDEX in the header file.
uint8_t system_control_get_state() {
uint8_t defined_pin_mask = 0; // a mask of defined pins
#ifdef IGNORE_CONTROL_PINS
return 0;
#endif
uint8_t control_state = 0;
#ifdef CONTROL_SAFETY_DOOR_PIN
defined_pin_mask |= CONTROL_PIN_INDEX_SAFETY_DOOR;
if (digitalRead(CONTROL_SAFETY_DOOR_PIN)) control_state |= CONTROL_PIN_INDEX_SAFETY_DOOR;