diff --git a/Marlin/src/HAL/AVR/pinsDebug.h b/Marlin/src/HAL/AVR/pinsDebug.h index b91bde182d3..3fe877cd008 100644 --- a/Marlin/src/HAL/AVR/pinsDebug.h +++ b/Marlin/src/HAL/AVR/pinsDebug.h @@ -90,7 +90,6 @@ void PRINT_ARRAY_NAME(uint8_t x) { #define GET_ARRAY_IS_DIGITAL(x) pgm_read_byte(&pin_array[x].is_digital) - #if defined(__AVR_ATmega1284P__) // 1284 IDE extensions set this to the number of #undef NUM_DIGITAL_PINS // digital only pins while all other CPUs have it #define NUM_DIGITAL_PINS 32 // set to digital only + digital/analog diff --git a/Marlin/src/HAL/AVR/pinsDebug_plus_70.h b/Marlin/src/HAL/AVR/pinsDebug_plus_70.h index d9aa44c3cb1..fa479cfe8fd 100644 --- a/Marlin/src/HAL/AVR/pinsDebug_plus_70.h +++ b/Marlin/src/HAL/AVR/pinsDebug_plus_70.h @@ -231,7 +231,6 @@ const uint8_t PROGMEM digital_pin_to_bit_mask_PGM_plus_70[] = { #define digitalPinToBitMask_plus_70(P) ( pgm_read_byte( digital_pin_to_bit_mask_PGM_plus_70 + (P) ) ) - const uint8_t PROGMEM digital_pin_to_timer_PGM_plus_70[] = { // TIMERS // ------------------------ diff --git a/Marlin/src/HAL/TEENSY35_36/pinsDebug.h b/Marlin/src/HAL/TEENSY35_36/pinsDebug.h index 7a2e1d6e592..235c0e4a487 100644 --- a/Marlin/src/HAL/TEENSY35_36/pinsDebug.h +++ b/Marlin/src/HAL/TEENSY35_36/pinsDebug.h @@ -77,7 +77,7 @@ void HAL_analog_pin_state(char buffer[], int8_t pin) { * Print a pin's PWM status. * Return true if it's currently a PWM pin. */ -bool HAL_pwm_status(int8_t pin) { +bool HAL_pwm_status(const int8_t pin) { char buffer[20]; // for the sprintf statements switch (pin) { FTM_CASE(0,0); diff --git a/Marlin/src/HAL/TEENSY40_41/pinsDebug.h b/Marlin/src/HAL/TEENSY40_41/pinsDebug.h index fc90f671cff..c85a88c9ae6 100644 --- a/Marlin/src/HAL/TEENSY40_41/pinsDebug.h +++ b/Marlin/src/HAL/TEENSY40_41/pinsDebug.h @@ -136,7 +136,7 @@ void HAL_analog_pin_state(char buffer[], int8_t pin) { * Print a pin's PWM status. * Return true if it's currently a PWM pin. */ -bool HAL_pwm_status(int8_t pin) { +bool HAL_pwm_status(const int8_t pin) { char buffer[20]; // for the sprintf statements const struct pwm_pin_info_struct *info; diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 147080542d8..2f2ac1664e1 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -118,6 +118,8 @@ #define BOARD_LONGER3D_LKx_PRO 1162 // Longer LKx PRO / Alfawise Uxx Pro (PRO version) #define BOARD_ZRIB_V53 1163 // Zonestar zrib V5.3 (Chinese RAMPS replica) #define BOARD_PXMALION_CORE_I3 1164 // Pxmalion Core I3 +#define BOARD_PANOWIN_CUTLASS 1165 // Panowin Cutlass (as found in the Panowin F1) +#define BOARD_KODAMA_BARDO 1166 // Kodama Bardo V1.x (as found in the Kodama Trinus) // // RAMBo and derivatives diff --git a/Marlin/src/gcode/control/M42.cpp b/Marlin/src/gcode/control/M42.cpp index 1b3a29d1005..55ece67de70 100644 --- a/Marlin/src/gcode/control/M42.cpp +++ b/Marlin/src/gcode/control/M42.cpp @@ -53,6 +53,7 @@ void protected_pin_err() { * I Flag to ignore Marlin's pin protection * * T<mode> Pin mode: 0=INPUT 1=OUTPUT 2=INPUT_PULLUP 3=INPUT_PULLDOWN + * 4=INPUT_ANALOG 5=OUTPUT_OPEN_DRAIN */ void GcodeSuite::M42() { const int pin_index = PARSED_PIN_INDEX('P', GET_PIN_MAP_INDEX(LED_PIN)); @@ -119,7 +120,7 @@ void GcodeSuite::M42() { } // An OUTPUT_OPEN_DRAIN should not be changed to normal OUTPUT (STM32) - // Use M42 Px M1/5 S0/1 to set the output type and then set value + // Use M42 Px T1/5 S0/1 to set the output type and then set value #ifndef OUTPUT_OPEN_DRAIN pinMode(pin, OUTPUT); #endif diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 60bc6535600..5cc1d07b095 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -484,8 +484,13 @@ #endif #endif +// Serial Controllers require LCD_SERIAL_PORT +#if ANY(HAS_DGUS_LCD, MALYAN_LCD, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT) + #define LCD_NEEDS_SERIAL_PORT 1 +#endif + // Extensible UI serial touch screens. (See src/lcd/extui) -#if ANY(HAS_DGUS_LCD, MALYAN_LCD, TOUCH_UI_FTDI_EVE, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_LCD_VYPER, NEXTION_TFT) +#if EITHER(LCD_NEEDS_SERIAL_PORT, TOUCH_UI_FTDI_EVE) #define IS_EXTUI 1 #define EXTENSIBLE_UI #endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 124c940422c..d3b3bbbd219 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -205,6 +205,10 @@ #include "ramps/pins_LONGER3D_LKx_PRO.h" // ATmega2560 env:mega2560 #elif MB(PXMALION_CORE_I3) #include "ramps/pins_PXMALION_CORE_I3.h" // ATmega2560 env:mega2560 +#elif MB(PANOWIN_CUTLASS) + #include "ramps/pins_PANOWIN_CUTLASS.h" // ATmega2560 env:mega2560ext +#elif MB(KODAMA_BARDO) + #include "ramps/pins_KODAMA_BARDO.h" // ATmega2560 env:mega2560ext // // RAMBo and derivatives diff --git a/Marlin/src/pins/ramps/pins_KODAMA_BARDO.h b/Marlin/src/pins/ramps/pins_KODAMA_BARDO.h new file mode 100644 index 00000000000..12597c42705 --- /dev/null +++ b/Marlin/src/pins/ramps/pins_KODAMA_BARDO.h @@ -0,0 +1,34 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 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 <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +/** + * Kodama Bardo V1.x as found in the Kodama Trinus (MEGA2560) board pin assignments + * + * Ported from https://github.com/sambuls/MarlinOnTrinus + * Board photo https://imgur.com/a/JbQH5SI + */ + +#define BOARD_NAME "Kodama Bardo V1.x" +#define DEFAULT_MACHINE_NAME "Kodama Trinus" + +#include "pins_PANOWIN_CUTLASS.h" diff --git a/Marlin/src/pins/ramps/pins_PANOWIN_CUTLASS.h b/Marlin/src/pins/ramps/pins_PANOWIN_CUTLASS.h new file mode 100755 index 00000000000..cc651cc8ef1 --- /dev/null +++ b/Marlin/src/pins/ramps/pins_PANOWIN_CUTLASS.h @@ -0,0 +1,133 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 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 <https://www.gnu.org/licenses/>. + * + */ +#pragma once + +/** + * Panowin V?.? as found in the Panowin F1 (MEGA2560) board pin assignments + * + * Ported from https://github.com/sambuls/MarlinOnTrinus + * Board photo https://imgur.com/a/xvol1Bo + */ + +#include "env_validate.h" + +#ifndef BOARD_NAME + #define BOARD_NAME "Panowin Cutlass" +#endif + +#ifndef DEFAULT_MACHINE_NAME + #define DEFAULT_MACHINE_NAME "Panowin F1" +#endif + +// +// Limit Switches +// +#define X_STOP_PIN 71 // G3 +#define Y_STOP_PIN 85 // H7 +#define Z_STOP_PIN 13 // B7 + +// +// Steppers +// +#define X_STEP_PIN 38 // D7 +#define X_DIR_PIN 83 +#define X_ENABLE_PIN 82 + +#define Y_STEP_PIN 37 +#define Y_DIR_PIN 40 +#define Y_ENABLE_PIN 41 + +#define Z_STEP_PIN 30 // C7 +#define Z_DIR_PIN 32 // C5 +#define Z_ENABLE_PIN 34 // C3 + +#define E0_STEP_PIN 42 +#define E0_DIR_PIN 43 +#define E0_ENABLE_PIN 44 + +// Microstepping mode pins +#define X_MS1_PIN 19 // D2 +#define X_MS2_PIN 18 // D3 +#define X_MS3_PIN 81 // D4 + +#define Y_MS1_PIN 19 // D2 +#define Y_MS2_PIN 18 // D3 +#define Y_MS3_PIN 81 // D4 + +#define Z_MS1_PIN 73 // J3 +#define Z_MS2_PIN 75 // J4 +#define Z_MS3_PIN 76 // J5 + +#define E0_MS1_PIN 46 // L3 +#define E0_MS2_PIN 47 // L2 +#define E0_MS3_PIN 45 // L4 + +// +// Temperature Sensors +// +#define TEMP_0_PIN 12 // Analog Input +#define TEMP_BED_PIN 14 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN 9 // H6 +#define HEATER_BED_PIN 8 +#define FAN0_PIN 62 // K0 +#define FAN_SOFT_PWM_REQUIRED + +// +// M3/M4/M5 - Spindle/Laser Control +// +#if HAS_CUTTER + #define SPINDLE_LASER_ENA_PIN 74 // J7 +#endif + +// +// Serial LCD +// +#if LCD_NEEDS_SERIAL_PORT && !defined(LCD_SERIAL_PORT) + #define LCD_SERIAL_PORT 2 // D16 H1 (TX2), D17 H0 (RX2) +#endif + +// +// SD Card +// +#define SD_DETECT_PIN 28 // A6 Onboard SD + +// +// Misc. Functions +// +#define BEEPER_PIN 24 // A2 + +// +// Onboard (bright!) RGB LED +// +#ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN 64 // K2 +#endif +#ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN 65 // K3 +#endif +#ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN 63 // K1 +#endif