From a7b71d25d3b359769a34756f50f228100161470f Mon Sep 17 00:00:00 2001 From: bdring Date: Wed, 1 May 2019 11:51:25 -0500 Subject: [PATCH] Adding CPU_MAP_NAME feature - This is a feature that allows you to give a text name to your CPU_MAP. This will print at boot time to identify if the compiled version is compatible with your hardware. --- Grbl_Esp32/cpu_map.h | 22 +++++++++++++++++++--- Grbl_Esp32/report.cpp | 5 ++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Grbl_Esp32/cpu_map.h b/Grbl_Esp32/cpu_map.h index e46dad24..c8286d03 100644 --- a/Grbl_Esp32/cpu_map.h +++ b/Grbl_Esp32/cpu_map.h @@ -45,6 +45,8 @@ // won't affect operation except that there will be no output // form the pins. Grbl will virtually move the axis. This could // be handy if you are using a servo, etc. for another axis. + #define CPU_MAP_NAME "CPU_MAP_ESP32" + #define X_STEP_PIN GPIO_NUM_12 #define X_DIRECTION_PIN GPIO_NUM_26 #define X_RMT_CHANNEL 0 @@ -112,6 +114,8 @@ // For laser mode, you do not need to change anything // Note: You can use all 3 modes at the same time if you want + #define CPU_MAP_NAME "CPU_MAP_PEN_LASER" + // Pick a board version //#define PEN_LASER_V1 #define PEN_LASER_V2 @@ -209,6 +213,9 @@ #endif #ifdef CPU_MAP_MIDTBOT // Buildlog.net midtbot + + #define CPU_MAP_NAME "CPU_MAP_MIDTBOT" + #define X_STEP_PIN GPIO_NUM_12 #define Y_STEP_PIN GPIO_NUM_14 #define X_DIRECTION_PIN GPIO_NUM_26 @@ -326,6 +333,8 @@ #endif #ifdef CPU_MAP_POLAR_COASTER // The Buildlog.net pen polar coaster controller V1 + #define CPU_MAP_NAME "CPU_MAP_POLAR_COASTER" + #define X_STEP_PIN GPIO_NUM_15 #define Y_STEP_PIN GPIO_NUM_2 #define X_DIRECTION_PIN GPIO_NUM_25 @@ -432,6 +441,8 @@ // For laser mode, you do not need to change anything // Note: You can use all 3 modes at the same time if you want + #define CPU_MAP_NAME "CPU_MAP_SERVO_AXIS" + // Pick a board version //#define PEN_LASER_V1 #define PEN_LASER_V2 @@ -665,6 +676,8 @@ #ifdef CPU_MAP_MPCNC // This is the CPU Map for the Buildlog.net MPCNC controller + #define CPU_MAP_NAME "CPU_MAP_MPCNC" + // switch to the correct default settings #ifdef DEFAULTS_GENERIC #undef DEFAULTS_GENERIC @@ -744,10 +757,12 @@ #endif -#ifdef CPU_MAP_LOWRIDER +#ifdef CPU_MAP_LOWRIDER // !!!!!!!!!!!!!!!!! Warning: Untested !!!!!!!!!!!!!!!!! // // This is the CPU Map for the Buildlog.net MPCNC controller // used in lowrider mode. Low rider has (2) Z and one each of X and Y // These will not match the silkscreen or schematic descriptions + #define CPU_MAP_NAME "CPU_MAP_LOWRIDER" + #define USE_GANGED_AXES // allow two motors on an axis @@ -757,9 +772,9 @@ #define Y_STEP_B_PIN GPIO_NUM_21 // ganged motor #define Y_AXIS_SQUARING - #define Z_STEP_PIN GPIO_NUM_12 + #define Z_STEP_PIN GPIO_NUM_12 #define Z_STEP_B_PIN GPIO_NUM_22 - #define Y_AXIS_SQUARING + #define Z_AXIS_SQUARING #define X_DIRECTION_PIN GPIO_NUM_33 // use Z labeled connector #define Y_DIRECTION_PIN GPIO_NUM_25 @@ -821,6 +836,7 @@ #endif + // ================= common to all machines ================================ // These are some ESP32 CPU Settings that the program needs, but are generally not changed diff --git a/Grbl_Esp32/report.cpp b/Grbl_Esp32/report.cpp index c52165f4..c2250e5f 100644 --- a/Grbl_Esp32/report.cpp +++ b/Grbl_Esp32/report.cpp @@ -265,7 +265,10 @@ void report_feedback_message(uint8_t message_code) // OK to send to all clients // Welcome message void report_init_message(uint8_t client) { - grbl_send(client,"\r\nGrbl " GRBL_VERSION " ['$' for help]\r\n"); + grbl_send(client,"\r\nGrbl " GRBL_VERSION " ['$' for help]\r\n"); + #ifdef CPU_MAP_NAME + grbl_send(client,"[MSG:Using cpu_map..." CPU_MAP_NAME "]\r\n"); + #endif } // Grbl help message