From 23de746a2a55ad36f23d08a1921b1219b67046f0 Mon Sep 17 00:00:00 2001 From: bdring Date: Fri, 13 Sep 2019 13:37:46 -0500 Subject: [PATCH] Create a test drive cpu_map and make that the default. --- Grbl_Esp32/config.h | 4 ++-- Grbl_Esp32/cpu_map.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/Grbl_Esp32/config.h b/Grbl_Esp32/config.h index 035805e2..bb1a2afb 100644 --- a/Grbl_Esp32/config.h +++ b/Grbl_Esp32/config.h @@ -47,7 +47,7 @@ Some features should not be changed. See notes below. // one configuration file by placing their specific defaults and pin map at the bottom of this file. // If doing so, simply comment out these two defines and see instructions below. #define DEFAULTS_GENERIC -#define CPU_MAP_ESP32 // these are defined in cpu_map.h +#define CPU_MAP_TEST_DRIVE // these are defined in cpu_map.h #define VERBOSE_HELP // adds addition help info, but could confuse some senders @@ -276,7 +276,7 @@ Some features should not be changed. See notes below. // 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 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/cpu_map.h b/Grbl_Esp32/cpu_map.h index 5b8880e2..954c6cca 100644 --- a/Grbl_Esp32/cpu_map.h +++ b/Grbl_Esp32/cpu_map.h @@ -45,6 +45,41 @@ //Set your frequency #define GRBL_SPI_FREQ 4000000 +#ifdef CPU_MAP_TEST_DRIVE + /* + This is just a demo CPU_MAP for test driving. It creates a basic 3 axis machine, but + no actual i/o is used. It will appear that axes are moving, but they are virtual + + This can be uploaded to an unattached ESP32 or attached to unknown hardware. There is no risk + pins trying to output signals into a short, etc that could dmamge the ESP32 + + Assuming no changes have been made to the config.h file it is also a way to get he basic program + running so OTA (over the air) firmware loading can be done. + + */ + #define CPU_MAP_NAME "CPU_MAP_DEFAULT - Demo Only No I/O!" + + + // the following items currently need to be defined, but no i/o needs to be mapped + // fixing soon + + #define LIMIT_MASK 0 // no limit pins + + #define SPINDLE_PWM_CHANNEL 0 + #define SPINDLE_PWM_BASE_FREQ 5000 // Hz + #define SPINDLE_PWM_BIT_PRECISION 8 // be sure to match this with SPINDLE_PWM_MAX_VALUE + #define SPINDLE_PWM_OFF_VALUE 0 + #define SPINDLE_PWM_MAX_VALUE 255 // (2^SPINDLE_PWM_BIT_PRECISION) + + #ifndef SPINDLE_PWM_MIN_VALUE + #define SPINDLE_PWM_MIN_VALUE 1 // Must be greater than zero. + #endif + + #define SPINDLE_ENABLE_PIN GPIO_NUM_22 + + #define SPINDLE_PWM_RANGE (SPINDLE_PWM_MAX_VALUE-SPINDLE_PWM_MIN_VALUE) +#endif + #ifdef CPU_MAP_ESP32 // This is the CPU Map for the ESP32 CNC Controller R2