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

Merge pull request #168 from bdring/Devt

Devt
This commit is contained in:
bdring
2019-06-16 12:58:50 -05:00
committed by GitHub
8 changed files with 59 additions and 58 deletions

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 "20190602" #define GRBL_VERSION_BUILD "20190616"
//#include <sdkconfig.h> //#include <sdkconfig.h>
#include <Arduino.h> #include <Arduino.h>

View File

@@ -23,6 +23,8 @@
#ifdef USE_PEN_SERVO #ifdef USE_PEN_SERVO
static TaskHandle_t servoSyncTaskHandle = 0;
// used to delay turn on // used to delay turn on
bool servo_pen_enable = false; bool servo_pen_enable = false;

View File

@@ -67,8 +67,6 @@
#ifndef servo_h #ifndef servo_h
#define servo_h #define servo_h
static TaskHandle_t servoSyncTaskHandle = 0;
void servo_init(); void servo_init();
void servo_disable(); void servo_disable();
bool validate_servo_settings(bool verbose); bool validate_servo_settings(bool verbose);

View File

@@ -23,6 +23,8 @@
#ifdef USE_PEN_SOLENOID #ifdef USE_PEN_SOLENOID
static TaskHandle_t solenoidSyncTaskHandle = 0;
// used to delay turn on // used to delay turn on
bool solenoid_pen_enable; bool solenoid_pen_enable;
uint16_t solenoide_hold_count; uint16_t solenoide_hold_count;

View File

@@ -46,7 +46,7 @@
#ifndef solenoid_h #ifndef solenoid_h
#define solenoid_h #define solenoid_h
static TaskHandle_t solenoidSyncTaskHandle = 0;
void solenoid_init(); void solenoid_init();
void solenoid_disable(); void solenoid_disable();
void solenoidSyncTask(void *pvParameters); void solenoidSyncTask(void *pvParameters);

View File

@@ -198,6 +198,58 @@ static st_prep_t prep;
*/ */
#ifdef USE_RMT_STEPS
// Set stepper pulse output pins
inline IRAM_ATTR static void stepperRMT_Outputs()
{
#ifdef X_STEP_PIN
if(st.step_outbits & (1<<X_AXIS)) {
#ifndef X_STEP_B_PIN // if not a ganged axis
RMT.conf_ch[X_RMT_CHANNEL].conf1.mem_rd_rst = 1;
RMT.conf_ch[X_RMT_CHANNEL].conf1.tx_start = 1;
#else // it is a ganged axis
if ( (ganged_mode == SQUARING_MODE_DUAL) || (ganged_mode == SQUARING_MODE_A) ) {
RMT.conf_ch[X_RMT_CHANNEL].conf1.mem_rd_rst = 1;
RMT.conf_ch[X_RMT_CHANNEL].conf1.tx_start = 1; }
if ( (ganged_mode == SQUARING_MODE_DUAL) || (ganged_mode == SQUARING_MODE_B) ) {
RMT.conf_ch[X_B_RMT_CHANNEL].conf1.mem_rd_rst = 1;
RMT.conf_ch[X_B_RMT_CHANNEL].conf1.tx_start = 1;
}
#endif
}
#endif
#ifdef Y_STEP_PIN
if(st.step_outbits & (1<<Y_AXIS)) {
#ifndef Y_STEP_B_PIN // if not a ganged axis
RMT.conf_ch[Y_RMT_CHANNEL].conf1.mem_rd_rst = 1;
RMT.conf_ch[Y_RMT_CHANNEL].conf1.tx_start = 1;
#else // it is a ganged axis
if ( (ganged_mode == SQUARING_MODE_DUAL) || (ganged_mode == SQUARING_MODE_A) ) {
RMT.conf_ch[Y_RMT_CHANNEL].conf1.mem_rd_rst = 1;
RMT.conf_ch[Y_RMT_CHANNEL].conf1.tx_start = 1;
}
if ( (ganged_mode == SQUARING_MODE_DUAL) || (ganged_mode == SQUARING_MODE_B) ) {
RMT.conf_ch[Y_B_RMT_CHANNEL].conf1.mem_rd_rst = 1;
RMT.conf_ch[Y_B_RMT_CHANNEL].conf1.tx_start = 1;
}
#endif
}
#endif
#ifdef Z_STEP_PIN
if(st.step_outbits & (1<<Z_AXIS)) {
RMT.conf_ch[Z_RMT_CHANNEL].conf1.mem_rd_rst = 1;
RMT.conf_ch[Z_RMT_CHANNEL].conf1.tx_start = 1;
}
#endif
}
#endif
// TODO: Replace direct updating of the int32 position counters in the ISR somehow. Perhaps use smaller // TODO: Replace direct updating of the int32 position counters in the ISR somehow. Perhaps use smaller
// int8 variables and update position counters only when a segment completes. This can get complicated // int8 variables and update position counters only when a segment completes. This can get complicated
// with probing and homing cycles that require true real-time positions. // with probing and homing cycles that require true real-time positions.
@@ -670,57 +722,6 @@ void set_stepper_pins_on(uint8_t onMask)
} }
#endif #endif
#ifdef USE_RMT_STEPS
// Set stepper pulse output pins
inline IRAM_ATTR static void stepperRMT_Outputs()
{
#ifdef X_STEP_PIN
if(st.step_outbits & (1<<X_AXIS)) {
#ifndef X_STEP_B_PIN // if not a ganged axis
RMT.conf_ch[X_RMT_CHANNEL].conf1.mem_rd_rst = 1;
RMT.conf_ch[X_RMT_CHANNEL].conf1.tx_start = 1;
#else // it is a ganged axis
if ( (ganged_mode == SQUARING_MODE_DUAL) || (ganged_mode == SQUARING_MODE_A) ) {
RMT.conf_ch[X_RMT_CHANNEL].conf1.mem_rd_rst = 1;
RMT.conf_ch[X_RMT_CHANNEL].conf1.tx_start = 1; }
if ( (ganged_mode == SQUARING_MODE_DUAL) || (ganged_mode == SQUARING_MODE_B) ) {
RMT.conf_ch[X_B_RMT_CHANNEL].conf1.mem_rd_rst = 1;
RMT.conf_ch[X_B_RMT_CHANNEL].conf1.tx_start = 1;
}
#endif
}
#endif
#ifdef Y_STEP_PIN
if(st.step_outbits & (1<<Y_AXIS)) {
#ifndef Y_STEP_B_PIN // if not a ganged axis
RMT.conf_ch[Y_RMT_CHANNEL].conf1.mem_rd_rst = 1;
RMT.conf_ch[Y_RMT_CHANNEL].conf1.tx_start = 1;
#else // it is a ganged axis
if ( (ganged_mode == SQUARING_MODE_DUAL) || (ganged_mode == SQUARING_MODE_A) ) {
RMT.conf_ch[Y_RMT_CHANNEL].conf1.mem_rd_rst = 1;
RMT.conf_ch[Y_RMT_CHANNEL].conf1.tx_start = 1;
}
if ( (ganged_mode == SQUARING_MODE_DUAL) || (ganged_mode == SQUARING_MODE_B) ) {
RMT.conf_ch[Y_B_RMT_CHANNEL].conf1.mem_rd_rst = 1;
RMT.conf_ch[Y_B_RMT_CHANNEL].conf1.tx_start = 1;
}
#endif
}
#endif
#ifdef Z_STEP_PIN
if(st.step_outbits & (1<<Z_AXIS)) {
RMT.conf_ch[Z_RMT_CHANNEL].conf1.mem_rd_rst = 1;
RMT.conf_ch[Z_RMT_CHANNEL].conf1.tx_start = 1;
}
#endif
}
#endif
// Stepper shutdown // Stepper shutdown
void st_go_idle() void st_go_idle()
{ {

View File

@@ -83,7 +83,6 @@ void IRAM_ATTR onSteppertimer();
void IRAM_ATTR onStepperOffTimer(); void IRAM_ATTR onStepperOffTimer();
void stepper_init(); void stepper_init();
void initRMT(); void initRMT();
inline IRAM_ATTR static void stepperRMT_Outputs();
// Enable steppers, but cycle does not start unless called by motion control or realtime command. // Enable steppers, but cycle does not start unless called by motion control or realtime command.
void st_wake_up(); void st_wake_up();

View File

@@ -6,7 +6,7 @@
### Project Overview ### Project Overview
[![Build Status](https://travis-ci.org/bdring/Grbl_Esp32.svg?branch=master)](https://travis-ci.org/bdring/Grbl_Esp32) [![Build Status](https://travis-ci.com/odaki/Grbl_Esp32.svg?branch=master)](https://travis-ci.com/odaki/Grbl_Esp32)
This is a port of [Grbl](https://github.com/gnea/grbl) for the ESP32. The ESP32 is potentially a great target for Grbl for the following reasons This is a port of [Grbl](https://github.com/gnea/grbl) for the ESP32. The ESP32 is potentially a great target for Grbl for the following reasons
@@ -54,4 +54,3 @@ Start asking questions...I'll put the frequent ones here.
This project requires a lot of work and often expensive items for testing. Please consider a safe, secure and highly appreciated donation via the PayPal link below. This project requires a lot of work and often expensive items for testing. Please consider a safe, secure and highly appreciated donation via the PayPal link below.
[![](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TKNJ9Z775VXB2) [![](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TKNJ9Z775VXB2)