diff --git a/main/boards/xPro_v5_map.h b/main/boards/xPro_v5_map.h index b1f8ec6..4d51d0c 100644 --- a/main/boards/xPro_v5_map.h +++ b/main/boards/xPro_v5_map.h @@ -5,7 +5,7 @@ Part of grblHAL - Copyright (c) 2021-2022 Terje Io + Copyright (c) 2021-2024 Terje Io grblHAL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,6 +35,8 @@ #error BOARD_XPRO_V5 has soldered TMC5160 drivers. #endif +#define TRINAMIC_MIXED_DRIVERS 0 + // timer definitions #define STEP_TIMER_GROUP TIMER_GROUP_0 #define STEP_TIMER_INDEX TIMER_0 diff --git a/main/driver.c b/main/driver.c index 7b10b16..68d7fd5 100644 --- a/main/driver.c +++ b/main/driver.c @@ -2014,25 +2014,25 @@ static void settings_changed (settings_t *settings, settings_changed_flags_t cha #ifdef NEOPIXELS_PIN - if(neopixel.leds == NULL || hal.rgb.num_devices != settings->rgb_strip0_length) { + if(neopixel.leds == NULL || hal.rgb0.num_devices != settings->rgb_strip0_length) { if(settings->rgb_strip0_length == 0) - settings->rgb_strip0_length = hal.rgb.num_devices; + settings->rgb_strip0_length = hal.rgb0.num_devices; else - hal.rgb.num_devices = settings->rgb_strip0_length; + hal.rgb0.num_devices = settings->rgb_strip0_length; if(neopixel.leds) { free(neopixel.leds); neopixel.leds = NULL; } - if(hal.rgb.num_devices) { - neopixel.num_bytes = hal.rgb.num_devices * 3; + if(hal.rgb0.num_devices) { + neopixel.num_bytes = hal.rgb0.num_devices * 3; if((neopixel.leds = calloc(neopixel.num_bytes, sizeof(uint8_t))) == NULL) - hal.rgb.num_devices = 0; + hal.rgb0.num_devices = 0; } - neopixel.num_leds = hal.rgb.num_devices; + neopixel.num_leds = hal.rgb0.num_devices; } #endif @@ -2122,6 +2122,11 @@ static void settings_changed (settings_t *settings, settings_changed_flags_t cha signal->mode.inverted = control_fei.reset; break; + case Input_EStop: + signal->mode.pull_mode = settings->control_disable_pullup.e_stop ? PullMode_Down : PullMode_Up; + signal->mode.inverted = control_fei.e_stop; + break; + case Input_FeedHold: signal->mode.pull_mode = settings->control_disable_pullup.feed_hold ? PullMode_Down : PullMode_Up; signal->mode.inverted = control_fei.feed_hold; @@ -2744,8 +2749,8 @@ static bool driver_setup (settings_t *settings) enet_start(); #endif -// if(hal.rgb.out) -// hal.rgb.out(0, (rgb_color_t){ .R = 5, .G = 100, .B = 5 }); +// if(hal.rgb0.out) +// hal.rgb0.out(0, (rgb_color_t){ .R = 5, .G = 100, .B = 5 }); return IOInitDone; } @@ -2802,7 +2807,7 @@ bool driver_init (void) #else hal.info = "ESP32"; #endif - hal.driver_version = "240304"; + hal.driver_version = "240310"; hal.driver_url = GRBL_URL "/ESP32"; #ifdef BOARD_NAME hal.board = BOARD_NAME; @@ -3060,12 +3065,12 @@ bool driver_init (void) // Initialize automatic timing translator rmt_translator_init(neo_config.channel, ws2812_rmt_adapter); - hal.rgb.out = neopixel_out; - hal.rgb.out_masked = neopixel_out_masked; - hal.rgb.write = neopixels_write; - hal.rgb.set_intensity = neopixels_set_intensity; - hal.rgb.num_devices = NEOPIXELS_NUM; - hal.rgb.cap = (rgb_color_t){ .R = 255, .G = 255, .B = 255 }; + hal.rgb0.out = neopixel_out; + hal.rgb0.out_masked = neopixel_out_masked; + hal.rgb0.write = neopixels_write; + hal.rgb0.set_intensity = neopixels_set_intensity; + hal.rgb0.num_devices = NEOPIXELS_NUM; + hal.rgb0.cap = (rgb_color_t){ .R = 255, .G = 255, .B = 255 }; const periph_pin_t neopixels = { .function = Output_LED_Adressable, diff --git a/main/driver.h b/main/driver.h index 5a193bc..891899c 100644 --- a/main/driver.h +++ b/main/driver.h @@ -98,14 +98,6 @@ static const DRAM_ATTR float FZERO = 0.0f; // End configuration -#if TRINAMIC_ENABLE -#ifndef TRINAMIC_MIXED_DRIVERS -#define TRINAMIC_MIXED_DRIVERS 1 -#endif -#include "motors/trinamic.h" -#include "trinamic/common.h" -#endif - typedef struct { uint8_t action; uint_fast16_t address; @@ -199,6 +191,14 @@ extern SemaphoreHandle_t i2cBusy; #error "I2C port not available!" #endif +#if TRINAMIC_ENABLE +#ifndef TRINAMIC_MIXED_DRIVERS +#define TRINAMIC_MIXED_DRIVERS 1 +#endif +#include "motors/trinamic.h" +#include "trinamic/common.h" +#endif + #if USB_SERIAL_CDC #define SP0 1 #else diff --git a/main/my_machine.h b/main/my_machine.h index 4a55276..961064e 100644 --- a/main/my_machine.h +++ b/main/my_machine.h @@ -19,32 +19,32 @@ // NOTE: Only one board may be enabled! // If none is enabled pin mappings from generic_map.h will be used -//#define BOARD_BDRING_V3P5 // -//#define BOARD_BDRING_V4 // -//#define BOARD_BDRING_I2S6A // -//#define BOARD_BDRING_6X // -#define BOARD_BDRING_I2S_6PACK_EXT_V2 // -//#define BOARD_ESPDUINO32 // -//#define BOARD_SOURCERABBIT_4AXIS // -//#define BOARD_PROTONEER_3XX // -//#define BOARD_FYSETC_E4 // -//#define BOARD_XPRO_V5 // -//#define BOARD_MKS_DLC32_V2P0 // -//#define BOARD_MKS_TINYBEE_V1 // -//#define BOARD_CNC3040 // -//#define BOARD_BLACKBOX_X32 // NOTE: Enable in CMakeLists.txt to set board specific defaults for the core! -//#define BOARD_ROOTCNC_V2 // -//#define BOARD_ROOTCNC_V3 // -//#define BOARD_CNC_BOOSTERPACK // -//#define BOARD_GENERIC_I2S_S3 // Generic map for ESP32-S3 with I2S shift registers for I/O expansion -//#define BOARD_MY_MACHINE // Add my_machine_map.h in the boards directory before enabling this! +//#define BOARD_BDRING_V3P5 // +//#define BOARD_BDRING_V4 // +//#define BOARD_BDRING_I2S6A // +//#define BOARD_BDRING_6X // +//#define BOARD_BDRING_I2S_6PACK_EXT_V2 // +//#define BOARD_ESPDUINO32 // +//#define BOARD_SOURCERABBIT_4AXIS // +//#define BOARD_PROTONEER_3XX // +//#define BOARD_FYSETC_E4 // +//#define BOARD_XPRO_V5 // +//#define BOARD_MKS_DLC32_V2P0 // +//#define BOARD_MKS_TINYBEE_V1 // +//#define BOARD_CNC3040 // +//#define BOARD_BLACKBOX_X32 // NOTE: Enable in CMakeLists.txt to set board specific defaults for the core! +//#define BOARD_ROOTCNC_V2 // +//#define BOARD_ROOTCNC_V3 // +//#define BOARD_CNC_BOOSTERPACK // +//#define BOARD_GENERIC_I2S_S3 // Generic map for ESP32-S3 with I2S shift registers for I/O expansion +//#define BOARD_MY_MACHINE // Add my_machine_map.h in the boards directory before enabling this! //#define BOARD_BLOX // Configuration // Uncomment to enable, for some a value > 1 may be assigned, if so the default value is shown. -// #if CONFIG_IDF_TARGET_ESP32S3 -// #define USB_SERIAL_CDC 1 // Serial communication via native USB. -// #endif +#if CONFIG_IDF_TARGET_ESP32S3 +#define USB_SERIAL_CDC 1 // Serial communication via native USB. +#endif // Spindle selection: // Up to four specific spindle drivers can be instantiated at a time @@ -102,7 +102,7 @@ // of axes can be enabled here. //#define X_GANGED 1 //#define X_AUTO_SQUARE 1 -#define Y_GANGED 1 +//#define Y_GANGED 1 //#define Y_AUTO_SQUARE 1 //#define Z_GANGED 1 //#define Z_AUTO_SQUARE 1 @@ -126,7 +126,7 @@ //#define WEBDAV_ENABLE 1 // webdav protocol - requires http daemon and SD card enabled. #endif // The following symbols have the default values as shown, uncomment and change as needed. -//#define NETWORK_STA_HOSTNAME "grblHAL_6x" +//#define NETWORK_STA_HOSTNAME "grblHAL" //#define NETWORK_STA_IPMODE 1 // 0 = static, 1 = DHCP, 2 = AutoIP //#define NETWORK_STA_IP "192.168.5.1" //#define NETWORK_STA_GATEWAY "192.168.5.1" diff --git a/platformio.ini b/platformio.ini index 0baeaca..7af063e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -29,6 +29,7 @@ build_flags = ; -DY_AUTO_SQUARE=1 ; -DDRIVER_SPINDLE_PWM_ENABLE=1 ; -DSDCARD_ENABLE=2 + -DNETWORK_STA_HOSTNAME=grblHAL_6x -DPROBE_ENABLE=1 -DPROBE_PIN=GPIO_NUM_2