From 7b7bd8b68cba4f36ed7f8377a9f947dd7f45c7f1 Mon Sep 17 00:00:00 2001 From: Terje Io Date: Wed, 2 Oct 2024 09:22:52 +0700 Subject: [PATCH] Added symbol for overriding SD card frequency, bug fix --- main/boards/xPro_v5_map.h | 1 + main/driver.c | 7 +++++-- main/driver.h | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/main/boards/xPro_v5_map.h b/main/boards/xPro_v5_map.h index 9c0170a..01ca18a 100644 --- a/main/boards/xPro_v5_map.h +++ b/main/boards/xPro_v5_map.h @@ -110,4 +110,5 @@ #define MOTOR_CS_PIN GPIO_NUM_17 #if SDCARD_ENABLE #define PIN_NUM_CS GPIO_NUM_5 +#define SDMMC_FREQ_KHZ 10000 #endif diff --git a/main/driver.c b/main/driver.c index 51d27af..c772969 100644 --- a/main/driver.c +++ b/main/driver.c @@ -795,7 +795,7 @@ IRAM_ATTR static void I2SStepperPulseStart (stepper_t *stepper) static void I2SStepperWakeUp (void) { // Enable stepper drivers. - hal.stepper.enable((axes_signals_t){AXES_BITMASK}); + hal.stepper.enable((axes_signals_t){AXES_BITMASK}, false); i2s_out_set_stepping(); } @@ -2577,6 +2577,9 @@ static char *sdcard_mount (FATFS **fs) }; sdmmc_host_t host = SDSPI_HOST_DEFAULT(); +#ifdef SDMMC_FREQ_KHZ + host.max_freq_khz = SDMMC_FREQ_KHZ; +#endif sdspi_device_config_t slot_config = SDSPI_DEVICE_CONFIG_DEFAULT(); slot_config.gpio_cs = PIN_NUM_CS; slot_config.host_id = host.slot; @@ -2981,7 +2984,7 @@ bool driver_init (void) #else hal.info = "ESP32"; #endif - hal.driver_version = "240921"; + hal.driver_version = "241002"; hal.driver_url = GRBL_URL "/ESP32"; #ifdef BOARD_NAME hal.board = BOARD_NAME; diff --git a/main/driver.h b/main/driver.h index 740d4f6..8b6d9c3 100644 --- a/main/driver.h +++ b/main/driver.h @@ -173,7 +173,7 @@ typedef struct { #error "Pins 34 - 39 are input only!" #endif -#if USE_I2S_OUT && STEP_INJECT_ENABLE +#if defined(USE_I2S_OUT) && STEP_INJECT_ENABLE #error "Step injection not yet possible with I2S streaming!" #endif