From 3bcb600dca41ee850f934782168d8aa6a61ef743 Mon Sep 17 00:00:00 2001 From: Paciente8159 Date: Thu, 4 Jan 2024 17:08:16 +0000 Subject: [PATCH 1/2] Added shield v3 for ESP32 --- uCNC/src/hal/boards/boarddefs.h | 5 ++ uCNC/src/hal/boards/boards.h | 1 + .../boards/esp32/boardmap_esp32_shield_v3.h | 51 +++++++++++++++++++ uCNC/src/hal/boards/esp32/esp32.ini | 6 +++ 4 files changed, 63 insertions(+) create mode 100644 uCNC/src/hal/boards/esp32/boardmap_esp32_shield_v3.h diff --git a/uCNC/src/hal/boards/boarddefs.h b/uCNC/src/hal/boards/boarddefs.h index aa65fb4d8..7e7a8d9ef 100644 --- a/uCNC/src/hal/boards/boarddefs.h +++ b/uCNC/src/hal/boards/boarddefs.h @@ -143,6 +143,11 @@ extern "C" #include "esp32/boardmap_mks_dlc32.h" #endif +#if (BOARD == BOARD_ESP32_SHIELD_V3) +#define MCU MCU_ESP32 +#include "esp32/boardmap_esp32_shield_v3.h" +#endif + #if (BOARD == BOARD_RPI_PICO) #define MCU MCU_RP2040 #include "rp2040/boardmap_rpi_pico.h" diff --git a/uCNC/src/hal/boards/boards.h b/uCNC/src/hal/boards/boards.h index 65afc008e..c95d5c912 100644 --- a/uCNC/src/hal/boards/boards.h +++ b/uCNC/src/hal/boards/boards.h @@ -44,6 +44,7 @@ extern "C" #define BOARD_WEMOS_D1_R32 50 #define BOARD_MKS_TINYBEE 51 #define BOARD_MKS_DLC32 52 +#define BOARD_ESP32_SHIELD_V3 53 #define BOARD_RPI_PICO 60 #define BOARD_RPI_PICO_W 61 #define BOARD_VIRTUAL 99 diff --git a/uCNC/src/hal/boards/esp32/boardmap_esp32_shield_v3.h b/uCNC/src/hal/boards/esp32/boardmap_esp32_shield_v3.h new file mode 100644 index 000000000..2191bb962 --- /dev/null +++ b/uCNC/src/hal/boards/esp32/boardmap_esp32_shield_v3.h @@ -0,0 +1,51 @@ +/* + Name: boardmap_esp32_shield_v3.h + Description: Contains all MCU and PIN definitions for Arduino UNO similar to Grbl 0.8 to run µCNC. + + Copyright: Copyright (c) João Martins + Author: João Martins + Date: 04/01/2024 + + µCNC is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. Please see + + µCNC is distributed WITHOUT ANY WARRANTY; + Also without the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. +*/ + +#ifndef BOARDMAP_ESP_SHIELD_V3_H +#define BOARDMAP_ESP_SHIELD_V3_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifndef BOARD_NAME +#define BOARD_NAME "ESP32 SHIELD V3" +#endif + +#include "boardmap_wemos_d1_r32.h" + +//swap limit z and replace pwm by spin enable pin +#ifdef LIMIT_Z_BIT +#undef LIMIT_Z_BIT +#endif +#ifdef PWM0_BIT +#undef PWM0_BIT +#endif + +// Grbl 0.8 limit z +#define LIMIT_Z_BIT 23 // assigns LIMIT_Z pin + +// Grbl 0.8 spindle en +#define PWM0_BIT 23 // assigns PWM0 pin + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/uCNC/src/hal/boards/esp32/esp32.ini b/uCNC/src/hal/boards/esp32/esp32.ini index ae7829d2a..9a37dbca9 100644 --- a/uCNC/src/hal/boards/esp32/esp32.ini +++ b/uCNC/src/hal/boards/esp32/esp32.ini @@ -38,6 +38,12 @@ build_flags = ${common_esp32.build_flags} -DBOARD=BOARD_MKS_TINYBEE -DMCU_FLASH_ board_build.filesystem = littlefs lib_deps = ${common_esp32.lib_deps}, LittleFS +[env:ESP32-Shield-V3] +extends = common_esp32 +build_flags = ${common_esp32.build_flags} -DBOARD=BOARD_ESP32_SHIELD_V3 -DMCU_FLASH_FS=1 +board_build.filesystem = littlefs +lib_deps = ${common_esp32.lib_deps}, LittleFS + ################# # ESPIDF builds # ################# From 6b8ab61525160c0cb8f50d78bee80a806e758e17 Mon Sep 17 00:00:00 2001 From: Paciente8159 Date: Thu, 4 Jan 2024 17:11:43 +0000 Subject: [PATCH 2/2] Update boardmap_esp32_shield_v3.h --- uCNC/src/hal/boards/esp32/boardmap_esp32_shield_v3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uCNC/src/hal/boards/esp32/boardmap_esp32_shield_v3.h b/uCNC/src/hal/boards/esp32/boardmap_esp32_shield_v3.h index 2191bb962..6e6106d94 100644 --- a/uCNC/src/hal/boards/esp32/boardmap_esp32_shield_v3.h +++ b/uCNC/src/hal/boards/esp32/boardmap_esp32_shield_v3.h @@ -42,7 +42,7 @@ extern "C" #define LIMIT_Z_BIT 23 // assigns LIMIT_Z pin // Grbl 0.8 spindle en -#define PWM0_BIT 23 // assigns PWM0 pin +#define PWM0_BIT 19 // assigns PWM0 pin #ifdef __cplusplus }