1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-09-02 10:53:01 +02:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
odaki
2019-06-28 22:55:01 +09:00
6 changed files with 87 additions and 66 deletions

View File

@@ -326,7 +326,7 @@ bool COMMANDS::execute_internal_command (int cmd, String cmd_params, level_authe
} }
Preferences prefs; Preferences prefs;
prefs.begin(NAMESPACE, false); prefs.begin(NAMESPACE, false);
if (prefs.putString(AP_PWD_ENTRY, parameter) == 0){ if (prefs.putString(AP_PWD_ENTRY, parameter) != parameter.length()){
response = false; response = false;
if(espresponse)espresponse->println ("Error: Set failed!"); if(espresponse)espresponse->println ("Error: Set failed!");
} else if(espresponse)espresponse->println ("ok"); } else if(espresponse)espresponse->println ("ok");
@@ -940,11 +940,12 @@ bool COMMANDS::execute_internal_command (int cmd, String cmd_params, level_authe
return false; return false;
} }
#endif #endif
int8_t vi;
espresponse->print("{\"EEPROM\":["); espresponse->print("{\"EEPROM\":[");
if(espresponse->client() != CLIENT_WEBUI)espresponse->println(""); if(espresponse->client() != CLIENT_WEBUI)espresponse->println("");
prefs.begin(NAMESPACE, true); prefs.begin(NAMESPACE, true);
#ifdef ENABLE_WIFI #ifdef ENABLE_WIFI
int8_t vi;
//1 - Hostname //1 - Hostname
espresponse->print ("{\"F\":\"network\",\"P\":\""); espresponse->print ("{\"F\":\"network\",\"P\":\"");
espresponse->print (HOSTNAME_ENTRY); espresponse->print (HOSTNAME_ENTRY);
@@ -1223,7 +1224,11 @@ bool COMMANDS::execute_internal_command (int cmd, String cmd_params, level_authe
if (! (styp == "B" || styp == "S" || styp == "A" || styp == "I" || styp == "F") ) { if (! (styp == "B" || styp == "S" || styp == "A" || styp == "I" || styp == "F") ) {
response = false; response = false;
} }
if (sval.length() == 0) { if ((sval.length() == 0)
#if defined (ENABLE_WIFI)
&& !((spos==AP_PWD_ENTRY) || (spos==STA_PWD_ENTRY))
#endif
){
response = false; response = false;
} }
@@ -1281,7 +1286,7 @@ bool COMMANDS::execute_internal_command (int cmd, String cmd_params, level_authe
} }
//String value //String value
if (styp == "S") { if (styp == "S") {
if (prefs.putString(spos.c_str(), sval) == 0) { if (prefs.putString(spos.c_str(), sval) != sval.length()) {
response = false; response = false;
} else { } else {
#if defined (ENABLE_WIFI) #if defined (ENABLE_WIFI)

View File

@@ -749,10 +749,10 @@
#endif #endif
#ifdef CPU_MAP_MPCNC #ifdef CPU_MAP_MPCNC_V1P2
// This is the CPU Map for the Buildlog.net MPCNC controller // This is the CPU Map for the Buildlog.net MPCNC controller
#define CPU_MAP_NAME "CPU_MAP_MPCNC" #define CPU_MAP_NAME "CPU_MAP_MPCNC_V1P2"
// switch to the correct default settings // switch to the correct default settings
#ifdef DEFAULTS_GENERIC #ifdef DEFAULTS_GENERIC
@@ -780,9 +780,8 @@
// OK to comment out to use pin for other features // OK to comment out to use pin for other features
#define STEPPERS_DISABLE_PIN GPIO_NUM_13 #define STEPPERS_DISABLE_PIN GPIO_NUM_13
// Note: if you use PWM rather than relay, you could map GPIO_NUM_2 to mist or flood
// Note: if you use PWM rather than relay, you could map GPIO_NUM_17 to mist or flood //#define USE_SPINDLE_RELAY
#define USE_SPINDLE_RELAY
#ifdef USE_SPINDLE_RELAY #ifdef USE_SPINDLE_RELAY
#define SPINDLE_PWM_PIN GPIO_NUM_2 #define SPINDLE_PWM_PIN GPIO_NUM_2
@@ -810,13 +809,17 @@
// Note: Only uncomment this if USE_SPINDLE_RELAY is commented out. // Note: Only uncomment this if USE_SPINDLE_RELAY is commented out.
// Relay can be used for Spindle or Coolant // Relay can be used for Spindle or Coolant
//#define COOLANT_FLOOD_PIN GPIO_NUM_17 //#define COOLANT_FLOOD_PIN GPIO_NUM_2
#define X_LIMIT_PIN GPIO_NUM_17 #define X_LIMIT_PIN GPIO_NUM_17
#define Y_LIMIT_PIN GPIO_NUM_4 #define Y_LIMIT_PIN GPIO_NUM_4
#define Z_LIMIT_PIN GPIO_NUM_15 #define Z_LIMIT_PIN GPIO_NUM_15
#define LIMIT_MASK B111 #define LIMIT_MASK B111
#ifndef ENABLE_SOFTWARE_DEBOUNCE // V1P2 does not have R/C filters
#define ENABLE_SOFTWARE_DEBOUNCE
#endif
#define PROBE_PIN GPIO_NUM_35 #define PROBE_PIN GPIO_NUM_35
// The default value in config.h is wrong for this controller // The default value in config.h is wrong for this controller
@@ -826,7 +829,15 @@
#define INVERT_CONTROL_PIN_MASK B1110 #define INVERT_CONTROL_PIN_MASK B1110
// Note: check the #define IGNORE_CONTROL_PINS is the way you want in config.h // Note: defualt 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_RESET_PIN GPIO_NUM_34 // needs external pullup
#define CONTROL_FEED_HOLD_PIN GPIO_NUM_36 // 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 #define CONTROL_CYCLE_START_PIN GPIO_NUM_39 // needs external pullup
@@ -896,7 +907,7 @@
// Relay can be used for Spindle or Coolant // Relay can be used for Spindle or Coolant
//#define COOLANT_FLOOD_PIN GPIO_NUM_17 //#define COOLANT_FLOOD_PIN GPIO_NUM_17
#define X_LIMIT_PIN GPIO_NUM_2 #define X_LIMIT_PIN GPIO_NUM_34
#define Y_LIMIT_PIN GPIO_NUM_4 #define Y_LIMIT_PIN GPIO_NUM_4
#define Z_LIMIT_PIN GPIO_NUM_15 #define Z_LIMIT_PIN GPIO_NUM_15
#define LIMIT_MASK B111 #define LIMIT_MASK B111
@@ -908,10 +919,10 @@
#undef INVERT_CONTROL_PIN_MASK #undef INVERT_CONTROL_PIN_MASK
#endif #endif
#define INVERT_CONTROL_PIN_MASK B1110 #define INVERT_CONTROL_PIN_MASK B1100
// Note: check the #define IGNORE_CONTROL_PINS is the way you want in config.h // 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_RESET_PIN GPIO_NUM_34 // needs external pullup
#define CONTROL_FEED_HOLD_PIN GPIO_NUM_36 // 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 #define CONTROL_CYCLE_START_PIN GPIO_NUM_39 // needs external pullup

View File

@@ -109,7 +109,12 @@
#define DEFAULT_HOMING_DEBOUNCE_DELAY 250 // msec (0-65k) #define DEFAULT_HOMING_DEBOUNCE_DELAY 250 // msec (0-65k)
#define DEFAULT_HOMING_PULLOFF 1.5 // mm #define DEFAULT_HOMING_PULLOFF 1.5 // mm
#define DEFAULT_SPINDLE_RPM_MAX 1.0 // rpm used for spindle relay #ifdef USE_SPINDLE_RELAY
#define DEFAULT_SPINDLE_RPM_MAX 1.0 // must be 1 so PWM duty is alway 100% to prevent relay damage
#else
#define DEFAULT_SPINDLE_RPM_MAX 1000.0 // can be change to your spindle max
#endif
#define DEFAULT_SPINDLE_RPM_MIN 0.0 // rpm #define DEFAULT_SPINDLE_RPM_MIN 0.0 // rpm
#define DEFAULT_LASER_MODE 0 // false #define DEFAULT_LASER_MODE 0 // false

View File

@@ -20,7 +20,7 @@
// Grbl versioning system // Grbl versioning system
#define GRBL_VERSION "1.1f" #define GRBL_VERSION "1.1f"
#define GRBL_VERSION_BUILD "20190616" #define GRBL_VERSION_BUILD "20190626"
//#include <sdkconfig.h> //#include <sdkconfig.h>
#include <Arduino.h> #include <Arduino.h>

View File

@@ -419,10 +419,10 @@ void stepper_init()
#endif #endif
#ifdef USE_RMT_STEPS #ifdef USE_RMT_STEPS
grbl_send(CLIENT_SERIAL, "[MSG:Using RMT Steps}\r\n"); grbl_send(CLIENT_SERIAL, "[MSG:Using RMT Steps]\r\n");
initRMT(); initRMT();
#else #else
grbl_send(CLIENT_SERIAL, "[MSG:Using Timed Steps}\r\n"); grbl_send(CLIENT_SERIAL, "[MSG:Using Timed Steps]\r\n");
// make the step pins outputs // make the step pins outputs
#ifdef X_STEP_PIN #ifdef X_STEP_PIN
pinMode(X_STEP_PIN, OUTPUT); pinMode(X_STEP_PIN, OUTPUT);

View File

@@ -475,7 +475,7 @@ void WiFiConfig::reset_settings(){
error = true; error = true;
} }
sval = DEFAULT_STA_PWD; sval = DEFAULT_STA_PWD;
if (prefs.putString(STA_PWD_ENTRY, sval) == 0){ if (prefs.putString(STA_PWD_ENTRY, sval) != sval.length()){
error = true; error = true;
} }
sval = DEFAULT_AP_SSID; sval = DEFAULT_AP_SSID;
@@ -483,7 +483,7 @@ void WiFiConfig::reset_settings(){
error = true; error = true;
} }
sval = DEFAULT_AP_PWD; sval = DEFAULT_AP_PWD;
if (prefs.putString(AP_PWD_ENTRY, sval) == 0){ if (prefs.putString(AP_PWD_ENTRY, sval) != sval.length()){
error = true; error = true;
} }