From c0c27a3fbd5e600dc6894cb9e5f35e19999c1240 Mon Sep 17 00:00:00 2001 From: bdring Date: Mon, 27 Apr 2020 09:00:04 -0500 Subject: [PATCH] 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. --- Grbl_Esp32/Machines/atari_1020.h | 4 ---- Grbl_Esp32/Machines/espduino.h | 1 - Grbl_Esp32/Machines/lowrider_v1p2.h | 1 - Grbl_Esp32/Machines/midtbot.h | 4 ---- Grbl_Esp32/Machines/mpcnc_v1p1.h | 9 --------- Grbl_Esp32/Machines/mpcnc_v1p2.h | 8 -------- Grbl_Esp32/Machines/polar_coaster.h | 4 ---- Grbl_Esp32/Machines/template.h | 5 ----- Grbl_Esp32/config.h | 5 ----- Grbl_Esp32/system.cpp | 8 +++----- 10 files changed, 3 insertions(+), 46 deletions(-) diff --git a/Grbl_Esp32/Machines/atari_1020.h b/Grbl_Esp32/Machines/atari_1020.h index faaf8c6c..5e4139eb 100644 --- a/Grbl_Esp32/Machines/atari_1020.h +++ b/Grbl_Esp32/Machines/atari_1020.h @@ -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 diff --git a/Grbl_Esp32/Machines/espduino.h b/Grbl_Esp32/Machines/espduino.h index 28571e13..2023ccfb 100644 --- a/Grbl_Esp32/Machines/espduino.h +++ b/Grbl_Esp32/Machines/espduino.h @@ -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 diff --git a/Grbl_Esp32/Machines/lowrider_v1p2.h b/Grbl_Esp32/Machines/lowrider_v1p2.h index def0aeac..f742cd1f 100644 --- a/Grbl_Esp32/Machines/lowrider_v1p2.h +++ b/Grbl_Esp32/Machines/lowrider_v1p2.h @@ -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 diff --git a/Grbl_Esp32/Machines/midtbot.h b/Grbl_Esp32/Machines/midtbot.h index f10c11d9..c7249897 100644 --- a/Grbl_Esp32/Machines/midtbot.h +++ b/Grbl_Esp32/Machines/midtbot.h @@ -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 diff --git a/Grbl_Esp32/Machines/mpcnc_v1p1.h b/Grbl_Esp32/Machines/mpcnc_v1p1.h index 5e656a5d..37eb3bf6 100644 --- a/Grbl_Esp32/Machines/mpcnc_v1p1.h +++ b/Grbl_Esp32/Machines/mpcnc_v1p1.h @@ -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 diff --git a/Grbl_Esp32/Machines/mpcnc_v1p2.h b/Grbl_Esp32/Machines/mpcnc_v1p2.h index b139d623..03212499 100644 --- a/Grbl_Esp32/Machines/mpcnc_v1p2.h +++ b/Grbl_Esp32/Machines/mpcnc_v1p2.h @@ -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 diff --git a/Grbl_Esp32/Machines/polar_coaster.h b/Grbl_Esp32/Machines/polar_coaster.h index 0ae39c84..125fbcf4 100644 --- a/Grbl_Esp32/Machines/polar_coaster.h +++ b/Grbl_Esp32/Machines/polar_coaster.h @@ -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 diff --git a/Grbl_Esp32/Machines/template.h b/Grbl_Esp32/Machines/template.h index 2aa7ca26..9c4272c6 100644 --- a/Grbl_Esp32/Machines/template.h +++ b/Grbl_Esp32/Machines/template.h @@ -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 diff --git a/Grbl_Esp32/config.h b/Grbl_Esp32/config.h index d7fec101..79fc7dfc 100644 --- a/Grbl_Esp32/config.h +++ b/Grbl_Esp32/config.h @@ -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 diff --git a/Grbl_Esp32/system.cpp b/Grbl_Esp32/system.cpp index c3c94e73..2da179ce 100644 --- a/Grbl_Esp32/system.cpp +++ b/Grbl_Esp32/system.cpp @@ -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;