diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 8f530369e3d6..2b3acaa3b6a2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -139,7 +139,7 @@ // Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_RAMPS_14_EFB + #define MOTHERBOARD BOARD_RESP32_CUSTOM #endif // Name displayed in the LCD "Ready" message and Info menu @@ -482,7 +482,7 @@ * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * */ -#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_0 998 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index acb7e9c39a8a..40557da49ed6 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1125,6 +1125,15 @@ inline void tmc_standby_setup() { * - Open Touch Screen Calibration screen, if not calibrated * - Set Marlin to RUNNING State */ + +bool flag_hogee = false; + +void kill_hogee_ISR(){ + parser.command_letter='M'; + parser.codenum=410; + flag_hogee=true; +} + void setup() { #ifdef FASTIO_INIT FASTIO_INIT(); @@ -1630,6 +1639,8 @@ void setup() { marlin_state = MF_RUNNING; SETUP_LOG("setup() completed."); + pinMode(KILL_hogee, INPUT); + attachInterrupt(digitalPinToInterrupt(KILL_hogee), kill_hogee_ISR, HIGH); } /** @@ -1659,6 +1670,9 @@ void loop() { endstops.event_handler(); TERN_(HAS_TFT_LVGL_UI, printer_state_polling()); - + if (flag_hogee){ + gcode.process_parsed_command(); + flag_hogee=false; + } } while (ENABLED(__AVR__)); // Loop forever on slower (AVR) boards } diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 2ed585919966..ba9947712bc0 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -422,6 +422,7 @@ // // Custom board // +#define BOARD_RESP32_CUSTOM 9001 // rutilea ESP32 custom board #define BOARD_CUSTOM 9998 // Custom pins definition for development and/or rare boards diff --git a/Marlin/src/pins/custom/esp32/pins_resp32_custom.h b/Marlin/src/pins/custom/esp32/pins_resp32_custom.h new file mode 100644 index 000000000000..387d8cf2d1c1 --- /dev/null +++ b/Marlin/src/pins/custom/esp32/pins_resp32_custom.h @@ -0,0 +1,93 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Espressif ESP32 (Tensilica Xtensa LX6) pin assignments + */ + +#if NOT_TARGET(ARDUINO_ARCH_ESP32) + "Oops! Select an ESP32 board in 'Tools > Board.'" +#endif + +#define BOARD_INFO_NAME "Espressif ESP32" + +// +// I2S (steppers & other output-only pins) +// +#define I2S_STEPPER_STREAM +#define I2S_WS -1 +#define I2S_BCK -1 +#define I2S_DATA -1 + +// +// Limit Switches +// +#define X_MIN_PIN 34 +#define Y_MIN_PIN 35 +#define Z_MIN_PIN 15 + +// +// Steppers +// +#define X_STEP_PIN 27 +#define X_DIR_PIN 26 +#define X_ENABLE_PIN 25 +//#define X_CS_PIN 0 + +#define Y_STEP_PIN 33 +#define Y_DIR_PIN 32 +#define Y_ENABLE_PIN X_ENABLE_PIN +//#define Y_CS_PIN 13 + +#define Z_STEP_PIN 14 +#define Z_DIR_PIN 12 +#define Z_ENABLE_PIN X_ENABLE_PIN +//#define Z_CS_PIN 5 // SS_PIN + +#define E0_STEP_PIN 16 +#define E0_DIR_PIN 17 +#define E0_ENABLE_PIN X_ENABLE_PIN +//#define E0_CS_PIN 21 + +// +// Temperature Sensors +// +#define TEMP_0_PIN 36 // Analog Input +#define TEMP_BED_PIN 39 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN 2 +#define FAN1_PIN 13 +// #define FAN2_PIN 4 +#define HEATER_BED_PIN 2 +#define KILL_hogee 4 + +// SPI + +#define MOSI_PIN 23 +#define MISO_PIN 19 +#define SCK_PIN 18 +#define SDSS 5 +#define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 28c7ed007170..a8085c1f77f0 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -683,6 +683,8 @@ #elif MB(CUSTOM) #include "pins_custom.h" // env:custom +#elif MB(RESP32_CUSTOM) + #include "custom/esp32/pins_resp32_custom.h" // ESP32 env:esp32 // // Linux Native Debug board diff --git a/platformio.ini b/platformio.ini index db4d12ea7fb3..cc5800d446b1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,7 +13,7 @@ [platformio] src_dir = Marlin boards_dir = buildroot/share/PlatformIO/boards -default_envs = mega2560 +default_envs = esp32 include_dir = Marlin extra_configs = ini/avr.ini