mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-01 10:23:19 +02:00
Removed USE_I2S_OUT
This commit is contained in:
@@ -252,13 +252,13 @@ void limits_go_home(uint8_t cycle_mask, uint n_locate_cycles) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (STEP_MASK & axislock);
|
} while (STEP_MASK & axislock);
|
||||||
#ifdef USE_I2S_STEPS
|
|
||||||
if (config->_stepType == ST_I2S_STREAM) {
|
if (config->_stepType == ST_I2S_STREAM) {
|
||||||
if (!approach) {
|
if (!approach) {
|
||||||
delay_ms(I2S_OUT_DELAY_MS);
|
delay_ms(I2S_OUT_DELAY_MS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
st_reset(); // Immediately force kill steppers and reset step segment buffer.
|
st_reset(); // Immediately force kill steppers and reset step segment buffer.
|
||||||
delay_ms(debounce); // Delay to allow transient dynamics to dissipate.
|
delay_ms(debounce); // Delay to allow transient dynamics to dissipate.
|
||||||
// Reverse direction and reset homing rate for locate cycle(s).
|
// Reverse direction and reset homing rate for locate cycle(s).
|
||||||
|
@@ -29,8 +29,6 @@
|
|||||||
// === Special Features
|
// === Special Features
|
||||||
|
|
||||||
// I2S (steppers & other output-only pins)
|
// I2S (steppers & other output-only pins)
|
||||||
#define USE_I2S_OUT
|
|
||||||
#define USE_I2S_STEPS
|
|
||||||
//#define DEFAULT_STEPPER ST_I2S_STATIC
|
//#define DEFAULT_STEPPER ST_I2S_STATIC
|
||||||
|
|
||||||
#define USE_STEPSTICK // makes sure MS1,2,3 !reset and !sleep are set
|
#define USE_STEPSTICK // makes sure MS1,2,3 !reset and !sleep are set
|
||||||
|
@@ -29,8 +29,6 @@
|
|||||||
// === Special Features
|
// === Special Features
|
||||||
|
|
||||||
// I2S (steppers & other output-only pins)
|
// I2S (steppers & other output-only pins)
|
||||||
#define USE_I2S_OUT
|
|
||||||
#define USE_I2S_STEPS
|
|
||||||
//#define DEFAULT_STEPPER ST_I2S_STATIC
|
//#define DEFAULT_STEPPER ST_I2S_STATIC
|
||||||
|
|
||||||
#define USE_STEPSTICK // makes sure MS1,2,3 !reset and !sleep are set
|
#define USE_STEPSTICK // makes sure MS1,2,3 !reset and !sleep are set
|
||||||
|
@@ -29,8 +29,6 @@
|
|||||||
// === Special Features
|
// === Special Features
|
||||||
|
|
||||||
// I2S (steppers & other output-only pins)
|
// I2S (steppers & other output-only pins)
|
||||||
#define USE_I2S_OUT
|
|
||||||
#define USE_I2S_STEPS
|
|
||||||
//#define DEFAULT_STEPPER ST_I2S_STATIC
|
//#define DEFAULT_STEPPER ST_I2S_STATIC
|
||||||
// === Default settings
|
// === Default settings
|
||||||
#define DEFAULT_STEP_PULSE_MICROSECONDS I2S_OUT_USEC_PER_PULSE
|
#define DEFAULT_STEP_PULSE_MICROSECONDS I2S_OUT_USEC_PER_PULSE
|
||||||
|
@@ -29,8 +29,6 @@
|
|||||||
// === Special Features
|
// === Special Features
|
||||||
|
|
||||||
// I2S (steppers & other output-only pins)
|
// I2S (steppers & other output-only pins)
|
||||||
#define USE_I2S_OUT
|
|
||||||
#define USE_I2S_STEPS
|
|
||||||
//#define DEFAULT_STEPPER ST_I2S_STATIC
|
//#define DEFAULT_STEPPER ST_I2S_STATIC
|
||||||
|
|
||||||
#define USE_STEPSTICK // makes sure MS1,2,3 !reset and !sleep are set
|
#define USE_STEPSTICK // makes sure MS1,2,3 !reset and !sleep are set
|
||||||
|
@@ -24,8 +24,6 @@
|
|||||||
#define N_AXIS 6
|
#define N_AXIS 6
|
||||||
|
|
||||||
// I2S (steppers & other output-only pins)
|
// I2S (steppers & other output-only pins)
|
||||||
#define USE_I2S_OUT
|
|
||||||
#define USE_I2S_STEPS
|
|
||||||
//#define DEFAULT_STEPPER ST_I2S_STATIC
|
//#define DEFAULT_STEPPER ST_I2S_STATIC
|
||||||
|
|
||||||
#define I2S_OUT_BCK "gpio.22"
|
#define I2S_OUT_BCK "gpio.22"
|
||||||
|
@@ -30,8 +30,6 @@
|
|||||||
// === Special Features
|
// === Special Features
|
||||||
|
|
||||||
//**I2S (steppers & other output-only pins)
|
//**I2S (steppers & other output-only pins)
|
||||||
#define USE_I2S_OUT
|
|
||||||
#define USE_I2S_STEPS
|
|
||||||
//#define DEFAULT_STEPPER ST_I2S_STATIC
|
//#define DEFAULT_STEPPER ST_I2S_STATIC
|
||||||
#define USE_STEPSTICK // makes sure MS1,2,3 !reset and !sleep are set
|
#define USE_STEPSTICK // makes sure MS1,2,3 !reset and !sleep are set
|
||||||
|
|
||||||
|
@@ -57,8 +57,6 @@
|
|||||||
|
|
||||||
|
|
||||||
// I2S (steppers & other output-only pins)
|
// I2S (steppers & other output-only pins)
|
||||||
#define USE_I2S_OUT
|
|
||||||
#define USE_I2S_STEPS
|
|
||||||
//#define DEFAULT_STEPPER ST_I2S_STATIC
|
//#define DEFAULT_STEPPER ST_I2S_STATIC
|
||||||
// === Default settings
|
// === Default settings
|
||||||
#define DEFAULT_STEP_PULSE_MICROSECONDS I2S_OUT_USEC_PER_PULSE
|
#define DEFAULT_STEP_PULSE_MICROSECONDS I2S_OUT_USEC_PER_PULSE
|
||||||
|
@@ -37,4 +37,3 @@
|
|||||||
|
|
||||||
#define MACHINE_NAME "Test Drive - Demo Only No I/O!"
|
#define MACHINE_NAME "Test Drive - Demo Only No I/O!"
|
||||||
|
|
||||||
#define USE_I2S_STEPS
|
|
@@ -299,24 +299,11 @@ static bool axis_is_squared(AxisMask axis_mask) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_I2S_STEPS
|
inline void RESTORE_STEPPER(int save_stepper) {
|
||||||
# define BACKUP_STEPPER(save_stepper) \
|
if (save_stepper == ST_I2S_STREAM && config->_stepType != ST_I2S_STREAM) {
|
||||||
do { \
|
stepper_switch(ST_I2S_STREAM); /* Put the stepper back on. */
|
||||||
if (save_stepper == ST_I2S_STREAM) { \
|
}
|
||||||
stepper_switch(ST_I2S_STATIC); /* Change the stepper to reduce the delay for accurate probing. */ \
|
}
|
||||||
} \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
# define RESTORE_STEPPER(save_stepper) \
|
|
||||||
do { \
|
|
||||||
if (save_stepper == ST_I2S_STREAM && config->_stepType != ST_I2S_STREAM) { \
|
|
||||||
stepper_switch(ST_I2S_STREAM); /* Put the stepper back on. */ \
|
|
||||||
} \
|
|
||||||
} while (0)
|
|
||||||
#else
|
|
||||||
# define BACKUP_STEPPER(save_stepper)
|
|
||||||
# define RESTORE_STEPPER(save_stepper)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// For this routine, homing_mask cannot be 0. The 0 case,
|
// For this routine, homing_mask cannot be 0. The 0 case,
|
||||||
// meaning run all cycles, is handled by the caller mc_homing_cycle()
|
// meaning run all cycles, is handled by the caller mc_homing_cycle()
|
||||||
@@ -429,11 +416,12 @@ GCUpdatePos mc_probe_cycle(float* target, plan_line_data_t* pl_data, uint8_t par
|
|||||||
return GCUpdatePos::None; // Return if system reset has been issued.
|
return GCUpdatePos::None; // Return if system reset has been issued.
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_I2S_STEPS
|
|
||||||
int save_stepper = config->_stepType; /* remember the stepper */
|
int save_stepper = config->_stepType; /* remember the stepper */
|
||||||
#endif
|
|
||||||
// Switch stepper mode to the I2S static (realtime mode)
|
// Switch stepper mode to the I2S static (realtime mode)
|
||||||
BACKUP_STEPPER(save_stepper);
|
if (save_stepper == ST_I2S_STREAM) {
|
||||||
|
stepper_switch(ST_I2S_STATIC); /* Change the stepper to reduce the delay for accurate probing. */
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize probing control variables
|
// Initialize probing control variables
|
||||||
bool is_probe_away = bit_istrue(parser_flags, GCParserProbeIsAway);
|
bool is_probe_away = bit_istrue(parser_flags, GCParserProbeIsAway);
|
||||||
@@ -572,10 +560,8 @@ void mc_reset() {
|
|||||||
}
|
}
|
||||||
ganged_mode = gangDual; // in case an error occurred during squaring
|
ganged_mode = gangDual; // in case an error occurred during squaring
|
||||||
|
|
||||||
#ifdef USE_I2S_STEPS
|
|
||||||
if (config->_stepType == ST_I2S_STREAM) {
|
if (config->_stepType == ST_I2S_STREAM) {
|
||||||
i2s_out_reset();
|
i2s_out_reset();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -249,20 +249,16 @@ Error home(int cycle) {
|
|||||||
}
|
}
|
||||||
sys.state = State::Homing; // Set system state variable
|
sys.state = State::Homing; // Set system state variable
|
||||||
|
|
||||||
#ifdef USE_I2S_STEPS
|
|
||||||
int save_stepper = config->_stepType;
|
int save_stepper = config->_stepType;
|
||||||
if (save_stepper == ST_I2S_STREAM) {
|
if (save_stepper == ST_I2S_STREAM) {
|
||||||
stepper_switch(ST_I2S_STATIC);
|
stepper_switch(ST_I2S_STATIC);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
mc_homing_cycle(cycle);
|
mc_homing_cycle(cycle);
|
||||||
|
|
||||||
#ifdef USE_I2S_STEPS
|
|
||||||
if (save_stepper == ST_I2S_STREAM && config->_stepType != ST_I2S_STREAM) {
|
if (save_stepper == ST_I2S_STREAM && config->_stepType != ST_I2S_STREAM) {
|
||||||
stepper_switch(ST_I2S_STREAM);
|
stepper_switch(ST_I2S_STREAM);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!sys.abort) { // Execute startup scripts after successful homing.
|
if (!sys.abort) { // Execute startup scripts after successful homing.
|
||||||
sys.state = State::Idle; // Set to IDLE when complete.
|
sys.state = State::Idle; // Set to IDLE when complete.
|
||||||
|
@@ -339,10 +339,9 @@ void stepper_init() {
|
|||||||
config->_disableDelayMicroSeconds,
|
config->_disableDelayMicroSeconds,
|
||||||
config->_directionDelayMicroSeconds);
|
config->_directionDelayMicroSeconds);
|
||||||
|
|
||||||
#ifdef USE_I2S_STEPS
|
|
||||||
// I2S stepper stream mode use callback but timer interrupt
|
// I2S stepper stream mode use callback but timer interrupt
|
||||||
i2s_out_set_pulse_callback(stepper_pulse_func);
|
i2s_out_set_pulse_callback(stepper_pulse_func);
|
||||||
#endif
|
|
||||||
// Other stepper use timer interrupt
|
// Other stepper use timer interrupt
|
||||||
Stepper_Timer_Init();
|
Stepper_Timer_Init();
|
||||||
}
|
}
|
||||||
@@ -353,7 +352,7 @@ void stepper_switch(stepper_id_t new_stepper) {
|
|||||||
// do not need to change
|
// do not need to change
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifdef USE_I2S_STEPS
|
|
||||||
if (config->_stepType == ST_I2S_STREAM) {
|
if (config->_stepType == ST_I2S_STREAM) {
|
||||||
if (i2s_out_get_pulser_status() != PASSTHROUGH) {
|
if (i2s_out_get_pulser_status() != PASSTHROUGH) {
|
||||||
// Called during streaming. Stop streaming.
|
// Called during streaming. Stop streaming.
|
||||||
@@ -362,7 +361,7 @@ void stepper_switch(stepper_id_t new_stepper) {
|
|||||||
i2s_out_delay(); // Wait for a change in mode.
|
i2s_out_delay(); // Wait for a change in mode.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
config->_stepType = new_stepper;
|
config->_stepType = new_stepper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,11 +389,10 @@ void st_reset() {
|
|||||||
//Serial.println("st_reset()");
|
//Serial.println("st_reset()");
|
||||||
#endif
|
#endif
|
||||||
// Initialize stepper driver idle state.
|
// Initialize stepper driver idle state.
|
||||||
#ifdef USE_I2S_STEPS
|
|
||||||
if (config->_stepType == ST_I2S_STREAM) {
|
if (config->_stepType == ST_I2S_STREAM) {
|
||||||
i2s_out_reset();
|
i2s_out_reset();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
st_go_idle();
|
st_go_idle();
|
||||||
// Initialize stepper algorithm variables.
|
// Initialize stepper algorithm variables.
|
||||||
memset(&prep, 0, sizeof(st_prep_t));
|
memset(&prep, 0, sizeof(st_prep_t));
|
||||||
@@ -915,12 +913,10 @@ float st_get_realtime_rate() {
|
|||||||
// The argument is in units of ticks of the timer that generates ISRs
|
// The argument is in units of ticks of the timer that generates ISRs
|
||||||
void IRAM_ATTR Stepper_Timer_WritePeriod(uint16_t timerTicks) {
|
void IRAM_ATTR Stepper_Timer_WritePeriod(uint16_t timerTicks) {
|
||||||
if (config->_stepType == ST_I2S_STREAM) {
|
if (config->_stepType == ST_I2S_STREAM) {
|
||||||
#ifdef USE_I2S_STEPS
|
|
||||||
// 1 tick = fTimers / fStepperTimer
|
// 1 tick = fTimers / fStepperTimer
|
||||||
// Pulse ISR is called for each tick of alarm_val.
|
// Pulse ISR is called for each tick of alarm_val.
|
||||||
// The argument to i2s_out_set_pulse_period is in units of microseconds
|
// The argument to i2s_out_set_pulse_period is in units of microseconds
|
||||||
i2s_out_set_pulse_period(((uint32_t)timerTicks) / ticksPerMicrosecond);
|
i2s_out_set_pulse_period(((uint32_t)timerTicks) / ticksPerMicrosecond);
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
timerAlarmWrite(stepTimer, (uint64_t)timerTicks, autoReload);
|
timerAlarmWrite(stepTimer, (uint64_t)timerTicks, autoReload);
|
||||||
}
|
}
|
||||||
@@ -938,9 +934,7 @@ void IRAM_ATTR Stepper_Timer_Start() {
|
|||||||
//Serial.println("ST Start");
|
//Serial.println("ST Start");
|
||||||
#endif
|
#endif
|
||||||
if (config->_stepType == ST_I2S_STREAM) {
|
if (config->_stepType == ST_I2S_STREAM) {
|
||||||
#ifdef USE_I2S_STEPS
|
|
||||||
i2s_out_set_stepping();
|
i2s_out_set_stepping();
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
timerWrite(stepTimer, 0ULL);
|
timerWrite(stepTimer, 0ULL);
|
||||||
timerAlarmEnable(stepTimer);
|
timerAlarmEnable(stepTimer);
|
||||||
|
@@ -32,7 +32,7 @@ enum stepper_id_t {
|
|||||||
ST_TIMED = 0,
|
ST_TIMED = 0,
|
||||||
ST_RMT,
|
ST_RMT,
|
||||||
ST_I2S_STATIC,
|
ST_I2S_STATIC,
|
||||||
ST_I2S_STREAM,
|
ST_I2S_STREAM,
|
||||||
};
|
};
|
||||||
|
|
||||||
// esp32 work around for diable in main loop
|
// esp32 work around for diable in main loop
|
||||||
|
@@ -13,7 +13,7 @@ src_dir = Grbl_Esp32
|
|||||||
lib_dir = libraries
|
lib_dir = libraries
|
||||||
test_dir = Grbl_Esp32/test
|
test_dir = Grbl_Esp32/test
|
||||||
data_dir = Grbl_Esp32/data
|
data_dir = Grbl_Esp32/data
|
||||||
default_envs = release
|
default_envs = wifi
|
||||||
;extra_configs=debug.ini
|
;extra_configs=debug.ini
|
||||||
|
|
||||||
[common_env_data]
|
[common_env_data]
|
||||||
@@ -54,13 +54,13 @@ src_filter =
|
|||||||
-<.git/> -<data/> -<test/> -<tests/>
|
-<.git/> -<data/> -<test/> -<tests/>
|
||||||
test_build_project_src = true
|
test_build_project_src = true
|
||||||
|
|
||||||
[env:release]
|
[env:debug]
|
||||||
|
build_type = debug
|
||||||
lib_deps =
|
lib_deps =
|
||||||
TMCStepper@>=0.7.0,<1.0.0
|
TMCStepper@>=0.7.0,<1.0.0
|
||||||
ESP8266 and ESP32 OLED driver for SSD1306 displays@^4.2.0
|
ESP8266 and ESP32 OLED driver for SSD1306 displays@^4.2.0
|
||||||
|
|
||||||
[env:debug]
|
[env:noradio]
|
||||||
build_type = debug
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
TMCStepper@>=0.7.0,<1.0.0
|
TMCStepper@>=0.7.0,<1.0.0
|
||||||
ESP8266 and ESP32 OLED driver for SSD1306 displays@^4.2.0
|
ESP8266 and ESP32 OLED driver for SSD1306 displays@^4.2.0
|
||||||
|
Reference in New Issue
Block a user