mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-03 03:13:25 +02:00
@@ -115,7 +115,7 @@
|
||||
// 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 CPU_MAP_NAME "CPU_MAP_ESP32_ESC_SPINDLE"
|
||||
|
||||
#define X_STEP_PIN GPIO_NUM_12
|
||||
#define X_DIRECTION_PIN GPIO_NUM_26
|
||||
@@ -152,8 +152,8 @@
|
||||
#define ESC_MAX_PULSE_SEC 0.002 // max pulse in seconds (OK to tune this one)
|
||||
#define ESC_TIME_PER_BIT ((1.0 / (float)SPINDLE_PWM_BASE_FREQ) / ((float)SPINDLE_PULSE_RES_COUNT) ) // seconds
|
||||
|
||||
#define SPINDLE_PWM_OFF_VALUE (uint16_t)(SERVO_MIN_PULSE_SEC / SERVO_TIME_PER_BIT) // in timer counts
|
||||
#define SPINDLE_PWM_MAX_VALUE (uint16_t)(SERVO_MAX_PULSE_SEC / SERVO_TIME_PER_BIT) // in timer counts
|
||||
#define SPINDLE_PWM_OFF_VALUE (uint16_t)(ESC_MIN_PULSE_SEC / ESC_TIME_PER_BIT) // in timer counts
|
||||
#define SPINDLE_PWM_MAX_VALUE (uint16_t)(ESC_MAX_PULSE_SEC / ESC_TIME_PER_BIT) // in timer counts
|
||||
|
||||
#ifndef SPINDLE_PWM_MIN_VALUE
|
||||
#define SPINDLE_PWM_MIN_VALUE SPINDLE_PWM_OFF_VALUE // Must be greater than zero.
|
||||
|
Binary file not shown.
@@ -47,16 +47,16 @@ void ESPResponseStream::println(const char *data){
|
||||
}
|
||||
|
||||
//helper to format size to readable string
|
||||
String ESPResponseStream::formatBytes (uint32_t bytes)
|
||||
String ESPResponseStream::formatBytes (uint64_t bytes)
|
||||
{
|
||||
if (bytes < 1024) {
|
||||
return String (bytes) + " B";
|
||||
if (bytes < 1024) {
|
||||
return String ((uint16_t)bytes) + " B";
|
||||
} else if (bytes < (1024 * 1024) ) {
|
||||
return String (bytes / 1024.0) + " KB";
|
||||
return String ((float)(bytes / 1024.0),2) + " KB";
|
||||
} else if (bytes < (1024 * 1024 * 1024) ) {
|
||||
return String (bytes / 1024.0 / 1024.0) + " MB";
|
||||
return String ((float)(bytes / 1024.0 / 1024.0),2) + " MB";
|
||||
} else {
|
||||
return String (bytes / 1024.0 / 1024.0 / 1024.0) + " GB";
|
||||
return String ((float)(bytes / 1024.0 / 1024.0 / 1024.0),2) + " GB";
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,7 @@ class ESPResponseStream{
|
||||
void print(const char *data);
|
||||
void println(const char *data);
|
||||
void flush();
|
||||
static String formatBytes (uint32_t bytes);
|
||||
static String formatBytes (uint64_t bytes);
|
||||
uint8_t client() {return _client;}
|
||||
#if defined (ENABLE_HTTP) && defined(ENABLE_WIFI)
|
||||
ESPResponseStream(WebServer * webserver);
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
// Grbl versioning system
|
||||
#define GRBL_VERSION "1.1f"
|
||||
#define GRBL_VERSION_BUILD "20190517"
|
||||
#define GRBL_VERSION_BUILD "20190518"
|
||||
|
||||
//#include <sdkconfig.h>
|
||||
#include <Arduino.h>
|
||||
|
@@ -86,7 +86,7 @@ void spindle_set_speed(uint32_t pwm_value)
|
||||
#else
|
||||
spindle_set_enable(pwm_value != 0);
|
||||
#endif
|
||||
grbl_analogWrite(SPINDLE_PWM_CHANNEL, pwm_value);
|
||||
grbl_analogWrite(SPINDLE_PWM_CHANNEL, pwm_value);
|
||||
}
|
||||
|
||||
// Called by spindle_set_state() and step segment generator. Keep routine small and efficient.
|
||||
|
@@ -254,7 +254,9 @@ void IRAM_ATTR onStepperDriverTimer(void *para) // ISR It is time to take a ste
|
||||
|
||||
#ifdef VARIABLE_SPINDLE
|
||||
// Set real-time spindle output as segment is loaded, just prior to the first step.
|
||||
if (st_prep_block->is_pwm_rate_adjusted) {
|
||||
spindle_set_speed(st.exec_segment->spindle_pwm);
|
||||
}
|
||||
#endif
|
||||
|
||||
} else {
|
||||
@@ -1153,7 +1155,6 @@ void st_prep_buffer()
|
||||
bit_false(sys.step_control,STEP_CONTROL_UPDATE_SPINDLE_PWM);
|
||||
}
|
||||
prep_segment->spindle_pwm = prep.current_spindle_pwm; // Reload segment PWM value
|
||||
|
||||
#endif
|
||||
|
||||
/* -----------------------------------------------------------------------------------
|
||||
|
@@ -1228,8 +1228,8 @@ void Web_Server::handle_direct_SDFileList()
|
||||
_upload_status = UPLOAD_STATUS_NONE;
|
||||
}
|
||||
bool list_files = true;
|
||||
uint32_t totalspace = 0;
|
||||
uint32_t usedspace = 0;
|
||||
uint64_t totalspace = 0;
|
||||
uint64_t usedspace = 0;
|
||||
if (get_sd_state(true) != SDCARD_IDLE) {
|
||||
_webserver->sendHeader("Cache-Control","no-cache");
|
||||
_webserver->send(200, "application/json", "{\"status\":\"No SD Card\"}");
|
||||
|
Reference in New Issue
Block a user