diff --git a/Grbl_Esp32/config.h b/Grbl_Esp32/config.h index 057affb7..685961e9 100644 --- a/Grbl_Esp32/config.h +++ b/Grbl_Esp32/config.h @@ -37,9 +37,10 @@ Some features should not be changed. See notes below. #ifndef config_h #define config_h -#include "grbl.h" // For Arduino IDE compatibility. +#include //#define ESP_DEBUG +#define N_AXIS 3 // Number of axes defined // Define CPU pin map and default settings. // NOTE: OEMs can avoid the need to maintain/update the defaults.h and cpu_map.h files and use only diff --git a/Grbl_Esp32/cpu_map.h b/Grbl_Esp32/cpu_map.h index a388264a..dcf2239b 100644 --- a/Grbl_Esp32/cpu_map.h +++ b/Grbl_Esp32/cpu_map.h @@ -1158,6 +1158,10 @@ */ // Be sure to change to N_AXIS 6 in nuts_bolts.h + #ifdef N_AXIS + #undef N_AXIS + #endif + #define N_AXIS 6 // stepper motors #define USE_RMT_STEPS diff --git a/Grbl_Esp32/espresponse.cpp b/Grbl_Esp32/espresponse.cpp index 827c7452..052c7a17 100644 --- a/Grbl_Esp32/espresponse.cpp +++ b/Grbl_Esp32/espresponse.cpp @@ -24,6 +24,8 @@ #include #endif +#include "report.h" + #if defined (ENABLE_HTTP) && defined(ENABLE_WIFI) ESPResponseStream::ESPResponseStream(WebServer * webserver){ _header_sent=false; diff --git a/Grbl_Esp32/nuts_bolts.h b/Grbl_Esp32/nuts_bolts.h index 81b018f2..fe5edbb1 100644 --- a/Grbl_Esp32/nuts_bolts.h +++ b/Grbl_Esp32/nuts_bolts.h @@ -21,6 +21,8 @@ #ifndef nuts_bolts_h #define nuts_bolts_h +#include "config.h" + #define false 0 #define true 1 @@ -29,7 +31,6 @@ // Axis array index values. Must start with 0 and be continuous. // Note: You set the number of axes used by changing N_AXIS. // Be sure to define pins or servos in cpu_map.h -#define N_AXIS 3 // Number of axes defined #define X_AXIS 0 // Axis indexing value. #define Y_AXIS 1 #define Z_AXIS 2 diff --git a/Grbl_Esp32/planner.h b/Grbl_Esp32/planner.h index b5d08161..c411f245 100644 --- a/Grbl_Esp32/planner.h +++ b/Grbl_Esp32/planner.h @@ -24,9 +24,7 @@ #ifndef planner_h #define planner_h - - - + // The number of linear motions that can be in the plan at any give time #ifndef BLOCK_BUFFER_SIZE #ifdef USE_LINE_NUMBERS diff --git a/Grbl_Esp32/servo_axis.cpp b/Grbl_Esp32/servo_axis.cpp index 835c8832..ce4efc1e 100644 --- a/Grbl_Esp32/servo_axis.cpp +++ b/Grbl_Esp32/servo_axis.cpp @@ -143,10 +143,11 @@ void servosSyncTask(void *pvParameters) ServoAxis::ServoAxis(uint8_t axis, uint8_t pin_num, uint8_t channel_num) // constructor { - _axis = axis; + _axis = axis; _pin_num = pin_num; _channel_num = channel_num; - _showError = true; // this will be used to show error only once + _showError = true; // this will be used to show calibration error only once + _use_mpos = true; // default is to use the machine position rather than work position } void ServoAxis::init() diff --git a/Grbl_Esp32/stepper.cpp b/Grbl_Esp32/stepper.cpp index 7bc6b9c4..d0a98ae2 100644 --- a/Grbl_Esp32/stepper.cpp +++ b/Grbl_Esp32/stepper.cpp @@ -437,6 +437,8 @@ void stepper_init() Trinamic_Init(); #endif + grbl_sendf(CLIENT_SERIAL, "[MSG:Axis count %d]\r\n", N_AXIS); + #ifdef USE_RMT_STEPS grbl_send(CLIENT_SERIAL, "[MSG:Using RMT Steps]\r\n"); initRMT();