Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x
This commit is contained in:
commit
4a56689801
118 changed files with 4638 additions and 1144 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -77,7 +77,6 @@ tags
|
|||
*.out
|
||||
*.app
|
||||
|
||||
|
||||
#
|
||||
# C
|
||||
#
|
||||
|
|
|
|||
|
|
@ -107,7 +107,8 @@
|
|||
|
||||
/**
|
||||
* Select a secondary serial port on the board to use for communication with the host.
|
||||
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
|
||||
* Currently Ethernet (-2) is only supported on Teensy 4.1 boards.
|
||||
* :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7]
|
||||
*/
|
||||
//#define SERIAL_PORT_2 -1
|
||||
|
||||
|
|
@ -334,6 +335,9 @@
|
|||
//#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80
|
||||
//#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power
|
||||
|
||||
//#define PSU_POWERUP_GCODE "M355 S1" // G-code to run after power-on (e.g., case light on)
|
||||
//#define PSU_POWEROFF_GCODE "M355 S0" // G-code to run before power-off (e.g., case light off)
|
||||
|
||||
//#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin
|
||||
#if ENABLED(AUTO_POWER_CONTROL)
|
||||
#define AUTO_POWER_FANS // Turn on PSU if fans need power
|
||||
|
|
|
|||
|
|
@ -2261,14 +2261,20 @@
|
|||
#if HAS_TRINAMIC_CONFIG
|
||||
|
||||
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
|
||||
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256
|
||||
|
||||
/**
|
||||
* Interpolate microsteps to 256
|
||||
* Override for each driver with <driver>_INTERPOLATE settings below
|
||||
*/
|
||||
#define INTERPOLATE true
|
||||
|
||||
#if AXIS_IS_TMC(X)
|
||||
#define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current.
|
||||
#define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing
|
||||
#define X_MICROSTEPS 16 // 0..256
|
||||
#define X_MICROSTEPS 16 // 0..256
|
||||
#define X_RSENSE 0.11
|
||||
#define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ...
|
||||
#define X_CHAIN_POS -1 // -1..0: Not chained. 1: MCU MOSI connected. 2: Next in chain, ...
|
||||
//#define X_INTERPOLATE true // Enable to override 'INTERPOLATE' for the X axis
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(X2)
|
||||
|
|
@ -2277,6 +2283,7 @@
|
|||
#define X2_MICROSTEPS 16
|
||||
#define X2_RSENSE 0.11
|
||||
#define X2_CHAIN_POS -1
|
||||
//#define X2_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Y)
|
||||
|
|
@ -2285,6 +2292,7 @@
|
|||
#define Y_MICROSTEPS 16
|
||||
#define Y_RSENSE 0.11
|
||||
#define Y_CHAIN_POS -1
|
||||
//#define Y_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Y2)
|
||||
|
|
@ -2293,6 +2301,7 @@
|
|||
#define Y2_MICROSTEPS 16
|
||||
#define Y2_RSENSE 0.11
|
||||
#define Y2_CHAIN_POS -1
|
||||
//#define Y2_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Z)
|
||||
|
|
@ -2301,6 +2310,7 @@
|
|||
#define Z_MICROSTEPS 16
|
||||
#define Z_RSENSE 0.11
|
||||
#define Z_CHAIN_POS -1
|
||||
//#define Z_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Z2)
|
||||
|
|
@ -2309,6 +2319,7 @@
|
|||
#define Z2_MICROSTEPS 16
|
||||
#define Z2_RSENSE 0.11
|
||||
#define Z2_CHAIN_POS -1
|
||||
//#define Z2_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Z3)
|
||||
|
|
@ -2317,6 +2328,7 @@
|
|||
#define Z3_MICROSTEPS 16
|
||||
#define Z3_RSENSE 0.11
|
||||
#define Z3_CHAIN_POS -1
|
||||
//#define Z3_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(Z4)
|
||||
|
|
@ -2325,6 +2337,7 @@
|
|||
#define Z4_MICROSTEPS 16
|
||||
#define Z4_RSENSE 0.11
|
||||
#define Z4_CHAIN_POS -1
|
||||
//#define Z4_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E0)
|
||||
|
|
@ -2332,6 +2345,7 @@
|
|||
#define E0_MICROSTEPS 16
|
||||
#define E0_RSENSE 0.11
|
||||
#define E0_CHAIN_POS -1
|
||||
//#define E0_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E1)
|
||||
|
|
@ -2339,6 +2353,7 @@
|
|||
#define E1_MICROSTEPS 16
|
||||
#define E1_RSENSE 0.11
|
||||
#define E1_CHAIN_POS -1
|
||||
//#define E1_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E2)
|
||||
|
|
@ -2346,6 +2361,7 @@
|
|||
#define E2_MICROSTEPS 16
|
||||
#define E2_RSENSE 0.11
|
||||
#define E2_CHAIN_POS -1
|
||||
//#define E2_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E3)
|
||||
|
|
@ -2353,6 +2369,7 @@
|
|||
#define E3_MICROSTEPS 16
|
||||
#define E3_RSENSE 0.11
|
||||
#define E3_CHAIN_POS -1
|
||||
//#define E3_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E4)
|
||||
|
|
@ -2360,6 +2377,7 @@
|
|||
#define E4_MICROSTEPS 16
|
||||
#define E4_RSENSE 0.11
|
||||
#define E4_CHAIN_POS -1
|
||||
//#define E4_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E5)
|
||||
|
|
@ -2367,6 +2385,7 @@
|
|||
#define E5_MICROSTEPS 16
|
||||
#define E5_RSENSE 0.11
|
||||
#define E5_CHAIN_POS -1
|
||||
//#define E5_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E6)
|
||||
|
|
@ -2374,6 +2393,7 @@
|
|||
#define E6_MICROSTEPS 16
|
||||
#define E6_RSENSE 0.11
|
||||
#define E6_CHAIN_POS -1
|
||||
//#define E6_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E7)
|
||||
|
|
@ -2381,6 +2401,7 @@
|
|||
#define E7_MICROSTEPS 16
|
||||
#define E7_RSENSE 0.11
|
||||
#define E7_CHAIN_POS -1
|
||||
//#define E7_INTERPOLATE true
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
@ -3456,6 +3477,13 @@
|
|||
// Default behavior is limited to Z axis only.
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Ethernet. Use M552 to enable and set the IP address.
|
||||
*/
|
||||
#if HAS_ETHERNET
|
||||
#define MAC_ADDRESS { 0xDE, 0xAD, 0xBE, 0xEF, 0xF0, 0x0D } // A MAC address unique to your network
|
||||
#endif
|
||||
|
||||
/**
|
||||
* WiFi Support (Espressif ESP32 WiFi)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ volatile int numPWMUsed = 0,
|
|||
|
||||
#endif
|
||||
|
||||
void HAL_init() { i2s_init(); }
|
||||
void HAL_init() { TERN_(I2S_STEPPER_STREAM, i2s_init()); }
|
||||
|
||||
void HAL_init_board() {
|
||||
|
||||
|
|
|
|||
|
|
@ -66,10 +66,12 @@
|
|||
#ifdef SERIAL_PORT_2
|
||||
#if SERIAL_PORT_2 == -1
|
||||
#define MYSERIAL1 usbSerial
|
||||
#elif SERIAL_PORT_2 == -2
|
||||
#define MYSERIAL1 ethernet.telnetClient
|
||||
#elif WITHIN(SERIAL_PORT_2, 0, 8)
|
||||
#define MYSERIAL1 MSERIAL(SERIAL_PORT_2)
|
||||
#else
|
||||
#error "SERIAL_PORT_2 must be from -1 to 8. Please update your configuration."
|
||||
#error "SERIAL_PORT_2 must be from -2 to 8. Please update your configuration."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,10 @@
|
|||
#include "lcd/dwin/e3v2/rotary_encoder.h"
|
||||
#endif
|
||||
|
||||
#if HAS_ETHERNET
|
||||
#include "feature/ethernet.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(IIC_BL24CXX_EEPROM)
|
||||
#include "libs/BL24CXX.h"
|
||||
#endif
|
||||
|
|
@ -713,6 +717,9 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
|
|||
HAL_idletask();
|
||||
#endif
|
||||
|
||||
// Check network connection
|
||||
TERN_(HAS_ETHERNET, ethernet.check());
|
||||
|
||||
// Handle Power-Loss Recovery
|
||||
#if ENABLED(POWER_LOSS_RECOVERY) && PIN_EXISTS(POWER_LOSS)
|
||||
if (printJobOngoing()) recovery.outage();
|
||||
|
|
@ -968,7 +975,7 @@ void setup() {
|
|||
MYSERIAL0.begin(BAUDRATE);
|
||||
uint32_t serial_connect_timeout = millis() + 1000UL;
|
||||
while (!MYSERIAL0 && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
|
||||
#if HAS_MULTI_SERIAL
|
||||
#if HAS_MULTI_SERIAL && !HAS_ETHERNET
|
||||
MYSERIAL1.begin(BAUDRATE);
|
||||
serial_connect_timeout = millis() + 1000UL;
|
||||
while (!MYSERIAL1 && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
|
||||
|
|
@ -1090,6 +1097,10 @@ void setup() {
|
|||
SETUP_RUN(settings.first_load()); // Load data from EEPROM if available (or use defaults)
|
||||
// This also updates variables in the planner, elsewhere
|
||||
|
||||
#if HAS_ETHERNET
|
||||
SETUP_RUN(ethernet.init());
|
||||
#endif
|
||||
|
||||
#if HAS_TOUCH_XPT2046
|
||||
SETUP_RUN(touch.init());
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -109,6 +109,9 @@
|
|||
#define BOARD_COPYMASTER_3D 1153 // Copymaster 3D
|
||||
#define BOARD_ORTUR_4 1154 // Ortur 4
|
||||
#define BOARD_TENLOG_D3_HERO 1155 // Tenlog D3 Hero IDEX printer
|
||||
#define BOARD_RAMPS_S_12_EEFB 1156 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
||||
#define BOARD_RAMPS_S_12_EEEB 1157 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
|
||||
#define BOARD_RAMPS_S_12_EFFB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
|
||||
|
||||
//
|
||||
// RAMBo and derivatives
|
||||
|
|
@ -308,19 +311,21 @@
|
|||
#define BOARD_BTT_SKR_MINI_E3_V1_0 4022 // BigTreeTech SKR Mini E3 (STM32F103RC)
|
||||
#define BOARD_BTT_SKR_MINI_E3_V1_2 4023 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
|
||||
#define BOARD_BTT_SKR_MINI_E3_V2_0 4024 // BigTreeTech SKR Mini E3 V2.0 (STM32F103RC)
|
||||
#define BOARD_BTT_SKR_E3_DIP 4025 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
|
||||
#define BOARD_JGAURORA_A5S_A1 4026 // JGAurora A5S A1 (STM32F103ZET6)
|
||||
#define BOARD_FYSETC_AIO_II 4027 // FYSETC AIO_II
|
||||
#define BOARD_FYSETC_CHEETAH 4028 // FYSETC Cheetah
|
||||
#define BOARD_FYSETC_CHEETAH_V12 4029 // FYSETC Cheetah V1.2
|
||||
#define BOARD_LONGER3D_LK 4030 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6
|
||||
#define BOARD_CCROBOT_MEEB_3DP 4031 // ccrobot-online.com MEEB_3DP (STM32F103RC)
|
||||
#define BOARD_CHITU3D_V5 4032 // Chitu3D TronXY X5SA V5 Board
|
||||
#define BOARD_CHITU3D_V6 4033 // Chitu3D TronXY X5SA V5 Board
|
||||
#define BOARD_CREALITY_V4 4034 // Creality v4.x (STM32F103RE)
|
||||
#define BOARD_CREALITY_V427 4035 // Creality v4.2.7 (STM32F103RE)
|
||||
#define BOARD_TRIGORILLA_PRO 4036 // Trigorilla Pro (STM32F103ZET6)
|
||||
#define BOARD_FLY_MINI 4037 // FLY MINI (STM32F103RCT6)
|
||||
#define BOARD_BTT_SKR_MINI_MZ_V1_0 4025 // BigTreeTech SKR Mini MZ V1.0 (STM32F103RC)
|
||||
#define BOARD_BTT_SKR_E3_DIP 4026 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
|
||||
#define BOARD_JGAURORA_A5S_A1 4027 // JGAurora A5S A1 (STM32F103ZET6)
|
||||
#define BOARD_FYSETC_AIO_II 4028 // FYSETC AIO_II
|
||||
#define BOARD_FYSETC_CHEETAH 4029 // FYSETC Cheetah
|
||||
#define BOARD_FYSETC_CHEETAH_V12 4030 // FYSETC Cheetah V1.2
|
||||
#define BOARD_LONGER3D_LK 4031 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6
|
||||
#define BOARD_CCROBOT_MEEB_3DP 4032 // ccrobot-online.com MEEB_3DP (STM32F103RC)
|
||||
#define BOARD_CHITU3D_V5 4033 // Chitu3D TronXY X5SA V5 Board
|
||||
#define BOARD_CHITU3D_V6 4034 // Chitu3D TronXY X5SA V5 Board
|
||||
#define BOARD_CREALITY_V4 4035 // Creality v4.x (STM32F103RE)
|
||||
#define BOARD_CREALITY_V427 4036 // Creality v4.2.7 (STM32F103RE)
|
||||
#define BOARD_TRIGORILLA_PRO 4037 // Trigorilla Pro (STM32F103ZET6)
|
||||
#define BOARD_FLY_MINI 4038 // FLY MINI (STM32F103RCT6)
|
||||
#define BOARD_FLSUN_HISPEED 4039 // FLSUN HiSpeedV1 (STM32F103VET6)
|
||||
|
||||
//
|
||||
// ARM Cortex-M4F
|
||||
|
|
|
|||
|
|
@ -23,6 +23,10 @@
|
|||
|
||||
#include "../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_ETHERNET
|
||||
#include "../feature/ethernet.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Define debug bit-masks
|
||||
*/
|
||||
|
|
@ -56,8 +60,9 @@ extern uint8_t marlin_debug_flags;
|
|||
#define SERIAL_OUT(WHAT, V...) (void)CAT(MYSERIAL,SERIAL_CATCHALL).WHAT(V)
|
||||
#else
|
||||
#define SERIAL_OUT(WHAT, V...) do{ \
|
||||
if (!serial_port_index || serial_port_index == SERIAL_BOTH) (void)MYSERIAL0.WHAT(V); \
|
||||
if ( serial_port_index) (void)MYSERIAL1.WHAT(V); \
|
||||
const bool port2_open = TERN1(HAS_ETHERNET, ethernet.have_telnet_client); \
|
||||
if ( serial_port_index == 0 || serial_port_index == SERIAL_BOTH) (void)MYSERIAL0.WHAT(V); \
|
||||
if ((serial_port_index == 1 || serial_port_index == SERIAL_BOTH) && port2_open) (void)MYSERIAL1.WHAT(V); \
|
||||
}while(0)
|
||||
#endif
|
||||
|
||||
|
|
|
|||
175
Marlin/src/feature/ethernet.cpp
Normal file
175
Marlin/src/feature/ethernet.cpp
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
/**
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_ETHERNET
|
||||
|
||||
#include "ethernet.h"
|
||||
#include "../core/serial.h"
|
||||
|
||||
#define DEBUG_OUT ENABLED(DEBUG_ETHERNET)
|
||||
#include "../core/debug_out.h"
|
||||
|
||||
bool MarlinEthernet::hardware_enabled, // = false
|
||||
MarlinEthernet::have_telnet_client; // = false
|
||||
|
||||
IPAddress MarlinEthernet::ip,
|
||||
MarlinEthernet::myDns,
|
||||
MarlinEthernet::gateway,
|
||||
MarlinEthernet::subnet;
|
||||
|
||||
EthernetClient MarlinEthernet::telnetClient; // connected client
|
||||
|
||||
MarlinEthernet ethernet;
|
||||
|
||||
EthernetServer server(23); // telnet server
|
||||
|
||||
enum linkStates { UNLINKED, LINKING, LINKED, CONNECTING, CONNECTED, NO_HARDWARE } linkState;
|
||||
|
||||
#ifdef __IMXRT1062__
|
||||
|
||||
static void teensyMAC(uint8_t * const mac) {
|
||||
const uint32_t m1 = HW_OCOTP_MAC1, m2 = HW_OCOTP_MAC0;
|
||||
mac[0] = m1 >> 8;
|
||||
mac[1] = m1 >> 0;
|
||||
mac[2] = m2 >> 24;
|
||||
mac[3] = m2 >> 16;
|
||||
mac[4] = m2 >> 8;
|
||||
mac[5] = m2 >> 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
byte mac[] = MAC_ADDRESS;
|
||||
|
||||
#endif
|
||||
|
||||
void ethernet_cable_error() { SERIAL_ERROR_MSG("Ethernet cable is not connected."); }
|
||||
|
||||
void MarlinEthernet::init() {
|
||||
if (!hardware_enabled) return;
|
||||
|
||||
SERIAL_ECHO_MSG("Starting network...");
|
||||
|
||||
// Init the Ethernet device
|
||||
#ifdef __IMXRT1062__
|
||||
uint8_t mac[6];
|
||||
teensyMAC(mac);
|
||||
#endif
|
||||
|
||||
if (!ip) {
|
||||
Ethernet.begin(mac); // use DHCP
|
||||
}
|
||||
else {
|
||||
if (!gateway) {
|
||||
gateway = ip;
|
||||
gateway[3] = 1;
|
||||
myDns = gateway;
|
||||
subnet = IPAddress(255,255,255,0);
|
||||
}
|
||||
if (!myDns) myDns = gateway;
|
||||
if (!subnet) subnet = IPAddress(255,255,255,0);
|
||||
Ethernet.begin(mac, ip, myDns, gateway, subnet);
|
||||
}
|
||||
|
||||
// Check for Ethernet hardware present
|
||||
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
|
||||
SERIAL_ERROR_MSG("No Ethernet hardware found.");
|
||||
linkState = NO_HARDWARE;
|
||||
return;
|
||||
}
|
||||
|
||||
linkState = UNLINKED;
|
||||
|
||||
if (Ethernet.linkStatus() == LinkOFF)
|
||||
ethernet_cable_error();
|
||||
}
|
||||
|
||||
void MarlinEthernet::check() {
|
||||
if (!hardware_enabled) return;
|
||||
|
||||
switch (linkState) {
|
||||
case NO_HARDWARE:
|
||||
break;
|
||||
|
||||
case UNLINKED:
|
||||
if (Ethernet.linkStatus() == LinkOFF) break;
|
||||
|
||||
SERIAL_ECHOLNPGM("Ethernet cable connected");
|
||||
server.begin();
|
||||
linkState = LINKING;
|
||||
break;
|
||||
|
||||
case LINKING:
|
||||
if (!Ethernet.localIP()) break;
|
||||
|
||||
SERIAL_ECHOPGM("Successfully started telnet server with IP ");
|
||||
MYSERIAL0.println(Ethernet.localIP());
|
||||
|
||||
linkState = LINKED;
|
||||
break;
|
||||
|
||||
case LINKED:
|
||||
if (Ethernet.linkStatus() == LinkOFF) {
|
||||
ethernet_cable_error();
|
||||
linkState = UNLINKED;
|
||||
break;
|
||||
}
|
||||
telnetClient = server.accept();
|
||||
if (telnetClient) linkState = CONNECTING;
|
||||
break;
|
||||
|
||||
case CONNECTING:
|
||||
telnetClient.println("Marlin " SHORT_BUILD_VERSION);
|
||||
#if defined(STRING_DISTRIBUTION_DATE) && defined(STRING_CONFIG_H_AUTHOR)
|
||||
telnetClient.println(
|
||||
" Last Updated: " STRING_DISTRIBUTION_DATE
|
||||
" | Author: " STRING_CONFIG_H_AUTHOR
|
||||
);
|
||||
#endif
|
||||
telnetClient.println("Compiled: " __DATE__);
|
||||
|
||||
SERIAL_ECHOLNPGM("Client connected");
|
||||
have_telnet_client = true;
|
||||
linkState = CONNECTED;
|
||||
break;
|
||||
|
||||
case CONNECTED:
|
||||
if (telnetClient && !telnetClient.connected()) {
|
||||
SERIAL_ECHOLNPGM("Client disconnected");
|
||||
telnetClient.stop();
|
||||
have_telnet_client = false;
|
||||
linkState = LINKED;
|
||||
}
|
||||
if (Ethernet.linkStatus() == LinkOFF) {
|
||||
ethernet_cable_error();
|
||||
if (telnetClient) telnetClient.stop();
|
||||
linkState = UNLINKED;
|
||||
}
|
||||
break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // HAS_ETHERNET
|
||||
39
Marlin/src/feature/ethernet.h
Normal file
39
Marlin/src/feature/ethernet.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/**
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifdef __IMXRT1062__
|
||||
#include <NativeEthernet.h>
|
||||
#endif
|
||||
|
||||
// Teensy 4.1 uses internal MAC Address
|
||||
|
||||
class MarlinEthernet {
|
||||
public:
|
||||
static bool hardware_enabled, have_telnet_client;
|
||||
static IPAddress ip, myDns, gateway, subnet;
|
||||
static EthernetClient telnetClient;
|
||||
static void init();
|
||||
static void check();
|
||||
};
|
||||
|
||||
extern MarlinEthernet ethernet;
|
||||
|
|
@ -33,6 +33,10 @@
|
|||
#include "../module/stepper/indirection.h"
|
||||
#include "../MarlinCore.h"
|
||||
|
||||
#if defined(PSU_POWERUP_GCODE) || defined(PSU_POWEROFF_GCODE)
|
||||
#include "../gcode/gcode.h"
|
||||
#endif
|
||||
|
||||
#if BOTH(USE_CONTROLLER_FAN, AUTO_POWER_CONTROLLERFAN)
|
||||
#include "controllerfan.h"
|
||||
#endif
|
||||
|
|
@ -107,11 +111,19 @@ void Power::power_on() {
|
|||
safe_delay(PSU_POWERUP_DELAY);
|
||||
restore_stepper_drivers();
|
||||
TERN_(HAS_TRINAMIC_CONFIG, safe_delay(PSU_POWERUP_DELAY));
|
||||
#ifdef PSU_POWERUP_GCODE
|
||||
GcodeSuite::process_subcommands_now_P(PSTR(PSU_POWERUP_GCODE));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void Power::power_off() {
|
||||
if (powersupply_on) PSU_PIN_OFF();
|
||||
if (powersupply_on) {
|
||||
#ifdef PSU_POWEROFF_GCODE
|
||||
GcodeSuite::process_subcommands_now_P(PSTR(PSU_POWEROFF_GCODE));
|
||||
#endif
|
||||
PSU_PIN_OFF();
|
||||
}
|
||||
}
|
||||
|
||||
#endif // AUTO_POWER_CONTROL
|
||||
|
|
|
|||
|
|
@ -497,7 +497,8 @@
|
|||
TMC_HEND,
|
||||
TMC_HSTRT,
|
||||
TMC_SGT,
|
||||
TMC_MSCNT
|
||||
TMC_MSCNT,
|
||||
TMC_INTERPOLATE
|
||||
};
|
||||
enum TMC_drv_status_enum : char {
|
||||
TMC_DRV_CODES,
|
||||
|
|
@ -553,6 +554,7 @@
|
|||
case TMC_PWM_SCALE: SERIAL_PRINT(st.PWM_SCALE(), DEC); break;
|
||||
case TMC_SGT: SERIAL_PRINT(st.sgt(), DEC); break;
|
||||
case TMC_STEALTHCHOP: serialprint_truefalse(st.en_pwm_mode()); break;
|
||||
case TMC_INTERPOLATE: serialprint_truefalse(st.intpol()); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
|
@ -588,6 +590,7 @@
|
|||
SERIAL_ECHOPGM("/256");
|
||||
}
|
||||
break;
|
||||
case TMC_INTERPOLATE: serialprint_truefalse(st.intpol()); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
|
@ -603,6 +606,7 @@
|
|||
case TMC_STEALTHCHOP: serialprint_truefalse(st.stealth()); break;
|
||||
case TMC_S2VSA: if (st.s2vsa()) SERIAL_CHAR('*'); break;
|
||||
case TMC_S2VSB: if (st.s2vsb()) SERIAL_CHAR('*'); break;
|
||||
case TMC_INTERPOLATE: serialprint_truefalse(st.intpol()); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
|
@ -644,6 +648,12 @@
|
|||
|
||||
#if HAS_DRIVER(TMC2660)
|
||||
static void _tmc_parse_drv_status(TMC2660Stepper, const TMC_drv_status_enum) { }
|
||||
static void _tmc_status(TMC2660Stepper &st, const TMC_debug_enum i) {
|
||||
switch (i) {
|
||||
case TMC_INTERPOLATE: serialprint_truefalse(st.intpol()); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename TMC>
|
||||
|
|
@ -902,6 +912,7 @@
|
|||
#endif
|
||||
TMC_REPORT("stealthChop", TMC_STEALTHCHOP);
|
||||
TMC_REPORT("msteps\t", TMC_MICROSTEPS);
|
||||
TMC_REPORT("interp\t", TMC_INTERPOLATE);
|
||||
TMC_REPORT("tstep\t", TMC_TSTEP);
|
||||
TMC_REPORT("PWM thresh.", TMC_TPWMTHRS);
|
||||
TMC_REPORT("[mm/s]\t", TMC_TPWMTHRS_MMS);
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@
|
|||
#define G26_ERR true
|
||||
|
||||
#if ENABLED(ARC_SUPPORT)
|
||||
void plan_arc(const xyze_pos_t &cart, const ab_float_t &offset, const uint8_t clockwise);
|
||||
void plan_arc(const xyze_pos_t&, const ab_float_t&, const bool, const uint8_t);
|
||||
#endif
|
||||
|
||||
constexpr float g26_e_axis_feedrate = 0.025;
|
||||
|
|
@ -783,7 +783,7 @@ void GcodeSuite::G26() {
|
|||
|
||||
const feedRate_t old_feedrate = feedrate_mm_s;
|
||||
feedrate_mm_s = PLANNER_XY_FEEDRATE() * 0.1f;
|
||||
plan_arc(endpoint, arc_offset, false); // Draw a counter-clockwise arc
|
||||
plan_arc(endpoint, arc_offset, false, 0); // Draw a counter-clockwise arc
|
||||
feedrate_mm_s = old_feedrate;
|
||||
destination = current_position;
|
||||
|
||||
|
|
|
|||
125
Marlin/src/gcode/feature/network/M552-M554.cpp
Normal file
125
Marlin/src/gcode/feature/network/M552-M554.cpp
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
/**
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_ETHERNET
|
||||
|
||||
#include "../../../feature/ethernet.h"
|
||||
#include "../../../core/serial.h"
|
||||
#include "../../gcode.h"
|
||||
|
||||
void say_ethernet() { SERIAL_ECHOPGM(" Ethernet "); }
|
||||
|
||||
void ETH0_report() {
|
||||
say_ethernet();
|
||||
SERIAL_ECHO_TERNARY(ethernet.hardware_enabled, "port ", "en", "dis", "abled.\n");
|
||||
if (ethernet.hardware_enabled) {
|
||||
say_ethernet();
|
||||
SERIAL_ECHO_TERNARY(ethernet.have_telnet_client, "client ", "en", "dis", "abled.\n");
|
||||
}
|
||||
else
|
||||
SERIAL_ECHOLNPGM("Send 'M552 S1' to enable.");
|
||||
}
|
||||
|
||||
void MAC_report() {
|
||||
uint8_t mac[6];
|
||||
if (ethernet.hardware_enabled) {
|
||||
Ethernet.MACAddress(mac);
|
||||
SERIAL_ECHOPGM(" MAC: ");
|
||||
LOOP_L_N(i, 6) {
|
||||
SERIAL_PRINTF("%02X", mac[i]);
|
||||
if (i < 5) SERIAL_CHAR(':');
|
||||
}
|
||||
}
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
// Display current values when the link is active,
|
||||
// otherwise show the stored values
|
||||
void ip_report(const uint16_t cmd, PGM_P const post, const IPAddress &ipo) {
|
||||
SERIAL_CHAR('M'); SERIAL_ECHO(cmd); SERIAL_CHAR(' ');
|
||||
LOOP_L_N(i, 4) {
|
||||
SERIAL_ECHO(ipo[i]);
|
||||
if (i < 3) SERIAL_CHAR('.');
|
||||
}
|
||||
SERIAL_ECHOPGM(" ; ");
|
||||
SERIAL_ECHOPGM_P(post);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
void M552_report() {
|
||||
ip_report(552, PSTR("ip address"), Ethernet.linkStatus() == LinkON ? Ethernet.localIP() : ethernet.ip);
|
||||
}
|
||||
void M553_report() {
|
||||
ip_report(553, PSTR("subnet mask"), Ethernet.linkStatus() == LinkON ? Ethernet.subnetMask() : ethernet.subnet);
|
||||
}
|
||||
void M554_report() {
|
||||
ip_report(554, PSTR("gateway"), Ethernet.linkStatus() == LinkON ? Ethernet.gatewayIP() : ethernet.gateway);
|
||||
}
|
||||
|
||||
/**
|
||||
* M552: Set IP address, enable/disable network interface
|
||||
*
|
||||
* S0 : disable networking
|
||||
* S1 : enable networking
|
||||
* S-1 : reset network interface
|
||||
*
|
||||
* Pnnn : Set IP address, 0.0.0.0 means acquire an IP address using DHCP
|
||||
*/
|
||||
void GcodeSuite::M552() {
|
||||
const bool seenP = parser.seenval('P');
|
||||
if (seenP) ethernet.ip.fromString(parser.value_string());
|
||||
|
||||
const bool seenS = parser.seenval('S');
|
||||
if (seenS) {
|
||||
switch (parser.value_int()) {
|
||||
case -1:
|
||||
if (ethernet.telnetClient) ethernet.telnetClient.stop();
|
||||
ethernet.init();
|
||||
break;
|
||||
case 0: ethernet.hardware_enabled = false; break;
|
||||
case 1: ethernet.hardware_enabled = true; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
const bool nopar = !seenS && !seenP;
|
||||
if (nopar || seenS) ETH0_report();
|
||||
if (nopar || seenP) M552_report();
|
||||
}
|
||||
|
||||
/**
|
||||
* M553 Pnnn - Set netmask
|
||||
*/
|
||||
void GcodeSuite::M553() {
|
||||
if (parser.seenval('P')) ethernet.subnet.fromString(parser.value_string());
|
||||
M553_report();
|
||||
}
|
||||
|
||||
/**
|
||||
* M554 Pnnn - Set Gateway
|
||||
*/
|
||||
void GcodeSuite::M554() {
|
||||
if (parser.seenval('P')) ethernet.gateway.fromString(parser.value_string());
|
||||
M554_report();
|
||||
}
|
||||
|
||||
#endif // HAS_ETHERNET
|
||||
|
|
@ -58,7 +58,7 @@ void GcodeSuite::M510() {
|
|||
if (password.is_set && parser.ulongval('P') != password.value) {
|
||||
SERIAL_ECHOLNPGM(STR_WRONG_PASSWORD);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (parser.seenval('S')) {
|
||||
password.value_entry = parser.ulongval('S');
|
||||
|
|
|
|||
|
|
@ -766,6 +766,12 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
|||
case 540: M540(); break; // M540: Set abort on endstop hit for SD printing
|
||||
#endif
|
||||
|
||||
#if HAS_ETHERNET
|
||||
case 552: M552(); break; // M552: Set IP address
|
||||
case 553: M553(); break; // M553: Set gateway
|
||||
case 554: M554(); break; // M554: Set netmask
|
||||
#endif
|
||||
|
||||
#if ENABLED(BAUD_RATE_GCODE)
|
||||
case 575: M575(); break; // M575: Set serial baudrate
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -230,6 +230,9 @@
|
|||
* M512 - Set/Change/Remove Password
|
||||
* M524 - Abort the current SD print job started with M24. (Requires SDSUPPORT)
|
||||
* M540 - Enable/disable SD card abort on endstop hit: "M540 S<state>". (Requires SD_ABORT_ON_ENDSTOP_HIT)
|
||||
* M552 - Get or set IP address. Enable/disable network interface. (Requires enabled Ethernet port)
|
||||
* M553 - Get or set IP netmask. (Requires enabled Ethernet port)
|
||||
* M554 - Get or set IP gateway. (Requires enabled Ethernet port)
|
||||
* M569 - Enable stealthChop on an axis. (Requires at least one _DRIVER_TYPE to be TMC2130/2160/2208/2209/5130/5160)
|
||||
* M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE)
|
||||
* M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE)
|
||||
|
|
@ -778,6 +781,12 @@ private:
|
|||
|
||||
TERN_(SD_ABORT_ON_ENDSTOP_HIT, static void M540());
|
||||
|
||||
#if HAS_ETHERNET
|
||||
static void M552();
|
||||
static void M553();
|
||||
static void M554();
|
||||
#endif
|
||||
|
||||
TERN_(BAUD_RATE_GCODE, static void M575());
|
||||
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@
|
|||
SERIAL_EOL();
|
||||
persistentStore.access_finish();
|
||||
#else
|
||||
SERIAL_ECHOLN("NO EEPROM");
|
||||
SERIAL_ECHOLNPGM("NO EEPROM");
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
|
|
@ -125,13 +125,13 @@
|
|||
SERIAL_EOL();
|
||||
persistentStore.access_finish();
|
||||
#else
|
||||
SERIAL_ECHOLN("NO EEPROM");
|
||||
SERIAL_ECHOLNPGM("NO EEPROM");
|
||||
#endif
|
||||
}
|
||||
SERIAL_EOL();
|
||||
}
|
||||
} break;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
case 4: { // D4 Read / Write PIN
|
||||
// const uint8_t pin = parser.byteval('P');
|
||||
|
|
@ -173,8 +173,8 @@
|
|||
} break;
|
||||
|
||||
case 100: { // D100 Disable heaters and attempt a hard hang (Watchdog Test)
|
||||
SERIAL_ECHOLN("Disabling heaters and attempting to trigger Watchdog");
|
||||
SERIAL_ECHOLN("(USE_WATCHDOG " TERN(USE_WATCHDOG, "ENABLED", "DISABLED") ")");
|
||||
SERIAL_ECHOLNPGM("Disabling heaters and attempting to trigger Watchdog");
|
||||
SERIAL_ECHOLNPGM("(USE_WATCHDOG " TERN(USE_WATCHDOG, "ENABLED", "DISABLED") ")");
|
||||
thermalManager.disable_all_heaters();
|
||||
delay(1000); // Allow time to print
|
||||
DISABLE_ISRS();
|
||||
|
|
@ -183,7 +183,7 @@
|
|||
// watchdog does not work.
|
||||
DELAY_US(10000000);
|
||||
ENABLE_ISRS();
|
||||
SERIAL_ECHOLN("FAILURE: Watchdog did not trigger board reset.");
|
||||
SERIAL_ECHOLNPGM("FAILURE: Watchdog did not trigger board reset.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,9 +57,9 @@ void GcodeSuite::M118() {
|
|||
if (WITHIN(port, 0, NUM_SERIAL))
|
||||
serial_port_index = (
|
||||
port == 0 ? SERIAL_BOTH
|
||||
: port == 1 ? SERIAL_PORT
|
||||
#ifdef SERIAL_PORT_2
|
||||
: port == 2 ? SERIAL_PORT_2
|
||||
: port == 1 ? 0
|
||||
#if HAS_MULTI_SERIAL
|
||||
: port == 2 ? 1
|
||||
#endif
|
||||
: SERIAL_PORT
|
||||
);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,8 @@
|
|||
void plan_arc(
|
||||
const xyze_pos_t &cart, // Destination position
|
||||
const ab_float_t &offset, // Center of rotation relative to current_position
|
||||
const uint8_t clockwise // Clockwise?
|
||||
const bool clockwise, // Clockwise?
|
||||
const uint8_t circles // Take the scenic route
|
||||
) {
|
||||
#if ENABLED(CNC_WORKSPACE_PLANES)
|
||||
AxisEnum p_axis, q_axis, l_axis;
|
||||
|
|
@ -74,9 +75,7 @@ void plan_arc(
|
|||
center_Q = current_position[q_axis] - rvec.b,
|
||||
rt_X = cart[p_axis] - center_P,
|
||||
rt_Y = cart[q_axis] - center_Q,
|
||||
start_L = current_position[l_axis],
|
||||
linear_travel = cart[l_axis] - start_L,
|
||||
extruder_travel = cart.e - current_position.e;
|
||||
start_L = current_position[l_axis];
|
||||
|
||||
// CCW angle of rotation between position and target from the circle center. Only one atan2() trig computation required.
|
||||
float angular_travel = ATAN2(rvec.a * rt_Y - rvec.b * rt_X, rvec.a * rt_X + rvec.b * rt_Y);
|
||||
|
|
@ -90,13 +89,32 @@ void plan_arc(
|
|||
if (clockwise) angular_travel -= RADIANS(360);
|
||||
|
||||
// Make a circle if the angular rotation is 0 and the target is current position
|
||||
if (angular_travel == 0 && current_position[p_axis] == cart[p_axis] && current_position[q_axis] == cart[q_axis]) {
|
||||
if (NEAR_ZERO(angular_travel) && NEAR(current_position[p_axis], cart[p_axis]) && NEAR(current_position[q_axis], cart[q_axis])) {
|
||||
angular_travel = RADIANS(360);
|
||||
#ifdef MIN_ARC_SEGMENTS
|
||||
min_segments = MIN_ARC_SEGMENTS;
|
||||
#endif
|
||||
}
|
||||
|
||||
float linear_travel = cart[l_axis] - start_L,
|
||||
extruder_travel = cart.e - current_position.e;
|
||||
|
||||
// If circling around...
|
||||
if (ENABLED(ARC_P_CIRCLES) && circles) {
|
||||
const float total_angular = angular_travel + circles * RADIANS(360), // Total rotation with all circles and remainder
|
||||
part_per_circle = RADIANS(360) / total_angular, // Each circle's part of the total
|
||||
l_per_circle = linear_travel * part_per_circle, // L movement per circle
|
||||
e_per_circle = extruder_travel * part_per_circle; // E movement per circle
|
||||
xyze_pos_t temp_position = current_position; // for plan_arc to compare to current_position
|
||||
for (uint16_t n = circles; n--;) {
|
||||
temp_position.e += e_per_circle; // Destination E axis
|
||||
temp_position[l_axis] += l_per_circle; // Destination L axis
|
||||
plan_arc(temp_position, offset, clockwise, 0); // Plan a single whole circle
|
||||
}
|
||||
linear_travel = cart[l_axis] - current_position[l_axis];
|
||||
extruder_travel = cart.e - current_position.e;
|
||||
}
|
||||
|
||||
const float flat_mm = radius * angular_travel,
|
||||
mm_of_travel = linear_travel ? HYPOT(flat_mm, linear_travel) : ABS(flat_mm);
|
||||
if (mm_of_travel < 0.001f) return;
|
||||
|
|
@ -150,7 +168,7 @@ void plan_arc(
|
|||
linear_per_segment = linear_travel / segments,
|
||||
extruder_per_segment = extruder_travel / segments,
|
||||
sq_theta_per_segment = sq(theta_per_segment),
|
||||
sin_T = theta_per_segment - sq_theta_per_segment*theta_per_segment/6,
|
||||
sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6,
|
||||
cos_T = 1 - 0.5f * sq_theta_per_segment; // Small angle approximation
|
||||
|
||||
// Initialize the linear axis
|
||||
|
|
@ -320,16 +338,15 @@ void GcodeSuite::G2_G3(const bool clockwise) {
|
|||
|
||||
#if ENABLED(ARC_P_CIRCLES)
|
||||
// P indicates number of circles to do
|
||||
int8_t circles_to_do = parser.byteval('P');
|
||||
const int8_t circles_to_do = parser.byteval('P');
|
||||
if (!WITHIN(circles_to_do, 0, 100))
|
||||
SERIAL_ERROR_MSG(STR_ERR_ARC_ARGS);
|
||||
|
||||
while (circles_to_do--)
|
||||
plan_arc(current_position, arc_offset, clockwise);
|
||||
#else
|
||||
constexpr uint8_t circles_to_do = 0;
|
||||
#endif
|
||||
|
||||
// Send the arc to the planner
|
||||
plan_arc(destination, arc_offset, clockwise);
|
||||
plan_arc(destination, arc_offset, clockwise, circles_to_do);
|
||||
reset_stepper_timeout();
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -28,10 +28,6 @@
|
|||
|
||||
#include "../MarlinCore.h"
|
||||
|
||||
#if HAS_MULTI_SERIAL
|
||||
#include "queue.h"
|
||||
#endif
|
||||
|
||||
// Must be declared for allocation and to satisfy the linker
|
||||
// Zero values need no initialization.
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@ GCodeQueue queue;
|
|||
#include "../feature/leds/printer_event_leds.h"
|
||||
#endif
|
||||
|
||||
#if HAS_ETHERNET
|
||||
#include "../feature/ethernet.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(BINARY_FILE_TRANSFER)
|
||||
#include "../feature/binary_stream.h"
|
||||
#endif
|
||||
|
|
@ -312,15 +316,24 @@ void GCodeQueue::flush_and_request_resend() {
|
|||
}
|
||||
|
||||
inline bool serial_data_available() {
|
||||
return MYSERIAL0.available() || TERN0(HAS_MULTI_SERIAL, MYSERIAL1.available());
|
||||
byte data_available = 0;
|
||||
if (MYSERIAL0.available()) data_available++;
|
||||
#ifdef SERIAL_PORT_2
|
||||
const bool port2_open = TERN1(HAS_ETHERNET, ethernet.have_telnet_client);
|
||||
if (port2_open && MYSERIAL1.available()) data_available++;
|
||||
#endif
|
||||
return data_available > 0;
|
||||
}
|
||||
|
||||
inline int read_serial(const uint8_t index) {
|
||||
switch (index) {
|
||||
case 0: return MYSERIAL0.read();
|
||||
#if HAS_MULTI_SERIAL
|
||||
case 1: return MYSERIAL1.read();
|
||||
#endif
|
||||
case 1: {
|
||||
#if HAS_MULTI_SERIAL
|
||||
const bool port2_open = TERN1(HAS_ETHERNET, ethernet.have_telnet_client);
|
||||
if (port2_open) return MYSERIAL1.read();
|
||||
#endif
|
||||
}
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@
|
|||
#define DOGLCD
|
||||
#define IS_ULTIPANEL 1
|
||||
#define DELAYED_BACKLIGHT_INIT
|
||||
#elif ENABLED(TFT_LVGL_UI)
|
||||
#elif HAS_TFT_LVGL_UI
|
||||
#define DELAYED_BACKLIGHT_INIT
|
||||
#endif
|
||||
|
||||
|
|
@ -777,78 +777,71 @@
|
|||
#if SERIAL_PORT == -1 || SERIAL_PORT_2 == -1
|
||||
#define HAS_USB_SERIAL 1
|
||||
#endif
|
||||
#if SERIAL_PORT_2 == -2
|
||||
#define HAS_ETHERNET 1
|
||||
#endif
|
||||
|
||||
// Fallback Stepper Driver types
|
||||
// Fallback Stepper Driver types that don't depend on Configuration_adv.h
|
||||
#ifndef X_DRIVER_TYPE
|
||||
#define X_DRIVER_TYPE A4988
|
||||
#define X_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#ifndef Y_DRIVER_TYPE
|
||||
#define Y_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#ifndef Z_DRIVER_TYPE
|
||||
#define Z_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if NONE(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
|
||||
#undef X2_DRIVER_TYPE
|
||||
#elif !defined(X2_DRIVER_TYPE)
|
||||
#ifndef X2_DRIVER_TYPE
|
||||
#define X2_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if DISABLED(Y_DUAL_STEPPER_DRIVERS)
|
||||
#undef Y2_DRIVER_TYPE
|
||||
#elif !defined(Y2_DRIVER_TYPE)
|
||||
#ifndef Y_DRIVER_TYPE
|
||||
#define Y_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#ifndef Y2_DRIVER_TYPE
|
||||
#define Y2_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS < 2
|
||||
#undef Z2_DRIVER_TYPE
|
||||
#elif !defined(Z2_DRIVER_TYPE)
|
||||
#ifndef Z_DRIVER_TYPE
|
||||
#define Z_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#ifndef Z2_DRIVER_TYPE
|
||||
#define Z2_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS < 3
|
||||
#undef Z3_DRIVER_TYPE
|
||||
#elif !defined(Z3_DRIVER_TYPE)
|
||||
#ifndef Z3_DRIVER_TYPE
|
||||
#define Z3_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS < 4
|
||||
#undef Z4_DRIVER_TYPE
|
||||
#elif !defined(Z4_DRIVER_TYPE)
|
||||
#ifndef Z4_DRIVER_TYPE
|
||||
#define Z4_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS < 1
|
||||
#if E_STEPPERS <= 0
|
||||
#undef E0_DRIVER_TYPE
|
||||
#elif !defined(E0_DRIVER_TYPE)
|
||||
#define E0_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS < 2
|
||||
#if E_STEPPERS <= 1
|
||||
#undef E1_DRIVER_TYPE
|
||||
#elif !defined(E1_DRIVER_TYPE)
|
||||
#define E1_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS < 3
|
||||
#if E_STEPPERS <= 2
|
||||
#undef E2_DRIVER_TYPE
|
||||
#elif !defined(E2_DRIVER_TYPE)
|
||||
#define E2_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS < 4
|
||||
#if E_STEPPERS <= 3
|
||||
#undef E3_DRIVER_TYPE
|
||||
#elif !defined(E3_DRIVER_TYPE)
|
||||
#define E3_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS < 5
|
||||
#if E_STEPPERS <= 4
|
||||
#undef E4_DRIVER_TYPE
|
||||
#elif !defined(E4_DRIVER_TYPE)
|
||||
#define E4_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS < 6
|
||||
#if E_STEPPERS <= 5
|
||||
#undef E5_DRIVER_TYPE
|
||||
#elif !defined(E5_DRIVER_TYPE)
|
||||
#define E5_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS < 7
|
||||
#if E_STEPPERS <= 6
|
||||
#undef E6_DRIVER_TYPE
|
||||
#elif !defined(E6_DRIVER_TYPE)
|
||||
#define E6_DRIVER_TYPE A4988
|
||||
#endif
|
||||
#if E_STEPPERS < 8
|
||||
#if E_STEPPERS <= 7
|
||||
#undef E7_DRIVER_TYPE
|
||||
#elif !defined(E7_DRIVER_TYPE)
|
||||
#define E7_DRIVER_TYPE A4988
|
||||
|
|
@ -964,16 +957,16 @@
|
|||
// FSMC/SPI TFT Panels using standard HAL/tft/tft_(fsmc|spi).h
|
||||
#if ENABLED(TFT_INTERFACE_FSMC)
|
||||
#define HAS_FSMC_TFT 1
|
||||
#if ENABLED(TFT_CLASSIC_UI)
|
||||
#if TFT_SCALED_DOGLCD
|
||||
#define HAS_FSMC_GRAPHICAL_TFT 1
|
||||
#elif ENABLED(TFT_LVGL_UI)
|
||||
#elif HAS_TFT_LVGL_UI
|
||||
#define HAS_TFT_LVGL_UI_FSMC 1
|
||||
#endif
|
||||
#elif ENABLED(TFT_INTERFACE_SPI)
|
||||
#define HAS_SPI_TFT 1
|
||||
#if ENABLED(TFT_CLASSIC_UI)
|
||||
#if TFT_SCALED_DOGLCD
|
||||
#define HAS_SPI_GRAPHICAL_TFT 1
|
||||
#elif ENABLED(TFT_LVGL_UI)
|
||||
#elif HAS_TFT_LVGL_UI
|
||||
#define HAS_TFT_LVGL_UI_SPI 1
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -178,16 +178,35 @@
|
|||
#define HAS_MOTOR_CURRENT_I2C 1
|
||||
#endif
|
||||
|
||||
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
|
||||
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
||||
#undef Z_STEPPER_ALIGN_AMP
|
||||
#endif
|
||||
#ifndef Z_STEPPER_ALIGN_AMP
|
||||
#define Z_STEPPER_ALIGN_AMP 1.0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Multiple Z steppers
|
||||
#ifndef NUM_Z_STEPPER_DRIVERS
|
||||
#define NUM_Z_STEPPER_DRIVERS 1
|
||||
#endif
|
||||
|
||||
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
|
||||
#undef Z_STEPPER_ALIGN_AMP
|
||||
// Fallback Stepper Driver types that depend on Configuration_adv.h
|
||||
#if NONE(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
|
||||
#undef X2_DRIVER_TYPE
|
||||
#endif
|
||||
#ifndef Z_STEPPER_ALIGN_AMP
|
||||
#define Z_STEPPER_ALIGN_AMP 1.0
|
||||
#if DISABLED(Y_DUAL_STEPPER_DRIVERS)
|
||||
#undef Y2_DRIVER_TYPE
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS < 2
|
||||
#undef Z2_DRIVER_TYPE
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS < 3
|
||||
#undef Z3_DRIVER_TYPE
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS < 4
|
||||
#undef Z4_DRIVER_TYPE
|
||||
#endif
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1608,6 +1608,54 @@
|
|||
#define Y_SPI_SENSORLESS Y_SENSORLESS
|
||||
#define Z_SPI_SENSORLESS Z_SENSORLESS
|
||||
#endif
|
||||
#ifndef X_INTERPOLATE
|
||||
#define X_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#ifndef X2_INTERPOLATE
|
||||
#define X2_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#ifndef Y_INTERPOLATE
|
||||
#define Y_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#ifndef Y2_INTERPOLATE
|
||||
#define Y2_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#ifndef Z_INTERPOLATE
|
||||
#define Z_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#ifndef Z2_INTERPOLATE
|
||||
#define Z2_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#ifndef Z3_INTERPOLATE
|
||||
#define Z3_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#ifndef Z4_INTERPOLATE
|
||||
#define Z4_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#ifndef E0_INTERPOLATE
|
||||
#define E0_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#ifndef E1_INTERPOLATE
|
||||
#define E1_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#ifndef E2_INTERPOLATE
|
||||
#define E2_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#ifndef E3_INTERPOLATE
|
||||
#define E3_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#ifndef E4_INTERPOLATE
|
||||
#define E4_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#ifndef E5_INTERPOLATE
|
||||
#define E5_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#ifndef E6_INTERPOLATE
|
||||
#define E6_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#ifndef E7_INTERPOLATE
|
||||
#define E7_INTERPOLATE INTERPOLATE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (HAS_E_DRIVER(TMC2660) \
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
* version was tagged.
|
||||
*/
|
||||
#ifndef STRING_DISTRIBUTION_DATE
|
||||
#define STRING_DISTRIBUTION_DATE "2020-10-19"
|
||||
#define STRING_DISTRIBUTION_DATE "2020-10-22"
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -23,15 +23,14 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -94,7 +93,7 @@ void lv_draw_about(void) {
|
|||
// Create a label on the image button
|
||||
label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(label_Back, common_menu.text_back);
|
||||
lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -383,7 +383,7 @@ void lv_draw_acceleration_settings(void) {
|
|||
//lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y);
|
||||
//lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
if (uiCfg.para_ui_page != 1) {
|
||||
|
||||
lv_label_set_text(labelTurnPage, machine_menu.next);
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -302,7 +302,7 @@ void lv_draw_advance_settings(void) {
|
|||
lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF);
|
||||
label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(label_Back, common_menu.text_back);
|
||||
lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,12 +23,11 @@
|
|||
|
||||
#if BOTH(HAS_TFT_LVGL_UI, HAS_BED_PROBE)
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../module/probe.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -172,7 +171,7 @@ void lv_draw_auto_level_offset_settings(void) {
|
|||
}
|
||||
#endif
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
ZERO(public_buf_l);
|
||||
sprintf_P(public_buf_l, PSTR("%.1f"), TERN(HAS_PROBE_XY_OFFSET, probe.offset.x, 0));
|
||||
lv_label_set_text(labelXValue, public_buf_l);
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../gcode/queue.h"
|
||||
#include "../../../../gcode/gcode.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_BED_PROBE
|
||||
#include "../../../../module/probe.h"
|
||||
|
|
@ -52,7 +52,7 @@ static float babystep_dist=0.01;
|
|||
static uint8_t has_adjust_z = 0;
|
||||
|
||||
static void event_handler(lv_obj_t * obj, lv_event_t event) {
|
||||
char baby_buf[30]={0};
|
||||
char baby_buf[30] = { 0 };
|
||||
switch (obj->mks_obj_id) {
|
||||
case ID_BABY_STEP_X_P:
|
||||
if (event == LV_EVENT_CLICKED) {
|
||||
|
|
@ -259,7 +259,7 @@ void lv_draw_baby_stepping(void) {
|
|||
labelV = lv_label_create(buttonV, NULL);
|
||||
lv_obj_t *label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelXI, move_menu.x_add);
|
||||
lv_obj_align(labelXI, buttonXI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
@ -318,7 +318,7 @@ void disp_baby_step_dist() {
|
|||
lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, "F:/bmp_baby_move0_1.bin");
|
||||
lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, "F:/bmp_baby_move0_1.bin");
|
||||
}
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
if ((int)(100 * babystep_dist) == 1) {
|
||||
lv_label_set_text(labelV, move_menu.step_001mm);
|
||||
lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
|
|
|||
|
|
@ -23,16 +23,15 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -239,7 +238,7 @@ void lv_draw_change_speed(void) {
|
|||
labelStep = lv_label_create(buttonStep, NULL);
|
||||
lv_obj_t *label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelAdd, speed_menu.add);
|
||||
lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
@ -281,7 +280,7 @@ void disp_speed_step() {
|
|||
lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_REL, "F:/bmp_step10_percent.bin");
|
||||
lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, "F:/bmp_step10_percent.bin");
|
||||
}
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
if (uiCfg.stepPrintSpeed == 1) {
|
||||
lv_label_set_text(labelStep, speed_menu.step_1percent);
|
||||
lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
|
@ -337,7 +336,7 @@ void disp_speed_type() {
|
|||
lv_obj_refresh_ext_draw_pad(buttonExt);
|
||||
lv_obj_refresh_ext_draw_pad(buttonMov);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelMov, speed_menu.move);
|
||||
lv_obj_align(labelMov, buttonMov, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,20 +28,20 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../sd/cardreader.h"
|
||||
#include "../../../../gcode/queue.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../gcode/gcode.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
#include "../../../../feature/powerloss.h"
|
||||
|
|
@ -50,7 +50,6 @@
|
|||
#if ENABLED(PARK_HEAD_ON_PAUSE)
|
||||
#include "../../../../feature/pause.h"
|
||||
#endif
|
||||
#include "../../../../gcode/gcode.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -58,8 +57,7 @@ static lv_obj_t * tempText1;
|
|||
static lv_obj_t * filament_bar;
|
||||
|
||||
extern uint8_t sel_id;
|
||||
extern uint8_t once_flag;
|
||||
extern uint8_t gcode_preview_over;
|
||||
extern bool once_flag, gcode_preview_over;
|
||||
extern int upload_result ;
|
||||
extern uint32_t upload_time;
|
||||
extern uint32_t upload_size;
|
||||
|
|
@ -82,7 +80,7 @@ static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) {
|
|||
lv_draw_printing();
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
if (gcode_preview_over != 1) {
|
||||
if (!gcode_preview_over) {
|
||||
char *cur_name;
|
||||
cur_name = strrchr(list_file.file_name[sel_id], '/');
|
||||
|
||||
|
|
@ -109,7 +107,7 @@ static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) {
|
|||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
recovery.prepare();
|
||||
#endif
|
||||
once_flag = 0;
|
||||
once_flag = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -191,7 +191,7 @@ void lv_draw_eeprom_settings(void) {
|
|||
lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF);
|
||||
label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(label_Back, common_menu.text_back);
|
||||
lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,15 +23,10 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../module/stepper/indirection.h"
|
||||
#include "../../../../feature/tmc_util.h"
|
||||
#include "../../../../gcode/gcode.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
#if BUTTONS_EXIST(EN1, EN2)
|
||||
|
||||
|
|
@ -59,20 +54,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
|
|||
|
||||
}
|
||||
else if (event == LV_EVENT_RELEASED) {
|
||||
if (gCfgItems.encoder_enable) {
|
||||
gCfgItems.encoder_enable = false;
|
||||
lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_REL, "F:/bmp_disable.bin");
|
||||
lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_PR, "F:/bmp_disable.bin");
|
||||
lv_label_set_text(labelEncoderState, machine_menu.disable);
|
||||
update_spi_flash();
|
||||
}
|
||||
else {
|
||||
gCfgItems.encoder_enable = true;
|
||||
lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_REL, "F:/bmp_enable.bin");
|
||||
lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_PR, "F:/bmp_enable.bin");
|
||||
lv_label_set_text(labelEncoderState, machine_menu.enable);
|
||||
update_spi_flash();
|
||||
}
|
||||
gCfgItems.encoder_enable ^= true;
|
||||
lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_REL, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin");
|
||||
lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_PR, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin");
|
||||
lv_label_set_text(labelEncoderState, machine_menu.enable);
|
||||
update_spi_flash();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -110,14 +96,8 @@ void lv_draw_encoder_settings(void) {
|
|||
|
||||
buttonEncoderState = lv_imgbtn_create(scr, NULL);
|
||||
lv_obj_set_pos(buttonEncoderState, PARA_UI_STATE_POS_X, PARA_UI_POS_Y + PARA_UI_STATE_V);
|
||||
if (gCfgItems.encoder_enable) {
|
||||
lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_REL, "F:/bmp_enable.bin");
|
||||
lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_PR, "F:/bmp_enable.bin");
|
||||
}
|
||||
else {
|
||||
lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_REL, "F:/bmp_disable.bin");
|
||||
lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_PR, "F:/bmp_disable.bin");
|
||||
}
|
||||
lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_REL, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin");
|
||||
lv_imgbtn_set_src(buttonEncoderState, LV_BTN_STATE_PR, gCfgItems.encoder_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin");
|
||||
|
||||
lv_obj_set_event_cb_mks(buttonEncoderState, event_handler, ID_ENCODER_STATE, NULL, 0);
|
||||
|
||||
|
|
@ -140,14 +120,8 @@ void lv_draw_encoder_settings(void) {
|
|||
lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF);
|
||||
label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.encoder_enable) {
|
||||
lv_label_set_text(labelEncoderState, machine_menu.enable);
|
||||
lv_obj_align(labelEncoderState, buttonEncoderState, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
else {
|
||||
lv_label_set_text(labelEncoderState, machine_menu.disable);
|
||||
lv_obj_align(labelEncoderState, buttonEncoderState, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
lv_label_set_text(labelEncoderState, gCfgItems.encoder_enable ? machine_menu.enable : machine_menu.disable);
|
||||
lv_obj_align(labelEncoderState, buttonEncoderState, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
lv_label_set_text(label_Back, common_menu.text_back);
|
||||
lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0);
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "SPI_TFT.h"
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "tft_lvgl_configuration.h"
|
||||
#include "mks_hardware_test.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "SPI_TFT.h"
|
||||
#include "mks_hardware_test.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
static lv_obj_t * scr;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,16 +23,16 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "../../../../gcode/queue.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
static lv_obj_t * scr;
|
||||
extern lv_group_t* g;
|
||||
|
|
@ -235,7 +235,7 @@ void lv_draw_extrusion(void) {
|
|||
labelSpeed = lv_label_create(buttonSpeed, NULL);
|
||||
lv_obj_t *label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelAdd, extrude_menu.in);
|
||||
lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
@ -274,7 +274,7 @@ void disp_ext_type() {
|
|||
if (uiCfg.curSprayerChoose == 1) {
|
||||
lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru2.bin");
|
||||
lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru2.bin");
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelType, extrude_menu.ext2);
|
||||
lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
}
|
||||
|
|
@ -282,7 +282,7 @@ void disp_ext_type() {
|
|||
else {
|
||||
lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru1.bin");
|
||||
lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru1.bin");
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelType, extrude_menu.ext1);
|
||||
lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
}
|
||||
|
|
@ -303,7 +303,7 @@ void disp_ext_speed() {
|
|||
lv_imgbtn_set_src(buttonSpeed, LV_BTN_STATE_PR, "F:/bmp_speed_normal.bin");
|
||||
}
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
if (uiCfg.extruSpeed == 20) {
|
||||
lv_label_set_text(labelSpeed, extrude_menu.high);
|
||||
lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
|
@ -377,7 +377,7 @@ void disp_ext_step() {
|
|||
lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, "F:/bmp_step10_mm.bin");
|
||||
}
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
if (uiCfg.extruStep == 1) {
|
||||
lv_label_set_text(labelStep, extrude_menu.step_1mm);
|
||||
lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
|
|
|||
|
|
@ -23,17 +23,17 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
#include "../../../../../Configuration.h"
|
||||
#include "draw_ui.h"
|
||||
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "../../../../gcode/queue.h"
|
||||
#include "../../../../gcode/gcode.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -209,7 +209,7 @@ void lv_draw_fan(void) {
|
|||
lv_obj_t *labelOff = lv_label_create(buttonOff, NULL);
|
||||
lv_obj_t *label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelAdd, fan_menu.add);
|
||||
lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,15 +23,14 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "../../../../gcode/queue.h"
|
||||
#include "../../../../gcode/gcode.h"
|
||||
#include "../../../../module/motion.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -197,7 +196,7 @@ void lv_draw_filament_change(void) {
|
|||
labelType = lv_label_create(buttoType, NULL);
|
||||
lv_obj_t *label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelIn, filament_menu.in);
|
||||
lv_obj_align(labelIn, buttonIn, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
@ -228,7 +227,7 @@ void disp_filament_type() {
|
|||
if (uiCfg.curSprayerChoose == 1) {
|
||||
lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru2.bin");
|
||||
lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru2.bin");
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelType, preheat_menu.ext2);
|
||||
lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
}
|
||||
|
|
@ -236,7 +235,7 @@ void disp_filament_type() {
|
|||
else {
|
||||
lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru1.bin");
|
||||
lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru1.bin");
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelType, preheat_menu.ext1);
|
||||
lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,11 +23,10 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -279,7 +278,7 @@ void lv_draw_filament_settings(void) {
|
|||
if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack);
|
||||
#endif
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
if (uiCfg.para_ui_page != 1) {
|
||||
ZERO(public_buf_l);
|
||||
sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.filamentchange_load_length);
|
||||
|
|
|
|||
|
|
@ -23,16 +23,17 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "draw_ready_print.h"
|
||||
#include "draw_set.h"
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
#include "draw_ui.h"
|
||||
|
||||
#include "../../../../gcode/queue.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -206,7 +207,7 @@ void lv_draw_home(void) {
|
|||
lv_obj_t *labelOffXY = lv_label_create(buttonOffXY, NULL);
|
||||
lv_obj_t *label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelHomeAll, home_menu.home_all);
|
||||
lv_obj_align(labelHomeAll, buttonHomeAll, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,18 +19,15 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "../../../../inc/MarlinConfigPre.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
#if HAS_TFT_LVGL_UI && USE_SENSORLESS
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../module/probe.h"
|
||||
|
||||
#if USE_SENSORLESS
|
||||
#include "../../../../module/stepper/indirection.h"
|
||||
#include "../../../../feature/tmc_util.h"
|
||||
|
||||
|
|
@ -222,7 +219,7 @@ void lv_draw_homing_sensitivity_settings(void) {
|
|||
if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack);
|
||||
#endif
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
ZERO(public_buf_l);
|
||||
sprintf_P(public_buf_l, PSTR("%d"), TERN(X_SENSORLESS, stepperX.homing_threshold(), 0));
|
||||
lv_label_set_text(labelXValue, public_buf_l);
|
||||
|
|
@ -257,6 +254,4 @@ void lv_clear_homing_sensitivity_settings() {
|
|||
lv_obj_del(scr);
|
||||
}
|
||||
|
||||
#endif // USE_SENSORLESS
|
||||
|
||||
#endif // HAS_TFT_LVGL_UI && USE_SENSORLESS
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@
|
|||
|
||||
#if BOTH(HAS_TFT_LVGL_UI, HAS_CLASSIC_JERK)
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -201,7 +201,7 @@ void lv_draw_jerk_settings(void) {
|
|||
}
|
||||
#endif
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
ZERO(public_buf_l);
|
||||
sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[X_AXIS]);
|
||||
lv_label_set_text(labelXValue, public_buf_l);
|
||||
|
|
|
|||
|
|
@ -23,11 +23,10 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../../Configuration.h"
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
|
|||
|
|
@ -23,14 +23,14 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
#include <string.h>
|
||||
|
||||
//static lv_obj_t *buttonMoveZ,*buttonTest,*buttonZ0,*buttonStop,*buttonReturn;
|
||||
|
|
@ -352,7 +352,7 @@ void lv_draw_language(void) {
|
|||
|
||||
disp_language(gCfgItems.language, SELECTED);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(label_CN, language_menu.chinese_s);
|
||||
lv_obj_align(label_CN, buttonCN, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -234,7 +234,7 @@ void lv_draw_level_settings(void) {
|
|||
lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF);
|
||||
label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(label_Back, common_menu.text_back);
|
||||
lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -252,7 +252,7 @@ void lv_draw_machine_para(void) {
|
|||
lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF);
|
||||
label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(label_Back, common_menu.text_back);
|
||||
lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, -2);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -218,7 +218,7 @@ void lv_draw_machine_settings(void) {
|
|||
lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF);
|
||||
label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(label_Back, common_menu.text_back);
|
||||
lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,14 +23,15 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
#include "draw_ui.h"
|
||||
|
||||
#include "../../../../gcode/queue.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -253,7 +254,7 @@ void lv_draw_manualLevel(void) {
|
|||
lv_obj_t *label_Point5 = lv_label_create(buttonPoint5, NULL);
|
||||
lv_obj_t *label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(label_Point1, leveling_menu.position1);
|
||||
lv_obj_align(label_Point1, buttonPoint1, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -384,7 +384,7 @@ void lv_draw_manual_level_pos_settings(void) {
|
|||
if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack);
|
||||
#endif
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
if (uiCfg.para_ui_page != 1) {
|
||||
ZERO(public_buf_l);
|
||||
sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[0][0]);
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -284,7 +284,7 @@ void lv_draw_max_feedrate_settings(void) {
|
|||
if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack);
|
||||
#endif
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
if (uiCfg.para_ui_page != 1) {
|
||||
|
||||
lv_label_set_text(labelTurnPage, machine_menu.next);
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -310,7 +310,7 @@ void lv_draw_motor_settings(void) {
|
|||
if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack);
|
||||
#endif
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(label_Back, common_menu.text_back);
|
||||
lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,14 +23,15 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
#include "draw_ui.h"
|
||||
|
||||
#include "../../../../gcode/queue.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -268,7 +269,7 @@ void lv_draw_move_motor(void) {
|
|||
labelV = lv_label_create(buttonV, NULL);
|
||||
lv_obj_t *label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelXI, move_menu.x_add);
|
||||
lv_obj_align(labelXI, buttonXI, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
@ -321,7 +322,7 @@ void disp_move_dist() {
|
|||
lv_imgbtn_set_src(buttonV, LV_BTN_STATE_REL, "F:/bmp_step_move10.bin");
|
||||
lv_imgbtn_set_src(buttonV, LV_BTN_STATE_PR, "F:/bmp_step_move10.bin");
|
||||
}
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
if ((int)(10 * uiCfg.move_dist) == 1) {
|
||||
lv_label_set_text(labelV, move_menu.step_01mm);
|
||||
lv_obj_align(labelV, buttonV, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
|
|
|||
|
|
@ -23,25 +23,23 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../../lvgl/src/lv_core/lv_refr.h"
|
||||
//#include "../../MarlinCore.h"
|
||||
#include "draw_ui.h"
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "../../../../gcode/gcode.h"
|
||||
#include "../../../../gcode/queue.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
#include "../../../../feature/powerloss.h"
|
||||
#endif
|
||||
|
||||
#include "../../../../gcode/gcode.h"
|
||||
#include "../../../../module/planner.h"
|
||||
|
||||
#if HAS_TRINAMIC_CONFIG
|
||||
#include "../../../../module/stepper/indirection.h"
|
||||
#include "../../../../feature/tmc_util.h"
|
||||
|
|
|
|||
|
|
@ -23,17 +23,17 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "../../../../module/motion.h"
|
||||
#include "../../../../sd/cardreader.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -135,24 +135,21 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
|
|||
// nothing to do
|
||||
}
|
||||
else if (event == LV_EVENT_RELEASED) {
|
||||
if (gCfgItems.finish_power_off == 1) {
|
||||
gCfgItems.finish_power_off = 0;
|
||||
if (gCfgItems.finish_power_off) {
|
||||
gCfgItems.finish_power_off = false;
|
||||
lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_REL, "F:/bmp_manual_off.bin");
|
||||
lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, "F:/bmp_manual_off.bin");
|
||||
lv_label_set_text(label_PowerOff, printing_more_menu.manual);
|
||||
lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
lv_obj_refresh_ext_draw_pad(label_PowerOff);
|
||||
update_spi_flash();
|
||||
}
|
||||
else {
|
||||
gCfgItems.finish_power_off = 1;
|
||||
gCfgItems.finish_power_off = true;
|
||||
lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_REL, "F:/bmp_auto_off.bin");
|
||||
lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, "F:/bmp_auto_off.bin");
|
||||
lv_label_set_text(label_PowerOff, printing_more_menu.auto_close);
|
||||
lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
lv_obj_refresh_ext_draw_pad(label_PowerOff);
|
||||
update_spi_flash();
|
||||
}
|
||||
lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
lv_obj_refresh_ext_draw_pad(label_PowerOff);
|
||||
update_spi_flash();
|
||||
}
|
||||
break;
|
||||
case ID_O_BABY_STEP:
|
||||
|
|
@ -229,7 +226,7 @@ void lv_draw_operation(void) {
|
|||
lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_PR, &tft_style_label_pre);
|
||||
lv_imgbtn_set_style(buttonFan, LV_BTN_STATE_REL, &tft_style_label_rel);
|
||||
|
||||
if (gCfgItems.finish_power_off == 1) {
|
||||
if (gCfgItems.finish_power_off) {
|
||||
lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_REL, "F:/bmp_auto_off.bin");
|
||||
lv_imgbtn_set_src(buttonPowerOff, LV_BTN_STATE_PR, "F:/bmp_auto_off.bin");
|
||||
}
|
||||
|
|
@ -362,7 +359,7 @@ void lv_draw_operation(void) {
|
|||
}
|
||||
label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelPreHeat, operation_menu.temp);
|
||||
lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
@ -372,7 +369,7 @@ void lv_draw_operation(void) {
|
|||
lv_label_set_text(label_Fan, operation_menu.fan);
|
||||
lv_obj_align(label_Fan, buttonFan, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
if (gCfgItems.finish_power_off == 1)
|
||||
if (gCfgItems.finish_power_off)
|
||||
lv_label_set_text(label_PowerOff, printing_more_menu.auto_close);
|
||||
else
|
||||
lv_label_set_text(label_PowerOff, printing_more_menu.manual);
|
||||
|
|
|
|||
|
|
@ -24,14 +24,14 @@
|
|||
#if BOTH(HAS_TFT_LVGL_UI, ADVANCED_PAUSE_FEATURE)
|
||||
|
||||
#include "draw_ui.h"
|
||||
#include "lv_conf.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../feature/pause.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
void lv_draw_pause_message(const PauseMessage msg) {
|
||||
switch (msg) {
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -163,7 +163,7 @@ void lv_draw_pause_position(void) {
|
|||
lv_btn_set_style(buttonBack, LV_BTN_STYLE_PR, &style_para_back);
|
||||
label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
ZERO(public_buf_l);
|
||||
sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosX);
|
||||
lv_label_set_text(labelXValue, public_buf_l);
|
||||
|
|
|
|||
|
|
@ -23,15 +23,15 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
static lv_obj_t * scr;
|
||||
extern lv_group_t* g;
|
||||
|
|
@ -275,7 +275,7 @@ void lv_draw_preHeat(void) {
|
|||
lv_obj_t *labelOff = lv_label_create(buttonOff, NULL);
|
||||
lv_obj_t *label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelAdd, preheat_menu.add);
|
||||
lv_obj_align(labelAdd, buttonAdd, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
@ -312,7 +312,7 @@ void disp_temp_type() {
|
|||
if (uiCfg.curSprayerChoose == 1) {
|
||||
lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru2.bin");
|
||||
lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru2.bin");
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelType, preheat_menu.ext2);
|
||||
lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
}
|
||||
|
|
@ -320,7 +320,7 @@ void disp_temp_type() {
|
|||
else {
|
||||
lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_extru1.bin");
|
||||
lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_extru1.bin");
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelType, preheat_menu.ext1);
|
||||
lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
}
|
||||
|
|
@ -330,7 +330,7 @@ void disp_temp_type() {
|
|||
else {
|
||||
lv_imgbtn_set_src(buttoType, LV_BTN_STATE_REL, "F:/bmp_bed.bin");
|
||||
lv_imgbtn_set_src(buttoType, LV_BTN_STATE_PR, "F:/bmp_bed.bin");
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelType, preheat_menu.hotbed);
|
||||
lv_obj_align(labelType, buttoType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
}
|
||||
|
|
@ -375,7 +375,7 @@ void disp_step_heat() {
|
|||
lv_imgbtn_set_src(buttonStep, LV_BTN_STATE_PR, "F:/bmp_step10_degree.bin");
|
||||
}
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
if (uiCfg.stepHeat == 1) {
|
||||
lv_label_set_text(labelStep, preheat_menu.step_1c);
|
||||
lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
|
|
|||
|
|
@ -23,14 +23,15 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
#include "draw_ui.h"
|
||||
|
||||
#include "../../../../sd/cardreader.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
static lv_obj_t * scr;
|
||||
extern lv_group_t* g;
|
||||
|
|
@ -270,7 +271,7 @@ void lv_draw_print_file(void) {
|
|||
//lv_obj_t *label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
/*
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelPageUp, tool_menu.preheat);
|
||||
lv_obj_align(labelPageUp, buttonPageUp, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,23 +23,25 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../MarlinCore.h" // for marlin_state
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "../../../../module/motion.h"
|
||||
#include "../../../../sd/cardreader.h"
|
||||
#include "../../../../gcode/queue.h"
|
||||
#include "../../../../gcode/gcode.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
#include "../../../../feature/powerloss.h"
|
||||
#endif
|
||||
|
||||
#if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
|
||||
#include "../../../marlinui.h"
|
||||
#endif
|
||||
|
|
@ -60,11 +62,9 @@ static lv_obj_t * buttonPause, *buttonOperat, *buttonStop;
|
|||
#define ID_STOP 2
|
||||
#define ID_OPTION 3
|
||||
|
||||
uint8_t once_flag = 0;
|
||||
bool once_flag; // = false
|
||||
extern bool flash_preview_begin, default_preview_flg, gcode_preview_over;
|
||||
extern uint32_t To_pre_view;
|
||||
extern uint8_t flash_preview_begin;
|
||||
extern uint8_t default_preview_flg;
|
||||
extern uint8_t gcode_preview_over;
|
||||
|
||||
static void event_handler(lv_obj_t * obj, lv_event_t event) {
|
||||
switch (obj->mks_obj_id) {
|
||||
|
|
@ -73,7 +73,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
|
|||
// nothing to do
|
||||
}
|
||||
else if (event == LV_EVENT_RELEASED) {
|
||||
if (gcode_preview_over != 1) {
|
||||
if (!gcode_preview_over) {
|
||||
if (uiCfg.print_state == WORKING) {
|
||||
// #if ENABLED(PARK_HEAD_ON_PAUSE)
|
||||
// queue.inject_P(PSTR("M25 P\nM24"));
|
||||
|
|
@ -117,7 +117,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
|
|||
// nothing to do
|
||||
}
|
||||
else if (event == LV_EVENT_RELEASED) {
|
||||
if (gcode_preview_over != 1) {
|
||||
if (!gcode_preview_over) {
|
||||
lv_clear_printing();
|
||||
lv_draw_dialog(DIALOG_TYPE_STOP);
|
||||
}
|
||||
|
|
@ -128,7 +128,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
|
|||
// nothing to do
|
||||
}
|
||||
else if (event == LV_EVENT_RELEASED) {
|
||||
if (gcode_preview_over != 1) {
|
||||
if (!gcode_preview_over) {
|
||||
lv_clear_printing();
|
||||
lv_draw_operation();
|
||||
}
|
||||
|
|
@ -290,7 +290,7 @@ void lv_draw_printing(void) {
|
|||
labelStop = lv_label_create(buttonStop, NULL);
|
||||
labelOperat = lv_label_create(buttonOperat, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelPause, uiCfg.print_state == WORKING ? printing_menu.pause : printing_menu.resume);
|
||||
lv_obj_align(labelPause, buttonPause, LV_ALIGN_CENTER, 20, 0);
|
||||
|
||||
|
|
@ -378,7 +378,7 @@ void setProBarRate() {
|
|||
int rate;
|
||||
volatile long long rate_tmp_r;
|
||||
|
||||
if (gCfgItems.from_flash_pic != 1) {
|
||||
if (!gCfgItems.from_flash_pic) {
|
||||
#if ENABLED(SDSUPPORT)
|
||||
rate_tmp_r = (long long)card.getIndex() * 100;
|
||||
#endif
|
||||
|
|
@ -405,15 +405,15 @@ void setProBarRate() {
|
|||
if (once_flag == 0) {
|
||||
stop_print_time();
|
||||
|
||||
flash_preview_begin = 0;
|
||||
default_preview_flg = 0;
|
||||
flash_preview_begin = false;
|
||||
default_preview_flg = false;
|
||||
lv_clear_printing();
|
||||
lv_draw_dialog(DIALOG_TYPE_FINISH_PRINT);
|
||||
|
||||
once_flag = 1;
|
||||
once_flag = true;
|
||||
|
||||
#if HAS_SUICIDE
|
||||
if (gCfgItems.finish_power_off == 1) {
|
||||
if (gCfgItems.finish_power_off) {
|
||||
gcode.process_subcommands_now_P(PSTR("M1001"));
|
||||
queue.inject_P(PSTR("M81"));
|
||||
marlin_state = MF_RUNNING;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "draw_ready_print.h"
|
||||
#include "draw_tool.h"
|
||||
#include "lv_conf.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
|
|
@ -36,8 +36,8 @@
|
|||
|
||||
#include <lvgl.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
@ -186,7 +186,7 @@ void lv_draw_ready_print(void) {
|
|||
//lv_obj_t *label_print = lv_label_create(buttonPrint, NULL);
|
||||
//lv_obj_t *label_set = lv_label_create(buttonSet, NULL);
|
||||
lv_obj_t *label_tool = lv_label_create(buttonTool, NULL);
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
//lv_label_set_text(label_print, main_menu.print);
|
||||
//lv_obj_align(label_print, buttonPrint, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
@ -279,7 +279,7 @@ void lv_draw_ready_print(void) {
|
|||
lv_obj_t *label_print = lv_label_create(buttonPrint, NULL);
|
||||
lv_btn_set_layout(buttonPrint, LV_LAYOUT_OFF);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(label_print, main_menu.print);
|
||||
lv_obj_align(label_print, buttonPrint, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,18 +23,20 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "draw_ready_print.h"
|
||||
#include "draw_set.h"
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
#include "draw_ui.h"
|
||||
#include "../../../../gcode/queue.h"
|
||||
|
||||
#include "pic_manager.h"
|
||||
|
||||
#include "../../../../gcode/queue.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
static lv_obj_t * scr;
|
||||
extern lv_group_t* g;
|
||||
|
||||
|
|
@ -331,7 +333,7 @@ void lv_draw_set(void) {
|
|||
#endif
|
||||
lv_obj_t *label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
|
||||
lv_label_set_text(label_EepromSet, set_menu.eepromSet);
|
||||
lv_obj_align(label_EepromSet, buttonEepromSet, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -278,7 +278,7 @@ void lv_draw_step_settings(void) {
|
|||
if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack);
|
||||
#endif
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
if (uiCfg.para_ui_page != 1) {
|
||||
lv_label_set_text(labelTurnPage, machine_menu.next);
|
||||
lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0);
|
||||
|
|
|
|||
|
|
@ -23,13 +23,12 @@
|
|||
|
||||
#if BOTH(HAS_TFT_LVGL_UI, HAS_TRINAMIC_CONFIG)
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../module/stepper/indirection.h"
|
||||
#include "../../../../feature/tmc_util.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -310,7 +309,7 @@ void lv_draw_tmc_current_settings(void) {
|
|||
lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE);
|
||||
label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
if (uiCfg.para_ui_page != 1) {
|
||||
//#if AXIS_IS_TMC(E1)
|
||||
lv_label_set_text(labelTurnPage, machine_menu.next);
|
||||
|
|
|
|||
|
|
@ -23,15 +23,13 @@
|
|||
|
||||
#if BOTH(HAS_TFT_LVGL_UI, HAS_STEALTHCHOP)
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../module/stepper/indirection.h"
|
||||
#include "../../../../feature/tmc_util.h"
|
||||
#include "../../../../gcode/gcode.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -232,7 +230,6 @@ void lv_draw_tmc_step_mode_settings(void) {
|
|||
lv_obj_t *buttonE1Text = NULL, *labelE1Text = NULL;
|
||||
//#endif
|
||||
|
||||
|
||||
labelXState = NULL;
|
||||
buttonXState = NULL;
|
||||
labelYState = NULL;
|
||||
|
|
@ -493,7 +490,7 @@ void lv_draw_tmc_step_mode_settings(void) {
|
|||
lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF);
|
||||
label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
if (uiCfg.para_ui_page != 1) {
|
||||
lv_label_set_text(labelXText, machine_menu.X_StepMode);
|
||||
lv_obj_align(labelXText, buttonXText, LV_ALIGN_IN_LEFT_MID, 0, 0);
|
||||
|
|
|
|||
|
|
@ -23,16 +23,16 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
//#include "../lvgl/src/lv_objx/lv_imgbtn.h"
|
||||
//#include "../lvgl/src/lv_objx/lv_img.h"
|
||||
//#include "../lvgl/src/lv_core/lv_disp.h"
|
||||
//#include "../lvgl/src/lv_core/lv_refr.h"
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../gcode/queue.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t * scr;
|
||||
|
|
@ -236,7 +236,7 @@ void lv_draw_tool(void) {
|
|||
//lv_obj_t *label_More = lv_label_create(buttonMore, NULL);
|
||||
lv_obj_t *label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language != 0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelPreHeat, tool_menu.preheat);
|
||||
lv_obj_align(labelPreHeat, buttonPreHeat, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
|
|||
|
|
@ -34,10 +34,11 @@
|
|||
|
||||
#include <SPI.h>
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
#include "../../../../MarlinCore.h" // for marlin_state
|
||||
#include "../../../../sd/cardreader.h"
|
||||
#include "../../../../module/motion.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
#include "../../../../feature/powerloss.h"
|
||||
|
|
@ -57,15 +58,13 @@ num_key_value_state value;
|
|||
keyboard_value_state keyboard_value;
|
||||
|
||||
uint32_t To_pre_view;
|
||||
uint8_t gcode_preview_over;
|
||||
uint8_t flash_preview_begin;
|
||||
uint8_t default_preview_flg;
|
||||
bool gcode_preview_over, flash_preview_begin, default_preview_flg;
|
||||
uint32_t size = 809;
|
||||
uint16_t row;
|
||||
uint8_t temperature_change_frequency;
|
||||
uint8_t printing_rate_update_flag;
|
||||
|
||||
extern uint8_t once_flag;
|
||||
extern bool once_flag;
|
||||
extern uint8_t sel_id;
|
||||
extern uint8_t public_buf[512];
|
||||
extern uint8_t bmp_public_buf[17 * 1024];
|
||||
|
|
@ -116,10 +115,10 @@ void gCfgItems_init() {
|
|||
gCfgItems.language = LANG_PORTUGUESE;
|
||||
#endif
|
||||
gCfgItems.leveling_mode = 0;
|
||||
gCfgItems.from_flash_pic = 0;
|
||||
gCfgItems.from_flash_pic = false;
|
||||
gCfgItems.curFilesize = 0;
|
||||
gCfgItems.finish_power_off = 0;
|
||||
gCfgItems.pause_reprint = 0;
|
||||
gCfgItems.finish_power_off = false;
|
||||
gCfgItems.pause_reprint = false;
|
||||
gCfgItems.pausePosX = -1;
|
||||
gCfgItems.pausePosY = -1;
|
||||
gCfgItems.pausePosZ = 5;
|
||||
|
|
@ -407,7 +406,6 @@ void tft_style_init() {
|
|||
lv_bar_style_indic.body.main_color = lv_color_hex3(0xADF);
|
||||
lv_bar_style_indic.body.grad_color = lv_color_hex3(0xADF);
|
||||
lv_bar_style_indic.body.border.color = lv_color_hex3(0xADF);
|
||||
|
||||
}
|
||||
|
||||
#define MAX_TITLE_LEN 28
|
||||
|
|
@ -609,14 +607,14 @@ char *creat_title_text() {
|
|||
pre_read_cnt = (uint32_t)p1 - (uint32_t)((uint32_t *)(&public_buf[0]));
|
||||
|
||||
To_pre_view = pre_read_cnt;
|
||||
gcode_preview_over = 1;
|
||||
gCfgItems.from_flash_pic = 1;
|
||||
gcode_preview_over = true;
|
||||
gCfgItems.from_flash_pic = true;
|
||||
update_spi_flash();
|
||||
}
|
||||
else {
|
||||
gcode_preview_over = 0;
|
||||
default_preview_flg = 1;
|
||||
gCfgItems.from_flash_pic = 0;
|
||||
gcode_preview_over = false;
|
||||
default_preview_flg = true;
|
||||
gCfgItems.from_flash_pic = false;
|
||||
update_spi_flash();
|
||||
}
|
||||
card.closefile();
|
||||
|
|
@ -681,8 +679,8 @@ char *creat_title_text() {
|
|||
size = 809;
|
||||
row = 0;
|
||||
|
||||
gcode_preview_over = 0;
|
||||
//flash_preview_begin = 1;
|
||||
gcode_preview_over = false;
|
||||
//flash_preview_begin = true;
|
||||
|
||||
card.closefile();
|
||||
|
||||
|
|
@ -696,7 +694,7 @@ char *creat_title_text() {
|
|||
//bakup_file_path((uint8_t *)curFileName, strlen(curFileName));
|
||||
srcfp = file;
|
||||
mksReprint.mks_printer_state = MKS_WORKING;
|
||||
once_flag = 0;
|
||||
once_flag = false;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
|
@ -727,7 +725,7 @@ char *creat_title_text() {
|
|||
#endif
|
||||
card.startFileprint();
|
||||
TERN_(POWER_LOSS_RECOVERY, recovery.prepare());
|
||||
once_flag = 0;
|
||||
once_flag = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -813,8 +811,8 @@ char *creat_title_text() {
|
|||
size = 809;
|
||||
row = 0;
|
||||
|
||||
gcode_preview_over = 0;
|
||||
//flash_preview_begin = 1;
|
||||
gcode_preview_over = false;
|
||||
//flash_preview_begin = true;
|
||||
|
||||
card.closefile();
|
||||
|
||||
|
|
@ -828,7 +826,7 @@ char *creat_title_text() {
|
|||
//bakup_file_path((uint8_t *)curFileName, strlen(curFileName));
|
||||
srcfp = file;
|
||||
mksReprint.mks_printer_state = MKS_WORKING;
|
||||
once_flag = 0;
|
||||
once_flag = false;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
|
@ -859,7 +857,7 @@ char *creat_title_text() {
|
|||
#endif
|
||||
card.startFileprint();
|
||||
TERN_(POWER_LOSS_RECOVERY, recovery.prepare());
|
||||
once_flag = 0;
|
||||
once_flag = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -894,17 +892,17 @@ char *creat_title_text() {
|
|||
}
|
||||
|
||||
void disp_pre_gcode(int xpos_pixel, int ypos_pixel) {
|
||||
if (gcode_preview_over == 1) gcode_preview(list_file.file_name[sel_id], xpos_pixel, ypos_pixel);
|
||||
if (gcode_preview_over) gcode_preview(list_file.file_name[sel_id], xpos_pixel, ypos_pixel);
|
||||
#if HAS_BAK_VIEW_IN_FLASH
|
||||
if (flash_preview_begin == 1) {
|
||||
flash_preview_begin = 0;
|
||||
if (flash_preview_begin) {
|
||||
flash_preview_begin = false;
|
||||
Draw_default_preview(xpos_pixel, ypos_pixel, 1);
|
||||
}
|
||||
#endif
|
||||
#if HAS_GCODE_DEFAULT_VIEW_IN_FLASH
|
||||
if (default_preview_flg == 1) {
|
||||
if (default_preview_flg) {
|
||||
Draw_default_preview(xpos_pixel, ypos_pixel, 0);
|
||||
default_preview_flg = 0;
|
||||
default_preview_flg = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -971,7 +969,7 @@ void GUI_RefreshPage() {
|
|||
}
|
||||
if (printing_rate_update_flag || marlin_state == MF_SD_COMPLETE) {
|
||||
printing_rate_update_flag = 0;
|
||||
if (gcode_preview_over == 0) setProBarRate();
|
||||
if (!gcode_preview_over) setProBarRate();
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -1359,8 +1357,8 @@ void draw_return_ui() {
|
|||
lv_draw_print_file();
|
||||
break;
|
||||
case PRINTING_UI:
|
||||
if (gCfgItems.from_flash_pic == 1) flash_preview_begin = 1;
|
||||
else default_preview_flg = 1;
|
||||
if (gCfgItems.from_flash_pic) flash_preview_begin = true;
|
||||
else default_preview_flg = true;
|
||||
lv_draw_printing();
|
||||
break;
|
||||
case MOVE_MOTOR_UI:
|
||||
|
|
|
|||
|
|
@ -174,12 +174,12 @@ extern char public_buf_l[30];
|
|||
typedef struct {
|
||||
uint32_t spi_flash_flag;
|
||||
uint8_t disp_rotation_180;
|
||||
uint8_t multiple_language;
|
||||
bool multiple_language;
|
||||
uint8_t language;
|
||||
uint8_t leveling_mode;
|
||||
uint8_t from_flash_pic;
|
||||
uint8_t finish_power_off;
|
||||
uint8_t pause_reprint;
|
||||
bool from_flash_pic;
|
||||
bool finish_power_off;
|
||||
bool pause_reprint;
|
||||
uint8_t wifi_mode_sel;
|
||||
uint8_t fileSysType;
|
||||
uint8_t wifi_type;
|
||||
|
|
|
|||
|
|
@ -23,13 +23,12 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
#include "tft_lvgl_configuration.h"
|
||||
|
||||
#if ENABLED(USE_WIFI_FUNCTION)
|
||||
|
||||
#include "../../../../../Configuration.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "draw_ui.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t *scr, *wifi_name_text, *wifi_key_text, *wifi_state_text, *wifi_ip_text;
|
||||
|
|
@ -135,7 +134,7 @@ void lv_draw_wifi(void) {
|
|||
label_Reconnect = lv_label_create(buttonReconnect, NULL);
|
||||
}
|
||||
|
||||
if (gCfgItems.multiple_language !=0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(label_Back, common_menu.text_back);
|
||||
lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,13 +23,12 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
#include "tft_lvgl_configuration.h"
|
||||
|
||||
#if ENABLED(USE_WIFI_FUNCTION)
|
||||
|
||||
#include "../../../../../Configuration.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "draw_ui.h"
|
||||
|
||||
#define NAME_BTN_X 330
|
||||
#define NAME_BTN_Y 48
|
||||
|
|
|
|||
|
|
@ -23,13 +23,12 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
#include "tft_lvgl_configuration.h"
|
||||
|
||||
#if ENABLED(USE_WIFI_FUNCTION)
|
||||
|
||||
#include "../../../../../Configuration.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "draw_ui.h"
|
||||
|
||||
extern lv_group_t * g;
|
||||
static lv_obj_t *scr, *labelModelValue = NULL, *buttonModelValue = NULL, *labelCloudValue = NULL;
|
||||
|
|
@ -48,8 +47,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
|
|||
|
||||
}
|
||||
else if (event == LV_EVENT_RELEASED) {
|
||||
lv_clear_wifi_settings();
|
||||
draw_return_ui();
|
||||
lv_clear_wifi_settings();
|
||||
draw_return_ui();
|
||||
}
|
||||
break;
|
||||
case ID_WIFI_MODEL:
|
||||
|
|
@ -57,18 +56,18 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
|
|||
|
||||
}
|
||||
else if (event == LV_EVENT_RELEASED) {
|
||||
if (gCfgItems.wifi_mode_sel == AP_MODEL) {
|
||||
gCfgItems.wifi_mode_sel = STA_MODEL;
|
||||
lv_label_set_text(labelModelValue, WIFI_STA_TEXT);
|
||||
lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER,0, 0);
|
||||
update_spi_flash();
|
||||
}
|
||||
else{
|
||||
gCfgItems.wifi_mode_sel = AP_MODEL;
|
||||
lv_label_set_text(labelModelValue, WIFI_AP_TEXT);
|
||||
lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER,0, 0);
|
||||
update_spi_flash();
|
||||
}
|
||||
if (gCfgItems.wifi_mode_sel == AP_MODEL) {
|
||||
gCfgItems.wifi_mode_sel = STA_MODEL;
|
||||
lv_label_set_text(labelModelValue, WIFI_STA_TEXT);
|
||||
lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER,0, 0);
|
||||
update_spi_flash();
|
||||
}
|
||||
else {
|
||||
gCfgItems.wifi_mode_sel = AP_MODEL;
|
||||
lv_label_set_text(labelModelValue, WIFI_AP_TEXT);
|
||||
lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER,0, 0);
|
||||
update_spi_flash();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ID_WIFI_NAME:
|
||||
|
|
@ -76,9 +75,9 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
|
|||
|
||||
}
|
||||
else if (event == LV_EVENT_RELEASED) {
|
||||
keyboard_value=wifiName;
|
||||
lv_clear_wifi_settings();
|
||||
lv_draw_keyboard();
|
||||
keyboard_value = wifiName;
|
||||
lv_clear_wifi_settings();
|
||||
lv_draw_keyboard();
|
||||
}
|
||||
break;
|
||||
case ID_WIFI_PASSWORD:
|
||||
|
|
@ -87,8 +86,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
|
|||
}
|
||||
else if (event == LV_EVENT_RELEASED) {
|
||||
keyboard_value=wifiPassWord;
|
||||
lv_clear_wifi_settings();
|
||||
lv_draw_keyboard();
|
||||
lv_clear_wifi_settings();
|
||||
lv_draw_keyboard();
|
||||
}
|
||||
break;
|
||||
case ID_WIFI_CLOUD:
|
||||
|
|
@ -115,8 +114,8 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
|
|||
|
||||
}
|
||||
else if (event == LV_EVENT_RELEASED) {
|
||||
lv_clear_wifi_settings();
|
||||
lv_draw_dialog(DIALOG_WIFI_CONFIG_TIPS);
|
||||
lv_clear_wifi_settings();
|
||||
lv_draw_dialog(DIALOG_WIFI_CONFIG_TIPS);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -211,7 +210,7 @@ void lv_draw_wifi_settings(void) {
|
|||
lv_imgbtn_set_src(buttonCloudValue, LV_BTN_STATE_REL, "F:/bmp_disable.bin");
|
||||
lv_imgbtn_set_src(buttonCloudValue, LV_BTN_STATE_PR, "F:/bmp_disable.bin");
|
||||
}
|
||||
lv_obj_set_event_cb_mks(buttonCloudValue, event_handler,ID_WIFI_CLOUD, NULL,0);
|
||||
lv_obj_set_event_cb_mks(buttonCloudValue, event_handler,ID_WIFI_CLOUD, NULL,0);
|
||||
lv_imgbtn_set_style(buttonCloudValue, LV_BTN_STATE_PR, &tft_style_label_pre);
|
||||
lv_imgbtn_set_style(buttonCloudValue, LV_BTN_STATE_REL, &tft_style_label_rel);
|
||||
lv_btn_set_layout(buttonCloudValue, LV_LAYOUT_OFF);
|
||||
|
|
@ -240,7 +239,7 @@ void lv_draw_wifi_settings(void) {
|
|||
lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF);
|
||||
label_Back = lv_label_create(buttonBack, NULL);
|
||||
|
||||
if (gCfgItems.multiple_language !=0) {
|
||||
if (gCfgItems.multiple_language) {
|
||||
if (gCfgItems.wifi_mode_sel == AP_MODEL) {
|
||||
lv_label_set_text(labelModelValue, WIFI_AP_TEXT);
|
||||
lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER,0, 0);
|
||||
|
|
@ -295,5 +294,4 @@ void lv_clear_wifi_settings() {
|
|||
}
|
||||
|
||||
#endif // USE_WIFI_FUNCTION
|
||||
|
||||
#endif // HAS_TFT_LVGL_UI
|
||||
|
|
|
|||
|
|
@ -23,13 +23,12 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
#include "tft_lvgl_configuration.h"
|
||||
|
||||
#if ENABLED(USE_WIFI_FUNCTION)
|
||||
|
||||
#include "../../../../../Configuration.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "draw_ui.h"
|
||||
|
||||
static lv_obj_t * scr;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,10 +23,11 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "draw_ui.h"
|
||||
#include "tft_lvgl_configuration.h"
|
||||
|
||||
#if ENABLED(USE_WIFI_FUNCTION)
|
||||
|
||||
#include "draw_ui.h"
|
||||
#include "wifiSerial.h"
|
||||
|
||||
#include <libmaple/libmaple.h>
|
||||
|
|
|
|||
|
|
@ -206,11 +206,11 @@ static const char assets[][LONG_FILENAME_LENGTH] = {
|
|||
"bmp_return.bin",
|
||||
|
||||
#if ENABLED(USE_WIFI_FUNCTION)
|
||||
//wifi screen
|
||||
// wifi screen
|
||||
"bmp_wifi.bin",
|
||||
#endif
|
||||
|
||||
//babystep screen
|
||||
// babystep screen
|
||||
"bmp_baby_move0_01.bin",
|
||||
"bmp_baby_move0_05.bin",
|
||||
"bmp_baby_move0_1.bin"
|
||||
|
|
|
|||
|
|
@ -23,24 +23,22 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "../../../../MarlinCore.h"
|
||||
|
||||
#include "lv_conf.h"
|
||||
#include "draw_ui.h"
|
||||
#include <lv_conf.h>
|
||||
|
||||
#include "../../../../gcode/gcode.h"
|
||||
#include "../../../../module/temperature.h"
|
||||
#include "../../../../module/planner.h"
|
||||
#include "../../../../module/motion.h"
|
||||
#include "../../../../sd/cardreader.h"
|
||||
#include "../../../../gcode/queue.h"
|
||||
#include "../../../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
#include "../../../../feature/powerloss.h"
|
||||
#endif
|
||||
|
||||
#include "../../../../gcode/gcode.h"
|
||||
#include "../../../../module/planner.h"
|
||||
|
||||
extern uint32_t To_pre_view;
|
||||
extern uint8_t flash_preview_begin, default_preview_flg, gcode_preview_over;
|
||||
extern bool flash_preview_begin, default_preview_flg, gcode_preview_over;
|
||||
|
||||
void printer_state_polling() {
|
||||
if (uiCfg.print_state == PAUSING) {
|
||||
|
|
@ -76,7 +74,7 @@ void printer_state_polling() {
|
|||
// #if ENABLED(POWER_LOSS_RECOVERY)
|
||||
// if (recovery.enabled) recovery.save(true);
|
||||
// #endif
|
||||
gCfgItems.pause_reprint = 1;
|
||||
gCfgItems.pause_reprint = true;
|
||||
update_spi_flash();
|
||||
}
|
||||
#endif
|
||||
|
|
@ -105,7 +103,7 @@ void printer_state_polling() {
|
|||
uiCfg.print_state = WORKING;
|
||||
start_print_time();
|
||||
|
||||
gCfgItems.pause_reprint = 0;
|
||||
gCfgItems.pause_reprint = false;
|
||||
update_spi_flash();
|
||||
}
|
||||
}
|
||||
|
|
@ -137,7 +135,7 @@ void printer_state_polling() {
|
|||
);
|
||||
gcode.process_subcommands_now(public_buf_m);
|
||||
|
||||
if ((gCfgItems.pause_reprint) == 1 && (gCfgItems.pausePosZ != (float)-1)) {
|
||||
if (gCfgItems.pause_reprint && gCfgItems.pausePosZ != -1.0f) {
|
||||
gcode.process_subcommands_now_P(PSTR("G91"));
|
||||
ZERO(public_buf_l);
|
||||
sprintf_P(public_buf_l, PSTR("G1 Z-%.1f"), gCfgItems.pausePosZ);
|
||||
|
|
@ -148,7 +146,7 @@ void printer_state_polling() {
|
|||
uiCfg.print_state = WORKING;
|
||||
start_print_time();
|
||||
|
||||
gCfgItems.pause_reprint = 0;
|
||||
gCfgItems.pause_reprint = false;
|
||||
update_spi_flash();
|
||||
}
|
||||
#endif
|
||||
|
|
@ -240,10 +238,10 @@ void filament_check() {
|
|||
stop_print_time();
|
||||
uiCfg.print_state = PAUSING;
|
||||
|
||||
if (gCfgItems.from_flash_pic == 1)
|
||||
flash_preview_begin = 1;
|
||||
if (gCfgItems.from_flash_pic)
|
||||
flash_preview_begin = true;
|
||||
else
|
||||
default_preview_flg = 1;
|
||||
default_preview_flg = true;
|
||||
|
||||
lv_draw_printing();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ lv_group_t* g;
|
|||
uint16_t DeviceCode = 0x9488;
|
||||
extern uint8_t sel_id;
|
||||
|
||||
extern uint8_t gcode_preview_over, flash_preview_begin, default_preview_flg;
|
||||
extern bool flash_preview_begin, default_preview_flg, gcode_preview_over;
|
||||
|
||||
uint8_t bmp_public_buf[17 * 1024];
|
||||
|
||||
|
|
@ -80,9 +80,8 @@ void SysTick_Callback() {
|
|||
lv_tick_inc(1);
|
||||
print_time_count();
|
||||
#if ENABLED(USE_WIFI_FUNCTION)
|
||||
if (tips_disp.timer == TIPS_TIMER_START) {
|
||||
if (tips_disp.timer == TIPS_TIMER_START)
|
||||
tips_disp.timer_count++;
|
||||
}
|
||||
#endif
|
||||
if (uiCfg.filament_loading_time_flg == 1) {
|
||||
uiCfg.filament_loading_time_cnt++;
|
||||
|
|
@ -193,10 +192,10 @@ void tft_lvgl_init() {
|
|||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
recovery.load();
|
||||
if (recovery.valid()) {
|
||||
if (gCfgItems.from_flash_pic == 1)
|
||||
flash_preview_begin = 1;
|
||||
if (gCfgItems.from_flash_pic)
|
||||
flash_preview_begin = true;
|
||||
else
|
||||
default_preview_flg = 1;
|
||||
default_preview_flg = true;
|
||||
|
||||
uiCfg.print_state = REPRINTING;
|
||||
|
||||
|
|
@ -408,36 +407,32 @@ lv_fs_res_t sd_tell_cb(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) {
|
|||
}
|
||||
|
||||
void lv_encoder_pin_init() {
|
||||
#if 1 // HAS_DIGITAL_BUTTONS
|
||||
#if BUTTON_EXISTS(EN1)
|
||||
SET_INPUT_PULLUP(BTN_EN1);
|
||||
#endif
|
||||
#if BUTTON_EXISTS(EN2)
|
||||
SET_INPUT_PULLUP(BTN_EN2);
|
||||
#endif
|
||||
#if BUTTON_EXISTS(ENC)
|
||||
SET_INPUT_PULLUP(BTN_ENC);
|
||||
#endif
|
||||
|
||||
#if BUTTON_EXISTS(EN1)
|
||||
SET_INPUT_PULLUP(BTN_EN1);
|
||||
#endif
|
||||
#if BUTTON_EXISTS(EN2)
|
||||
SET_INPUT_PULLUP(BTN_EN2);
|
||||
#endif
|
||||
#if BUTTON_EXISTS(ENC)
|
||||
SET_INPUT_PULLUP(BTN_ENC);
|
||||
#endif
|
||||
#if BUTTON_EXISTS(BACK)
|
||||
SET_INPUT_PULLUP(BTN_BACK);
|
||||
#endif
|
||||
|
||||
#if BUTTON_EXISTS(BACK)
|
||||
SET_INPUT_PULLUP(BTN_BACK);
|
||||
#endif
|
||||
|
||||
#if BUTTON_EXISTS(UP)
|
||||
SET_INPUT(BTN_UP);
|
||||
#endif
|
||||
#if BUTTON_EXISTS(DWN)
|
||||
SET_INPUT(BTN_DWN);
|
||||
#endif
|
||||
#if BUTTON_EXISTS(LFT)
|
||||
SET_INPUT(BTN_LFT);
|
||||
#endif
|
||||
#if BUTTON_EXISTS(RT)
|
||||
SET_INPUT(BTN_RT);
|
||||
#endif
|
||||
|
||||
#endif // HAS_DIGITAL_BUTTONS
|
||||
#if BUTTON_EXISTS(UP)
|
||||
SET_INPUT(BTN_UP);
|
||||
#endif
|
||||
#if BUTTON_EXISTS(DWN)
|
||||
SET_INPUT(BTN_DWN);
|
||||
#endif
|
||||
#if BUTTON_EXISTS(LFT)
|
||||
SET_INPUT(BTN_LFT);
|
||||
#endif
|
||||
#if BUTTON_EXISTS(RT)
|
||||
SET_INPUT(BTN_RT);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 1 // HAS_ENCODER_ACTION
|
||||
|
|
|
|||
|
|
@ -23,11 +23,13 @@
|
|||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
|
||||
#include "draw_ui.h"
|
||||
#include "wifiSerial.h"
|
||||
#include "tft_lvgl_configuration.h"
|
||||
|
||||
#if ENABLED(USE_WIFI_FUNCTION)
|
||||
|
||||
#include "draw_ui.h"
|
||||
#include "wifiSerial.h"
|
||||
|
||||
#include <libmaple/libmaple.h>
|
||||
#include <libmaple/gpio.h>
|
||||
#include <libmaple/timer.h>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -150,8 +150,20 @@
|
|||
#include "../lcd/tft/touch.h"
|
||||
#endif
|
||||
|
||||
#if HAS_ETHERNET
|
||||
#include "../feature/ethernet.h"
|
||||
#endif
|
||||
|
||||
#pragma pack(push, 1) // No padding between variables
|
||||
|
||||
#if HAS_ETHERNET
|
||||
void ETH0_report();
|
||||
void MAC_report();
|
||||
void M552_report();
|
||||
void M553_report();
|
||||
void M554_report();
|
||||
#endif
|
||||
|
||||
typedef struct { uint16_t X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5, E6, E7; } tmc_stepper_current_t;
|
||||
typedef struct { uint32_t X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5, E6, E7; } tmc_hybrid_threshold_t;
|
||||
typedef struct { int16_t X, Y, Z, X2, Y2, Z2, Z3, Z4; } tmc_sgt_t;
|
||||
|
|
@ -431,6 +443,15 @@ typedef struct SettingsDataStruct {
|
|||
touch_calibration_t touch_calibration;
|
||||
#endif
|
||||
|
||||
// Ethernet settings
|
||||
#if HAS_ETHERNET
|
||||
bool ethernet_hardware_enabled; // M552 S
|
||||
uint32_t ethernet_ip, // M552 P
|
||||
ethernet_dns,
|
||||
ethernet_gateway, // M553 P
|
||||
ethernet_subnet; // M554 P
|
||||
#endif
|
||||
|
||||
} SettingsData;
|
||||
|
||||
//static_assert(sizeof(SettingsData) <= MARLIN_EEPROM_SIZE, "EEPROM too small to contain SettingsData!");
|
||||
|
|
@ -1384,7 +1405,26 @@ void MarlinSettings::postprocess() {
|
|||
#endif
|
||||
|
||||
//
|
||||
// Validate CRC and Data Size
|
||||
// Ethernet network info
|
||||
//
|
||||
#if HAS_ETHERNET
|
||||
{
|
||||
_FIELD_TEST(ethernet_hardware_enabled);
|
||||
const bool ethernet_hardware_enabled = ethernet.hardware_enabled;
|
||||
const uint32_t ethernet_ip = ethernet.ip,
|
||||
ethernet_dns = ethernet.myDns,
|
||||
ethernet_gateway = ethernet.gateway,
|
||||
ethernet_subnet = ethernet.subnet;
|
||||
EEPROM_WRITE(ethernet_hardware_enabled);
|
||||
EEPROM_WRITE(ethernet_ip);
|
||||
EEPROM_WRITE(ethernet_dns);
|
||||
EEPROM_WRITE(ethernet_gateway);
|
||||
EEPROM_WRITE(ethernet_subnet);
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Report final CRC and Data Size
|
||||
//
|
||||
if (!eeprom_error) {
|
||||
const uint16_t eeprom_size = eeprom_index - (EEPROM_OFFSET),
|
||||
|
|
@ -2241,6 +2281,22 @@ void MarlinSettings::postprocess() {
|
|||
EEPROM_READ(touch.calibration);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Ethernet network info
|
||||
//
|
||||
#if HAS_ETHERNET
|
||||
_FIELD_TEST(ethernet_hardware_enabled);
|
||||
uint32_t ethernet_ip, ethernet_dns, ethernet_gateway, ethernet_subnet;
|
||||
EEPROM_READ(ethernet.hardware_enabled);
|
||||
EEPROM_READ(ethernet_ip); ethernet.ip = ethernet_ip;
|
||||
EEPROM_READ(ethernet_dns); ethernet.myDns = ethernet_dns;
|
||||
EEPROM_READ(ethernet_gateway); ethernet.gateway = ethernet_gateway;
|
||||
EEPROM_READ(ethernet_subnet); ethernet.subnet = ethernet_subnet;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Validate Final Size and CRC
|
||||
//
|
||||
eeprom_error = size_error(eeprom_index - (EEPROM_OFFSET));
|
||||
if (eeprom_error) {
|
||||
DEBUG_ECHO_START();
|
||||
|
|
@ -2296,7 +2352,7 @@ void MarlinSettings::postprocess() {
|
|||
|
||||
#if ENABLED(EEPROM_CHITCHAT) && DISABLED(DISABLE_M503)
|
||||
// Report the EEPROM settings
|
||||
if (!validating && (DISABLED(EEPROM_BOOT_SILENT) || IsRunning())) report();
|
||||
if (!validating && TERN1(EEPROM_BOOT_SILENT, IsRunning())) report();
|
||||
#endif
|
||||
|
||||
EEPROM_FINISH();
|
||||
|
|
@ -3784,6 +3840,15 @@ void MarlinSettings::reset() {
|
|||
#endif
|
||||
);
|
||||
#endif
|
||||
|
||||
#if HAS_ETHERNET
|
||||
CONFIG_ECHO_HEADING("Ethernet:");
|
||||
if (!forReplay) { CONFIG_ECHO_START(); ETH0_report(); }
|
||||
CONFIG_ECHO_START(); SERIAL_ECHO_SP(2); MAC_report();
|
||||
CONFIG_ECHO_START(); SERIAL_ECHO_SP(2); M552_report();
|
||||
CONFIG_ECHO_START(); SERIAL_ECHO_SP(2); M553_report();
|
||||
CONFIG_ECHO_START(); SERIAL_ECHO_SP(2); M554_report();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // !DISABLE_M503
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
#include <SPI.h>
|
||||
|
||||
enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E };
|
||||
#define TMC_INIT(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, stealthchop_by_axis[STEALTH_INDEX], chopper_timing_##ST)
|
||||
#define TMC_INIT(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, stealthchop_by_axis[STEALTH_INDEX], chopper_timing_##ST, ST##_INTERPOLATE)
|
||||
|
||||
// IC = TMC model number
|
||||
// ST = Stepper object letter
|
||||
|
|
@ -131,13 +131,13 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E };
|
|||
|
||||
#if HAS_DRIVER(TMC2130)
|
||||
template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
|
||||
void tmc_init(TMCMarlin<TMC2130Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) {
|
||||
void tmc_init(TMCMarlin<TMC2130Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) {
|
||||
st.begin();
|
||||
|
||||
CHOPCONF_t chopconf{0};
|
||||
chopconf.tbl = 0b01;
|
||||
chopconf.toff = chop_init.toff;
|
||||
chopconf.intpol = INTERPOLATE;
|
||||
chopconf.intpol = interpolate;
|
||||
chopconf.hend = chop_init.hend + 3;
|
||||
chopconf.hstrt = chop_init.hstrt - 1;
|
||||
TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true);
|
||||
|
|
@ -166,13 +166,13 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E };
|
|||
|
||||
#if HAS_DRIVER(TMC2160)
|
||||
template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
|
||||
void tmc_init(TMCMarlin<TMC2160Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) {
|
||||
void tmc_init(TMCMarlin<TMC2160Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) {
|
||||
st.begin();
|
||||
|
||||
CHOPCONF_t chopconf{0};
|
||||
chopconf.tbl = 0b01;
|
||||
chopconf.toff = chop_init.toff;
|
||||
chopconf.intpol = INTERPOLATE;
|
||||
chopconf.intpol = interpolate;
|
||||
chopconf.hend = chop_init.hend + 3;
|
||||
chopconf.hstrt = chop_init.hstrt - 1;
|
||||
TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true);
|
||||
|
|
@ -484,7 +484,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E };
|
|||
|
||||
#if HAS_DRIVER(TMC2208)
|
||||
template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
|
||||
void tmc_init(TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) {
|
||||
void tmc_init(TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) {
|
||||
TMC2208_n::GCONF_t gconf{0};
|
||||
gconf.pdn_disable = true; // Use UART
|
||||
gconf.mstep_reg_select = true; // Select microsteps with UART
|
||||
|
|
@ -496,7 +496,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E };
|
|||
TMC2208_n::CHOPCONF_t chopconf{0};
|
||||
chopconf.tbl = 0b01; // blank_time = 24
|
||||
chopconf.toff = chop_init.toff;
|
||||
chopconf.intpol = INTERPOLATE;
|
||||
chopconf.intpol = interpolate;
|
||||
chopconf.hend = chop_init.hend + 3;
|
||||
chopconf.hstrt = chop_init.hstrt - 1;
|
||||
TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true);
|
||||
|
|
@ -526,7 +526,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E };
|
|||
|
||||
#if HAS_DRIVER(TMC2209)
|
||||
template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
|
||||
void tmc_init(TMCMarlin<TMC2209Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) {
|
||||
void tmc_init(TMCMarlin<TMC2209Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) {
|
||||
TMC2208_n::GCONF_t gconf{0};
|
||||
gconf.pdn_disable = true; // Use UART
|
||||
gconf.mstep_reg_select = true; // Select microsteps with UART
|
||||
|
|
@ -538,7 +538,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E };
|
|||
TMC2208_n::CHOPCONF_t chopconf{0};
|
||||
chopconf.tbl = 0b01; // blank_time = 24
|
||||
chopconf.toff = chop_init.toff;
|
||||
chopconf.intpol = INTERPOLATE;
|
||||
chopconf.intpol = interpolate;
|
||||
chopconf.hend = chop_init.hend + 3;
|
||||
chopconf.hstrt = chop_init.hstrt - 1;
|
||||
TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true);
|
||||
|
|
@ -568,7 +568,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E };
|
|||
|
||||
#if HAS_DRIVER(TMC2660)
|
||||
template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
|
||||
void tmc_init(TMCMarlin<TMC2660Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t, const bool, const chopper_timing_t &chop_init) {
|
||||
void tmc_init(TMCMarlin<TMC2660Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t, const bool, const chopper_timing_t &chop_init, const bool interpolate) {
|
||||
st.begin();
|
||||
|
||||
TMC2660_n::CHOPCONF_t chopconf{0};
|
||||
|
|
@ -582,7 +582,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E };
|
|||
st.rms_current(mA);
|
||||
st.microsteps(microsteps);
|
||||
TERN_(SQUARE_WAVE_STEPPING, st.dedge(true));
|
||||
st.intpol(INTERPOLATE);
|
||||
st.intpol(interpolate);
|
||||
st.diss2g(true); // Disable short to ground protection. Too many false readings?
|
||||
TERN_(TMC_DEBUG, st.rdsel(0b01));
|
||||
}
|
||||
|
|
@ -590,13 +590,13 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E };
|
|||
|
||||
#if HAS_DRIVER(TMC5130)
|
||||
template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
|
||||
void tmc_init(TMCMarlin<TMC5130Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) {
|
||||
void tmc_init(TMCMarlin<TMC5130Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) {
|
||||
st.begin();
|
||||
|
||||
CHOPCONF_t chopconf{0};
|
||||
chopconf.tbl = 0b01;
|
||||
chopconf.toff = chop_init.toff;
|
||||
chopconf.intpol = INTERPOLATE;
|
||||
chopconf.intpol = interpolate;
|
||||
chopconf.hend = chop_init.hend + 3;
|
||||
chopconf.hstrt = chop_init.hstrt - 1;
|
||||
TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true);
|
||||
|
|
@ -625,13 +625,13 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E };
|
|||
|
||||
#if HAS_DRIVER(TMC5160)
|
||||
template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
|
||||
void tmc_init(TMCMarlin<TMC5160Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init) {
|
||||
void tmc_init(TMCMarlin<TMC5160Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t hyb_thrs, const bool stealth, const chopper_timing_t &chop_init, const bool interpolate) {
|
||||
st.begin();
|
||||
|
||||
CHOPCONF_t chopconf{0};
|
||||
chopconf.tbl = 0b01;
|
||||
chopconf.toff = chop_init.toff;
|
||||
chopconf.intpol = INTERPOLATE;
|
||||
chopconf.intpol = interpolate;
|
||||
chopconf.hend = chop_init.hend + 3;
|
||||
chopconf.hstrt = chop_init.hstrt - 1;
|
||||
TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true);
|
||||
|
|
|
|||
|
|
@ -42,30 +42,30 @@
|
|||
//
|
||||
// Limit Switches
|
||||
//
|
||||
#define X_MIN_PIN 34
|
||||
#define Y_MIN_PIN 35
|
||||
#define Z_MIN_PIN 16 // 15
|
||||
#define X_STOP_PIN 34
|
||||
#define Y_STOP_PIN 35
|
||||
#define Z_STOP_PIN 16
|
||||
|
||||
//
|
||||
// Steppers
|
||||
//
|
||||
#define X_STEP_PIN 12 // 34//27
|
||||
#define X_DIR_PIN 13 // 35//26
|
||||
#define X_ENABLE_PIN 17 // 0//17//25 // used free pin
|
||||
#define X_STEP_PIN 12
|
||||
#define X_DIR_PIN 13
|
||||
#define X_ENABLE_PIN 17
|
||||
//#define X_CS_PIN 0
|
||||
|
||||
#define Y_STEP_PIN 32 // 33
|
||||
#define Y_DIR_PIN 33 // 32
|
||||
#define Y_STEP_PIN 32
|
||||
#define Y_DIR_PIN 33
|
||||
#define Y_ENABLE_PIN X_ENABLE_PIN
|
||||
//#define Y_CS_PIN 13
|
||||
|
||||
#define Z_STEP_PIN 25 // 14
|
||||
#define Z_DIR_PIN 26 // 12
|
||||
#define Z_STEP_PIN 25
|
||||
#define Z_DIR_PIN 26
|
||||
#define Z_ENABLE_PIN X_ENABLE_PIN
|
||||
//#define Z_CS_PIN 5 // SS_PIN
|
||||
|
||||
#define E0_STEP_PIN 27 // 16
|
||||
#define E0_DIR_PIN 14 // 17
|
||||
#define E0_STEP_PIN 27
|
||||
#define E0_DIR_PIN 14
|
||||
#define E0_ENABLE_PIN X_ENABLE_PIN
|
||||
//#define E0_CS_PIN 21
|
||||
|
||||
|
|
@ -78,9 +78,9 @@
|
|||
//
|
||||
// Heaters / Fans
|
||||
//
|
||||
#define HEATER_0_PIN 2 // 4//2//(D8)
|
||||
#define FAN_PIN 0 // 2//15//13 (D9)
|
||||
#define HEATER_BED_PIN 15 // 15//0 //(D10)
|
||||
#define HEATER_0_PIN 2
|
||||
#define FAN_PIN 0
|
||||
#define HEATER_BED_PIN 15
|
||||
|
||||
// SPI
|
||||
#define SDSS 5
|
||||
|
|
|
|||
|
|
@ -42,12 +42,10 @@
|
|||
//
|
||||
// Disable I2S stepper stream
|
||||
//
|
||||
#ifdef I2S_STEPPER_STREAM
|
||||
#undef I2S_STEPPER_STREAM
|
||||
#endif
|
||||
#define I2S_WS -1
|
||||
#define I2S_BCK -1
|
||||
#define I2S_DATA -1
|
||||
#undef I2S_STEPPER_STREAM
|
||||
#undef I2S_WS
|
||||
#undef I2S_BCK
|
||||
#undef I2S_DATA
|
||||
|
||||
//
|
||||
// Limit Switches
|
||||
|
|
|
|||
|
|
@ -52,12 +52,10 @@
|
|||
//
|
||||
#undef I2S_STEPPER_STREAM
|
||||
#define I2S_STEPPER_STREAM
|
||||
|
||||
#undef LIN_ADVANCE // Currently, I2S stream does not work with linear advance
|
||||
|
||||
#define I2S_WS 26
|
||||
#define I2S_BCK 25
|
||||
#define I2S_DATA 27
|
||||
#undef LIN_ADVANCE // Currently, I2S stream does not work with linear advance
|
||||
|
||||
//
|
||||
// Steppers
|
||||
|
|
|
|||
|
|
@ -207,6 +207,12 @@
|
|||
#include "ramps/pins_TENLOG_D3_HERO.h" // ATmega2560 env:mega2560
|
||||
#elif MB(MKS_GEN_L_V21)
|
||||
#include "ramps/pins_MKS_GEN_L_V21.h" // ATmega2560 env:mega2560
|
||||
#elif MB(RAMPS_S_12_EEFB)
|
||||
#include "ramps/pins_RAMPS_S_12.h" // ATmega2560 env:mega2560
|
||||
#elif MB(RAMPS_S_12_EEEB)
|
||||
#include "ramps/pins_RAMPS_S_12.h" // ATmega2560 env:mega2560
|
||||
#elif MB(RAMPS_S_12_EFFB)
|
||||
#include "ramps/pins_RAMPS_S_12.h" // ATmega2560 env:mega2560
|
||||
|
||||
//
|
||||
// RAMBo and derivatives
|
||||
|
|
@ -547,6 +553,8 @@
|
|||
#include "stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h" // STM32F1 env:STM32F103RC_btt env:STM32F103RC_btt_512K env:STM32F103RC_btt_USB env:STM32F103RC_btt_512K_USB
|
||||
#elif MB(BTT_SKR_MINI_E3_V2_0)
|
||||
#include "stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h" // STM32F1 env:STM32F103RC_btt env:STM32F103RC_btt_512K env:STM32F103RC_btt_USB env:STM32F103RC_btt_512K_USB
|
||||
#elif MB(BTT_SKR_MINI_MZ_V1_0)
|
||||
#include "stm32f1/pins_BTT_SKR_MINI_MZ_V1_0.h" // STM32F1 env:STM32F103RC_btt env:STM32F103RC_btt_512K env:STM32F103RC_btt_USB env:STM32F103RC_btt_512K_USB
|
||||
#elif MB(BTT_SKR_E3_DIP)
|
||||
#include "stm32f1/pins_BTT_SKR_E3_DIP.h" // STM32F1 env:STM32F103RE_btt env:STM32F103RE_btt_USB env:STM32F103RC_btt env:STM32F103RC_btt_512K env:STM32F103RC_btt_USB env:STM32F103RC_btt_512K_USB
|
||||
#elif MB(JGAURORA_A5S_A1)
|
||||
|
|
@ -573,6 +581,8 @@
|
|||
#include "stm32f1/pins_TRIGORILLA_PRO.h" // STM32F1 env:trigorilla_pro
|
||||
#elif MB(FLY_MINI)
|
||||
#include "stm32f1/pins_FLY_MINI.h" // STM32F1 env:FLY_MINI
|
||||
#elif MB(FLSUN_HISPEED)
|
||||
#include "stm32f1/pins_FLSUN_HISPEED.h" // STM32F1 env:flsun_hispeed
|
||||
|
||||
//
|
||||
// ARM Cortex-M4F
|
||||
|
|
@ -666,6 +676,7 @@
|
|||
//
|
||||
// Custom board (with custom PIO env)
|
||||
//
|
||||
|
||||
#elif MB(CUSTOM)
|
||||
#include "pins_custom.h" // env:custom
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
#endif
|
||||
|
||||
#if NOT_TARGET(IS_RAMPS_SMART, IS_RAMPS_DUO, IS_RAMPS4DUE, TARGET_LPC1768, __AVR_ATmega1280__, __AVR_ATmega2560__)
|
||||
#error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
|
||||
#error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' (or other appropriate target) in 'Tools > Board.'"
|
||||
#endif
|
||||
|
||||
// Custom flags and defines for the build
|
||||
|
|
|
|||
275
Marlin/src/pins/ramps/pins_RAMPS_S_12.h
Normal file
275
Marlin/src/pins/ramps/pins_RAMPS_S_12.h
Normal file
|
|
@ -0,0 +1,275 @@
|
|||
/**
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* Arduino Mega with RAMPS-S v1.2 by Sakul.cz pin assignments
|
||||
* Written by Michal Rábek <rabek33@gmail.com>
|
||||
*
|
||||
* Applies to the following boards:
|
||||
*
|
||||
* BOARD_RAMPS_S_12_EEFB Ramps S 1.2 (Hotend0, Hotend1, Fan, Bed)
|
||||
* BOARD_RAMPS_S_12_EEEB Ramps S 1.2 (Hotend0, Hotend1, Hotend2, Bed)
|
||||
* BOARD_RAMPS_S_12_EFFB Ramps S 1.2 (Hotend, Fan0, Fan1, Bed)
|
||||
*
|
||||
* Other pins_MYBOARD.h files may override these defaults
|
||||
*/
|
||||
|
||||
#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
|
||||
#error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
|
||||
#endif
|
||||
|
||||
// Custom flags and defines for the build
|
||||
//#define BOARD_CUSTOM_BUILD_FLAGS -D__FOO__
|
||||
|
||||
#ifndef BOARD_INFO_NAME
|
||||
#define BOARD_INFO_NAME "RAMPS S 1.2"
|
||||
#endif
|
||||
|
||||
//
|
||||
// Servos
|
||||
//
|
||||
#ifndef SERVO0_PIN
|
||||
#define SERVO0_PIN 10
|
||||
#endif
|
||||
#ifndef SERVO1_PIN
|
||||
#define SERVO1_PIN 11
|
||||
#endif
|
||||
#ifndef SERVO2_PIN
|
||||
#define SERVO2_PIN 12
|
||||
#endif
|
||||
#ifndef SERVO3_PIN
|
||||
#define SERVO3_PIN 44
|
||||
#endif
|
||||
|
||||
//
|
||||
// Limit Switches
|
||||
//
|
||||
#ifndef X_STOP_PIN
|
||||
#ifndef X_MIN_PIN
|
||||
#define X_MIN_PIN 37
|
||||
#endif
|
||||
#ifndef X_MAX_PIN
|
||||
#define X_MAX_PIN 36
|
||||
#endif
|
||||
#endif
|
||||
#ifndef Y_STOP_PIN
|
||||
#ifndef Y_MIN_PIN
|
||||
#define Y_MIN_PIN 35
|
||||
#endif
|
||||
#ifndef Y_MAX_PIN
|
||||
#define Y_MAX_PIN 34
|
||||
#endif
|
||||
#endif
|
||||
#ifndef Z_STOP_PIN
|
||||
#ifndef Z_MIN_PIN
|
||||
#define Z_MIN_PIN 33
|
||||
#endif
|
||||
#ifndef Z_MAX_PIN
|
||||
#define Z_MAX_PIN 32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Z Probe (when not Z_MIN_PIN)
|
||||
//
|
||||
#ifndef Z_MIN_PROBE_PIN
|
||||
#define Z_MIN_PROBE_PIN 5
|
||||
#endif
|
||||
|
||||
//
|
||||
// Filament Runout Sensor
|
||||
//
|
||||
#ifndef FIL_RUNOUT_PIN
|
||||
#define FIL_RUNOUT_PIN 44 // RAMPS_S S3 on the servos connector
|
||||
#endif
|
||||
|
||||
//
|
||||
// Steppers
|
||||
//
|
||||
#define X_STEP_PIN 17
|
||||
#define X_DIR_PIN 16
|
||||
#define X_ENABLE_PIN 48
|
||||
|
||||
#define Y_STEP_PIN 54
|
||||
#define Y_DIR_PIN 47
|
||||
#define Y_ENABLE_PIN 55
|
||||
|
||||
#ifndef Z_STEP_PIN
|
||||
#define Z_STEP_PIN 57
|
||||
#endif
|
||||
#define Z_DIR_PIN 56
|
||||
#define Z_ENABLE_PIN 62
|
||||
|
||||
#define E0_STEP_PIN 23
|
||||
#define E0_DIR_PIN 22
|
||||
#define E0_ENABLE_PIN 24
|
||||
|
||||
#define E1_STEP_PIN 26
|
||||
#define E1_DIR_PIN 25
|
||||
#define E1_ENABLE_PIN 27
|
||||
|
||||
#define E2_STEP_PIN 29
|
||||
#define E2_DIR_PIN 28
|
||||
#define E2_ENABLE_PIN 39
|
||||
|
||||
//
|
||||
// Temperature Sensors
|
||||
//
|
||||
#ifndef TEMP_0_PIN
|
||||
#define TEMP_0_PIN 15 // Analog Input
|
||||
#endif
|
||||
#ifndef TEMP_1_PIN
|
||||
#define TEMP_1_PIN 14 // Analog Input
|
||||
#endif
|
||||
#ifndef TEMP_2_PIN
|
||||
#define TEMP_2_PIN 13 // Analog Input
|
||||
#endif
|
||||
#ifndef TEMP_3_PIN
|
||||
#define TEMP_3_PIN 12 // Analog Input
|
||||
#endif
|
||||
#ifndef TEMP_BED_PIN
|
||||
#define TEMP_BED_PIN 11 // Analog Input
|
||||
#endif
|
||||
|
||||
//
|
||||
// Heaters / Fans
|
||||
//
|
||||
#ifndef MOSFET_D_PIN
|
||||
#define MOSFET_D_PIN -1
|
||||
#endif
|
||||
#ifndef RAMPS_S_HE_0
|
||||
#define RAMPS_S_HE_0 2
|
||||
#endif
|
||||
#ifndef RAMPS_S_HE_1
|
||||
#define RAMPS_S_HE_1 3
|
||||
#endif
|
||||
#ifndef RAMPS_S_HE_2
|
||||
#define RAMPS_S_HE_2 6
|
||||
#endif
|
||||
|
||||
#define HEATER_BED_PIN 9
|
||||
|
||||
#define HEATER_0_PIN RAMPS_S_HE_0
|
||||
|
||||
#if MB(RAMPS_S_12_EEFB) // Hotend0, Hotend1, Fan, Bed
|
||||
#define HEATER_1_PIN RAMPS_S_HE_1
|
||||
#define FAN_PIN RAMPS_S_HE_2
|
||||
#elif MB(RAMPS_S_12_EEEB) // Hotend0, Hotend1, Hotend2, Bed
|
||||
#define HEATER_1_PIN RAMPS_S_HE_1
|
||||
#define HEATER_2_PIN RAMPS_S_HE_2
|
||||
#elif MB(RAMPS_S_12_EFFB) // Hotend, Fan0, Fan1, Bed
|
||||
#define FAN_PIN RAMPS_S_HE_1
|
||||
#define FAN1_PIN RAMPS_S_HE_2
|
||||
#endif
|
||||
|
||||
//
|
||||
// Misc. Functions
|
||||
//
|
||||
#define SDSS 53
|
||||
#define LED_PIN 13
|
||||
|
||||
#ifndef KILL_PIN
|
||||
#define KILL_PIN 46
|
||||
#endif
|
||||
|
||||
#ifndef FILWIDTH_PIN
|
||||
#define FILWIDTH_PIN 60 // Analog Input on EXTEND
|
||||
#endif
|
||||
|
||||
#ifndef PS_ON_PIN
|
||||
#define PS_ON_PIN 12 // RAMPS_S S2 on the servos connector
|
||||
#endif
|
||||
|
||||
#if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENA_PIN)
|
||||
#if NUM_SERVOS <= 1 // Prefer the servo connector
|
||||
#define CASE_LIGHT_PIN 12 // Hardware PWM (RAMPS_S S1 on the servos connector)
|
||||
#elif HAS_FREE_AUX2_PINS
|
||||
#define CASE_LIGHT_PIN 44 // Hardware PWM
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// M3/M4/M5 - Spindle/Laser Control
|
||||
//
|
||||
#if HAS_CUTTER && !defined(SPINDLE_LASER_ENA_PIN)
|
||||
#define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown!
|
||||
#define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM
|
||||
#define SPINDLE_DIR_PIN 5
|
||||
#endif
|
||||
|
||||
//
|
||||
// TMC software SPI
|
||||
//
|
||||
#if ENABLED(TMC_USE_SW_SPI)
|
||||
#ifndef TMC_SW_MOSI
|
||||
#define TMC_SW_MOSI 51
|
||||
#endif
|
||||
#ifndef TMC_SW_MISO
|
||||
#define TMC_SW_MISO 50
|
||||
#endif
|
||||
#ifndef TMC_SW_SCK
|
||||
#define TMC_SW_SCK 53
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Průša i3 MK2 Multiplexer Support
|
||||
//
|
||||
#ifndef E_MUX0_PIN
|
||||
#define E_MUX0_PIN 29 // E2_STEP_PIN
|
||||
#endif
|
||||
#ifndef E_MUX1_PIN
|
||||
#define E_MUX1_PIN 28 // E2_DIR_PIN
|
||||
#endif
|
||||
#ifndef E_MUX2_PIN
|
||||
#define E_MUX2_PIN 39 // E2_ENABLE_PIN
|
||||
#endif
|
||||
|
||||
//////////////////////////
|
||||
// LCDs and Controllers //
|
||||
//////////////////////////
|
||||
|
||||
//
|
||||
// LCD Display output pins
|
||||
//
|
||||
#if HAS_WIRED_LCD
|
||||
#define BEEPER_PIN 45
|
||||
#define LCD_PINS_RS 19
|
||||
#define LCD_PINS_ENABLE 49
|
||||
#define LCD_PINS_D4 18
|
||||
#define LCD_PINS_D5 30
|
||||
#define LCD_PINS_D6 41
|
||||
#define LCD_PINS_D7 31
|
||||
#ifndef SD_DETECT_PIN
|
||||
#define SD_DETECT_PIN 38
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// LCD Display input pins
|
||||
//
|
||||
#if IS_NEWPANEL
|
||||
#define BTN_EN1 40
|
||||
#define BTN_EN2 42
|
||||
#define BTN_ENC 43
|
||||
#endif
|
||||
|
|
@ -32,7 +32,9 @@
|
|||
|
||||
#include "pins_BTT_SKR_MINI_E3_common.h"
|
||||
|
||||
#define BOARD_INFO_NAME "BTT SKR Mini E3 V2.0"
|
||||
#ifndef BOARD_INFO_NAME
|
||||
#define BOARD_INFO_NAME "BTT SKR Mini E3 V2.0"
|
||||
#endif
|
||||
|
||||
// Release PA13/PA14 (led, usb control) from SWD pins
|
||||
#define DISABLE_DEBUG
|
||||
|
|
|
|||
26
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_MZ_V1_0.h
Normal file
26
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_MZ_V1_0.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#define BOARD_INFO_NAME "BTT SKR Mini MZ V1.0"
|
||||
|
||||
#include "pins_BTT_SKR_MINI_E3_V2_0.h"
|
||||
366
Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h
Normal file
366
Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h
Normal file
|
|
@ -0,0 +1,366 @@
|
|||
/**
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* FLSUN HiSpeed V1 (STM32F103VET6) board pin assignments
|
||||
* FLSun Hispeed (clone MKS_Robin_miniV2) board.
|
||||
*
|
||||
* MKS Robin Mini USB uses UART3 (PB10-TX, PB11-RX)
|
||||
* #define SERIAL_PORT_2 3
|
||||
*/
|
||||
|
||||
#if NOT_TARGET(__STM32F1__, STM32F1xx)
|
||||
#error "Oops! Select an STM32F1 board in 'Tools > Board.'"
|
||||
#elif HOTENDS > 1 || E_STEPPERS > 1
|
||||
#error "FLSUN HiSpeedV1 supports 1 hotend / E-stepper. Comment out this line to continue."
|
||||
#endif
|
||||
|
||||
#define BOARD_INFO_NAME "FLSun HiSpeedV1"
|
||||
#define BOARD_WEBSITE_URL "github.com/Foxies-CSTL"
|
||||
|
||||
//
|
||||
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
|
||||
//
|
||||
#define DISABLE_DEBUG
|
||||
|
||||
//
|
||||
// EEPROM
|
||||
//
|
||||
#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
|
||||
#define FLASH_EEPROM_EMULATION
|
||||
#define EEPROM_PAGE_SIZE (0x800U) // 2KB
|
||||
#define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
|
||||
#define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB
|
||||
#endif
|
||||
|
||||
// SPI
|
||||
// Note: FLSun Hispeed (clone MKS_Robin_miniV2) board is using SPI2 interface.
|
||||
//
|
||||
#define ENABLE_SPI2
|
||||
|
||||
// SPI Flash
|
||||
#define HAS_SPI_FLASH 1
|
||||
#define SPI_FLASH_SIZE 0x1000000 // 16MB
|
||||
|
||||
#if HAS_SPI_FLASH
|
||||
// SPI 2
|
||||
#define W25QXX_CS_PIN PB12 // SPI2_NSS / Flash chip-select
|
||||
#define W25QXX_MOSI_PIN PB15
|
||||
#define W25QXX_MISO_PIN PB14
|
||||
#define W25QXX_SCK_PIN PB13
|
||||
#endif
|
||||
|
||||
//
|
||||
// Servos
|
||||
//
|
||||
//#define SERVO0_PIN PA8 // use IO0 to enable BLTOUCH support/remove Mks_Wifi
|
||||
|
||||
//
|
||||
// Limit Switches
|
||||
//
|
||||
#define X_STOP_PIN PA15 // -X
|
||||
#define Y_STOP_PIN PA12 // -Y
|
||||
#define Z_MIN_PIN PA11 // -Z
|
||||
#define Z_MAX_PIN PC4 // +Z
|
||||
|
||||
#ifndef FIL_RUNOUT_PIN
|
||||
#define FIL_RUNOUT_PIN MT_DET_1_PIN
|
||||
#endif
|
||||
|
||||
//
|
||||
// Steppers
|
||||
//
|
||||
#define X_ENABLE_PIN PE4 // X_EN
|
||||
#define X_STEP_PIN PE3 // X_STEP
|
||||
#define X_DIR_PIN PE2 // X_DIR
|
||||
|
||||
#define Y_ENABLE_PIN PE1 // Y_EN
|
||||
#define Y_STEP_PIN PE0 // Y_STEP
|
||||
#define Y_DIR_PIN PB9 // Y_DIR
|
||||
|
||||
#define Z_ENABLE_PIN PB8 // Z_EN
|
||||
#define Z_STEP_PIN PB5 // Z_STEP
|
||||
#define Z_DIR_PIN PB4 // Z_DIR
|
||||
|
||||
#define E0_ENABLE_PIN PB3 // E0_EN
|
||||
#define E0_STEP_PIN PD6 // E0_STEP
|
||||
#define E0_DIR_PIN PD3 // E0_DIR
|
||||
|
||||
//
|
||||
// Drivers
|
||||
//
|
||||
#if HAS_TMC220x
|
||||
|
||||
#if ENABLED(HARDWARE_SERIAL) /* TMC2209 */
|
||||
#define X_SLAVE_ADDRESS 3 // | | :
|
||||
#define Y_SLAVE_ADDRESS 2 // : | :
|
||||
#define Z_SLAVE_ADDRESS 1 // | : :
|
||||
//#define E0_SLAVE_ADDRESS 0 // : : :
|
||||
|
||||
#define X_SERIAL_TX_PIN PA9 // TXD1
|
||||
#define X_SERIAL_RX_PIN PA9 // TXD1
|
||||
|
||||
#define Y_SERIAL_TX_PIN PA9 // TXD1
|
||||
#define Y_SERIAL_RX_PIN PA9 // TXD1
|
||||
|
||||
#define Z_SERIAL_TX_PIN PA9 // TXD1
|
||||
#define Z_SERIAL_RX_PIN PA9 // TXD1
|
||||
|
||||
#elif ENABLED(SOFTWARE_SERIAL) /* TMC220x */
|
||||
/**
|
||||
* TMC2208 stepper UART-configurable by PDN_UART pin
|
||||
* Software serial
|
||||
*/
|
||||
#define X_SLAVE_ADDRESS 0
|
||||
#define Y_SLAVE_ADDRESS 0
|
||||
#define Z_SLAVE_ADDRESS 0
|
||||
|
||||
#define X_SERIAL_TX_PIN PA10 // RXD1
|
||||
#define X_SERIAL_RX_PIN PA10 // RXD1
|
||||
|
||||
#define Y_SERIAL_TX_PIN PA9 // TXD1
|
||||
#define Y_SERIAL_RX_PIN PA9 // TXD1
|
||||
|
||||
#define Z_SERIAL_TX_PIN PC7 // IO1
|
||||
#define Z_SERIAL_RX_PIN PC7 // IO1
|
||||
|
||||
#endif
|
||||
// Reduce baud rate to improve software serial reliability
|
||||
#define TMC_BAUD_RATE 19200
|
||||
#else
|
||||
|
||||
// Motor current PWM pins
|
||||
#define MOTOR_CURRENT_PWM_XY_PIN PA6 // VREF2/3 CONTROL XY
|
||||
#define MOTOR_CURRENT_PWM_Z_PIN PA7 // VREF4 CONTROL Z
|
||||
#define MOTOR_CURRENT_PWM_RANGE 1500 // (255 * (1000mA / 65535)) * 257 = 1000 is equal 1.6v Vref in turn equal 1Amp
|
||||
#ifndef DEFAULT_PWM_MOTOR_CURRENT
|
||||
#define DEFAULT_PWM_MOTOR_CURRENT { 800, 800, 800 }
|
||||
#endif
|
||||
|
||||
/**
|
||||
* src: MKS Robin_Mini V2
|
||||
* __ESP(M1)__ -J1-
|
||||
* GND| 15 | | 08 |+3v3 (22)=>RXD1(PA10) //
|
||||
* | 16 | | 07 |MOSI (21)=>TXD1(PA9) // active low, probably OK to leave floating
|
||||
* IO2| 17 | | 06 |MISO (19)=>IO1(PC7) // Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating)
|
||||
* IO0| 18 | | 05 |CLK (18)=>IO0(PA8) // must be high (ESP3D software configures this with a pullup so OK to leave as floating)
|
||||
* IO1| 19 | | 03 |EN (03)=>WIFI_EN() // Must be high for module to run
|
||||
* | nc | | nc | (01)=>WIFI_CTRL(PA5)
|
||||
* RX| 21 | | nc |
|
||||
* TX| 22 | | 01 |RST
|
||||
*  ̄ ̄ AE ̄ ̄
|
||||
*
|
||||
*/
|
||||
#ifdef ESP_WIFI
|
||||
#define WIFI_IO0_PIN PA8 // PC13 MKS ESP WIFI IO0 PIN
|
||||
#define WIFI_IO1_PIN PC7 // MKS ESP WIFI IO1 PIN
|
||||
#define WIFI_RESET_PIN PA5 // MKS ESP WIFI RESET PIN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// EXTRUDER
|
||||
//
|
||||
#if AXIS_DRIVER_TYPE(E0,TMC2208)||AXIS_DRIVER_TYPE(E0,TMC2209)
|
||||
#define E0_SLAVE_ADDRESS 0
|
||||
|
||||
#define E0_SERIAL_TX_PIN PA8 // IO0
|
||||
#define E0_SERIAL_RX_PIN PA8 // IO0
|
||||
#define TMC_BAUD_RATE 19200
|
||||
#else
|
||||
// Motor current PWM pins
|
||||
#define MOTOR_CURRENT_PWM_E_PIN PB0 // VREF1 CONTROL E
|
||||
#define MOTOR_CURRENT_PWM_RANGE 1500 // (255 * (1000mA / 65535)) * 257 = 1000 is equal 1.6v Vref in turn equal 1Amp
|
||||
#ifndef DEFAULT_PWM_MOTOR_CURRENT
|
||||
#define DEFAULT_PWM_MOTOR_CURRENT { 800, 800, 800 }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Temperature Sensors(THM)
|
||||
//
|
||||
#define TEMP_0_PIN PC1 // TEMP_E0
|
||||
#define TEMP_BED_PIN PC0 // TEMP_BED
|
||||
|
||||
//
|
||||
// Heaters / Fans
|
||||
//
|
||||
#define HEATER_0_PIN PC3 // HEATER_E0
|
||||
#define HEATER_BED_PIN PA0 // HEATER_BED-WKUP
|
||||
|
||||
#define FAN_PIN PB1 // E_FAN
|
||||
//#define CONTROLLER_FAN_PIN PD6 // BOARD FAN
|
||||
|
||||
//
|
||||
// Misc. Functions
|
||||
//
|
||||
//#define POWER_LOSS_PIN PA1 // PW_SO
|
||||
#if ENABLED(BACKUP_POWER_SUPPLY)
|
||||
#define POWER_LOSS_PIN PA2 // PW_DET (UPS) MKSPWC
|
||||
#endif
|
||||
|
||||
//
|
||||
// Power Supply Control
|
||||
//
|
||||
#if ENABLED(PSU_CONTROL)
|
||||
#define KILL_PIN PA2 // PW_DET
|
||||
#define KILL_PIN_INVERTING true //
|
||||
//#define PS_ON_PIN PA3 // PW_CN /PW_OFF
|
||||
#endif
|
||||
|
||||
#define MT_DET_1_PIN PA4 // MT_DET
|
||||
#define MT_DET_2_PIN PE6 // FALA_CRTL
|
||||
#define MT_DET_PIN_INVERTING false
|
||||
|
||||
//
|
||||
// LED / NEOPixel
|
||||
//
|
||||
//#define LED_PIN PB2 // BOOT1
|
||||
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
#define LED_PWM PA8
|
||||
#ifndef NEOPIXEL_PIN
|
||||
#define NEOPIXEL_PIN LED_PWM // USED WIFI IO0/IO1/TX/RX PIN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//Others test.
|
||||
//#define SERVO0_PIN PA5 // WIFI CRTL
|
||||
//#define GPIO_CLEAR PA8 // IO0
|
||||
//#define GPIO_SET PA5
|
||||
|
||||
//
|
||||
// SD Card
|
||||
//
|
||||
#define SDIO_SUPPORT
|
||||
#define SDIO_CLOCK 4500000 // 4.5 MHz /* 18 MHz (18000000) or 4.5MHz (450000) */
|
||||
//#define SDIO_CLOCK 18000000 // 18 MHz (18000000)
|
||||
#if ENABLED(SDIO_SUPPORT)
|
||||
#define SCK_PIN PB13 // SPI2
|
||||
#define MISO_PIN PB14 // SPI2
|
||||
#define MOSI_PIN PB15 // SPI2
|
||||
#define SD_DETECT_PIN PD12 // SD_CD
|
||||
#endif
|
||||
|
||||
//
|
||||
// LCD / Controller
|
||||
//
|
||||
#ifndef BEEPER_PIN
|
||||
#define BEEPER_PIN PC5
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Note: MKS Robin TFT screens use various TFT controllers
|
||||
* Supported screens are based on the ILI9341, ST7789V and ILI9328 (320x240)
|
||||
* ILI9488 is not supported
|
||||
* Define init sequences for other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp
|
||||
*
|
||||
* If the screen stays white, disable 'LCD_RESET_PIN'
|
||||
* to let the bootloader init the screen.
|
||||
*
|
||||
* Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu
|
||||
* because Marlin uses the reset as a failsafe to revive a glitchy LCD.
|
||||
*/
|
||||
|
||||
// MKS Robin TFT v2.0 with ILI9341
|
||||
// Read display identification information (0xD3 on ILI9341)
|
||||
//#define XPT2046_X_CALIBRATION 12013
|
||||
//#define XPT2046_Y_CALIBRATION -8711
|
||||
//#define XPT2046_X_OFFSET -32
|
||||
//#define XPT2046_Y_OFFSET 256
|
||||
|
||||
// MKS Robin TFT v1.1 with ILI9328
|
||||
//#define XPT2046_X_CALIBRATION -11792
|
||||
//#define XPT2046_Y_CALIBRATION 8947
|
||||
//#define XPT2046_X_OFFSET 342
|
||||
//#define XPT2046_Y_OFFSET -19
|
||||
|
||||
// MKS Robin TFT v1.1 with R61505
|
||||
//#define XPT2046_X_CALIBRATION 12489
|
||||
//#define XPT2046_Y_CALIBRATION 9210
|
||||
//#define XPT2046_X_OFFSET -52
|
||||
//#define XPT2046_Y_OFFSET -17
|
||||
|
||||
// QQS-Pro uses MKS Robin TFT v2.0
|
||||
|
||||
// Shared FSMC Configs
|
||||
#if HAS_FSMC_TFT
|
||||
#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
|
||||
#define DOGLCD_SCK -1
|
||||
|
||||
#define FSMC_CS_PIN PD7 // NE4
|
||||
#define FSMC_RS_PIN PD11 // A0
|
||||
|
||||
#define TFT_RESET_PIN PC6 // FSMC_RST
|
||||
#define TFT_BACKLIGHT_PIN PD13
|
||||
|
||||
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
|
||||
#define FSMC_DMA_DEV DMA2
|
||||
#define FSMC_DMA_CHANNEL DMA_CH5
|
||||
|
||||
#define TOUCH_BUTTONS_HW_SPI
|
||||
#define TOUCH_BUTTONS_HW_SPI_DEVICE 2
|
||||
#endif
|
||||
|
||||
// XPT2046 Touch Screen calibration
|
||||
#if EITHER(TFT_LVGL_UI_FSMC, TFT_COLOR_UI)
|
||||
#define TFT_BUFFER_SIZE 14400
|
||||
|
||||
#ifndef XPT2046_X_CALIBRATION
|
||||
#define XPT2046_X_CALIBRATION 12218
|
||||
#endif
|
||||
#ifndef XPT2046_Y_CALIBRATION
|
||||
#define XPT2046_Y_CALIBRATION -8814
|
||||
#endif
|
||||
#ifndef XPT2046_X_OFFSET
|
||||
#define XPT2046_X_OFFSET -35
|
||||
#endif
|
||||
#ifndef XPT2046_Y_OFFSET
|
||||
#define XPT2046_Y_OFFSET 256
|
||||
#endif
|
||||
|
||||
#elif ENABLED(TFT_CLASSIC_UI)
|
||||
#ifndef XPT2046_X_CALIBRATION
|
||||
#define XPT2046_X_CALIBRATION 12149
|
||||
#endif
|
||||
#ifndef XPT2046_Y_CALIBRATION
|
||||
#define XPT2046_Y_CALIBRATION -8746
|
||||
#endif
|
||||
#ifndef XPT2046_X_OFFSET
|
||||
#define XPT2046_X_OFFSET -35
|
||||
#endif
|
||||
#ifndef XPT2046_Y_OFFSET
|
||||
#define XPT2046_Y_OFFSET 256
|
||||
#endif
|
||||
|
||||
#define TFT_MARLINUI_COLOR 0xFFFF // White
|
||||
#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow
|
||||
#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan
|
||||
#endif
|
||||
|
||||
#if NEED_TOUCH_PINS
|
||||
#define TOUCH_CS_PIN PC2 // SPI2_NSS
|
||||
#define TOUCH_SCK_PIN PB13 // SPI2_SCK
|
||||
#define TOUCH_MISO_PIN PB14 // SPI2_MISO
|
||||
#define TOUCH_MOSI_PIN PB15 // SPI2_MOSI
|
||||
#endif
|
||||
|
|
@ -93,10 +93,10 @@
|
|||
//
|
||||
// Hardware serial with switch
|
||||
//
|
||||
#define X_HARDWARE_SERIAL MSerial1
|
||||
#define Y_HARDWARE_SERIAL MSerial1
|
||||
#define Z_HARDWARE_SERIAL MSerial1
|
||||
#define E0_HARDWARE_SERIAL MSerial1
|
||||
#define X_HARDWARE_SERIAL MSerial2
|
||||
#define Y_HARDWARE_SERIAL MSerial2
|
||||
#define Z_HARDWARE_SERIAL MSerial2
|
||||
#define E0_HARDWARE_SERIAL MSerial2
|
||||
|
||||
// The 4xTMC2209 module doesn't have a serial multiplexer and
|
||||
// needs to set *_SLAVE_ADDRESS in Configuration_adv.h for X,Y,Z,E0
|
||||
|
|
@ -106,6 +106,9 @@
|
|||
#define SERIAL_MUL_PIN2 PB12
|
||||
#endif
|
||||
|
||||
// Reduce baud rate to improve software serial reliability
|
||||
#define TMC_BAUD_RATE 19200
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -49,9 +49,6 @@
|
|||
//#define MARLIN_EEPROM_SIZE 0x1000UL // 4KB
|
||||
//#define MARLIN_EEPROM_SIZE (EEPROM_START_ADDRESS + (EEPROM_PAGE_SIZE) * 2UL)
|
||||
|
||||
//#define EEPROM_CHITCHAT
|
||||
//#define DEBUG_EEPROM_READWRITE
|
||||
|
||||
//
|
||||
// Limit Switches
|
||||
//
|
||||
|
|
|
|||
|
|
@ -106,18 +106,6 @@
|
|||
//#undef Z_MAX_PIN // Uncomment if using ZMAX connector (PE5)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Note: Alfawise screens use various TFT controllers. Supported screens
|
||||
* are based on the ILI9341, ILI9328 and ST7798V. Define init sequences for
|
||||
* other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp
|
||||
*
|
||||
* If the screen stays white, disable 'LCD_RESET_PIN' to let the bootloader
|
||||
* init the screen.
|
||||
*
|
||||
* Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu
|
||||
* because Marlin uses the reset as a failsafe to revive a glitchy LCD.
|
||||
*/
|
||||
|
||||
#define TFT_RESET_PIN PC4 // pin 33
|
||||
#define TFT_BACKLIGHT_PIN PD12 // pin 59
|
||||
#define FSMC_CS_PIN PD7 // pin 88 = FSMC_NE1
|
||||
|
|
@ -130,9 +118,6 @@
|
|||
#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
|
||||
#define DOGLCD_SCK -1
|
||||
|
||||
// Longer/Alfawise TFT
|
||||
#define LONGER_LK_TFT28
|
||||
|
||||
// Buffer for Color UI
|
||||
#define TFT_BUFFER_SIZE 3200
|
||||
|
||||
|
|
|
|||
2
buildroot/share/PlatformIO/scripts/add_nanolib.py
Normal file
2
buildroot/share/PlatformIO/scripts/add_nanolib.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Import("env")
|
||||
env.Append(LINKFLAGS=["--specs=nano.specs"])
|
||||
|
|
@ -57,14 +57,15 @@ exec_test $1 $2 "Sled Z Probe with Linear leveling"
|
|||
# exec_test $1 $2 "...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES"
|
||||
|
||||
#
|
||||
# Test MAGNETIC_PARKING_EXTRUDER with LCD
|
||||
# Test MAGNETIC_PARKING_EXTRUDER with no LCD
|
||||
#
|
||||
restore_configs
|
||||
opt_set MOTHERBOARD BOARD_TEENSY41
|
||||
opt_set EXTRUDERS 2
|
||||
opt_set TEMP_SENSOR_1 1
|
||||
opt_enable MAGNETIC_PARKING_EXTRUDER
|
||||
exec_test $1 $2 "MAGNETIC_PARKING_EXTRUDER with LCD"
|
||||
opt_set SERIAL_PORT_2 -2
|
||||
opt_enable EEPROM_SETTINGS MAGNETIC_PARKING_EXTRUDER
|
||||
exec_test $1 $2 "Ethernet, EEPROM, Magnetic Parking Extruder, No LCD"
|
||||
|
||||
#
|
||||
# Mixing Extruder
|
||||
|
|
|
|||
6
data/www/bootstrap.min.css
vendored
Normal file
6
data/www/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
6
data/www/bootstrap.min.js
vendored
Normal file
6
data/www/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
data/www/bootstrap4-toggle.min.js
vendored
Normal file
10
data/www/bootstrap4-toggle.min.js
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/*\
|
||||
|*| ========================================================================
|
||||
|*| Bootstrap Toggle: bootstrap4-toggle.js v3.6.1
|
||||
|*| https://gitbrent.github.io/bootstrap4-toggle/
|
||||
|*| ========================================================================
|
||||
|*| Copyright 2018-2019 Brent Ely
|
||||
|*| Licensed under MIT
|
||||
|*| ========================================================================
|
||||
\*/
|
||||
!function(a){"use strict";function l(t,e){this.$element=a(t),this.options=a.extend({},this.defaults(),e),this.render()}l.VERSION="3.6.0",l.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"light",size:"normal",style:"",width:null,height:null},l.prototype.defaults=function(){return{on:this.$element.attr("data-on")||l.DEFAULTS.on,off:this.$element.attr("data-off")||l.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||l.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||l.DEFAULTS.offstyle,size:this.$element.attr("data-size")||l.DEFAULTS.size,style:this.$element.attr("data-style")||l.DEFAULTS.style,width:this.$element.attr("data-width")||l.DEFAULTS.width,height:this.$element.attr("data-height")||l.DEFAULTS.height}},l.prototype.render=function(){this._onstyle="btn-"+this.options.onstyle,this._offstyle="btn-"+this.options.offstyle;var t="large"===this.options.size||"lg"===this.options.size?"btn-lg":"small"===this.options.size||"sm"===this.options.size?"btn-sm":"mini"===this.options.size||"xs"===this.options.size?"btn-xs":"",e=a('<label for="'+this.$element.prop("id")+'" class="btn">').html(this.options.on).addClass(this._onstyle+" "+t),s=a('<label for="'+this.$element.prop("id")+'" class="btn">').html(this.options.off).addClass(this._offstyle+" "+t),o=a('<span class="toggle-handle btn btn-light">').addClass(t),i=a('<div class="toggle-group">').append(e,s,o),l=a('<div class="toggle btn" data-toggle="toggle" role="button">').addClass(this.$element.prop("checked")?this._onstyle:this._offstyle+" off").addClass(t).addClass(this.options.style);this.$element.wrap(l),a.extend(this,{$toggle:this.$element.parent(),$toggleOn:e,$toggleOff:s,$toggleGroup:i}),this.$toggle.append(i);var n=this.options.width||Math.max(e.outerWidth(),s.outerWidth())+o.outerWidth()/2,h=this.options.height||Math.max(e.outerHeight(),s.outerHeight());e.addClass("toggle-on"),s.addClass("toggle-off"),this.$toggle.css({width:n,height:h}),this.options.height&&(e.css("line-height",e.height()+"px"),s.css("line-height",s.height()+"px")),this.update(!0),this.trigger(!0)},l.prototype.toggle=function(){this.$element.prop("checked")?this.off():this.on()},l.prototype.on=function(t){if(this.$element.prop("disabled"))return!1;this.$toggle.removeClass(this._offstyle+" off").addClass(this._onstyle),this.$element.prop("checked",!0),t||this.trigger()},l.prototype.off=function(t){if(this.$element.prop("disabled"))return!1;this.$toggle.removeClass(this._onstyle).addClass(this._offstyle+" off"),this.$element.prop("checked",!1),t||this.trigger()},l.prototype.enable=function(){this.$toggle.removeClass("disabled"),this.$toggle.removeAttr("disabled"),this.$element.prop("disabled",!1)},l.prototype.disable=function(){this.$toggle.addClass("disabled"),this.$toggle.attr("disabled","disabled"),this.$element.prop("disabled",!0)},l.prototype.update=function(t){this.$element.prop("disabled")?this.disable():this.enable(),this.$element.prop("checked")?this.on(t):this.off(t)},l.prototype.trigger=function(t){this.$element.off("change.bs.toggle"),t||this.$element.change(),this.$element.on("change.bs.toggle",a.proxy(function(){this.update()},this))},l.prototype.destroy=function(){this.$element.off("change.bs.toggle"),this.$toggleGroup.remove(),this.$element.removeData("bs.toggle"),this.$element.unwrap()};var t=a.fn.bootstrapToggle;a.fn.bootstrapToggle=function(o){var i=Array.prototype.slice.call(arguments,1)[0];return this.each(function(){var t=a(this),e=t.data("bs.toggle"),s="object"==typeof o&&o;e||t.data("bs.toggle",e=new l(this,s)),"string"==typeof o&&e[o]&&"boolean"==typeof i?e[o](i):"string"==typeof o&&e[o]&&e[o]()})},a.fn.bootstrapToggle.Constructor=l,a.fn.toggle.noConflict=function(){return a.fn.bootstrapToggle=t,this},a(function(){a("input[type=checkbox][data-toggle^=toggle]").bootstrapToggle()}),a(document).on("click.bs.toggle","div[data-toggle^=toggle]",function(t){a(this).find("input[type=checkbox]").bootstrapToggle("toggle"),t.preventDefault()})}(jQuery);
|
||||
234
data/www/chart.lineargauge.js
Normal file
234
data/www/chart.lineargauge.js
Normal file
|
|
@ -0,0 +1,234 @@
|
|||
(function(Chart) {
|
||||
var helpers = Chart.helpers;
|
||||
var plugins = Chart.plugins;
|
||||
Chart.defaults.global.animation.duration = 1000;
|
||||
|
||||
Chart.defaults._set('linearGauge', {
|
||||
scale: {
|
||||
type: 'linearGauge',
|
||||
horizontal: false,
|
||||
range: {
|
||||
startValue: -100,
|
||||
endValue: 500
|
||||
},
|
||||
responsive: true,
|
||||
font: {
|
||||
fontName: 'Arial',
|
||||
fontSize: 12
|
||||
},
|
||||
axisWidth: 6,
|
||||
ticks: {
|
||||
majorTicks: {
|
||||
interval: 100,
|
||||
height: 1,
|
||||
}
|
||||
},
|
||||
scaleLabel: {
|
||||
display: true,
|
||||
interval: 100,
|
||||
units: '',
|
||||
customValues: [],
|
||||
offset: -10,
|
||||
color: '#777b80'
|
||||
}
|
||||
},
|
||||
padding: {
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0
|
||||
},
|
||||
tooltips: {
|
||||
callbacks: {
|
||||
label: function(tooltipItem, data) {
|
||||
var label = data.datasets[tooltipItem.datasetIndex].label || '';
|
||||
|
||||
if (label) {
|
||||
label += ': ';
|
||||
}
|
||||
label += Math.round(data.datasets[tooltipItem.datasetIndex].data[0] * 100) / 100;
|
||||
return label;
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
display: true,
|
||||
labels: {
|
||||
fontColor: 'rgb(0, 0, 0)'
|
||||
},
|
||||
position: 'bottom'
|
||||
}
|
||||
});
|
||||
|
||||
Chart.controllers.linearGauge = Chart.DatasetController.extend({
|
||||
|
||||
dataElementType: Chart.elements.Gaugerect,
|
||||
|
||||
initialize: function() {
|
||||
var me = this;
|
||||
var meta;
|
||||
|
||||
Chart.DatasetController.prototype.initialize.apply(me, arguments);
|
||||
|
||||
meta = me.getMeta();
|
||||
|
||||
},
|
||||
|
||||
linkScales: helpers.noop,
|
||||
|
||||
update: function(reset) {
|
||||
var me = this;
|
||||
var rects = me.getMeta().data;
|
||||
var i, ilen;
|
||||
me.datashifts = 0;
|
||||
|
||||
for (i = 0, ilen = rects.length; i < ilen; ++i) {
|
||||
me.updateElement(rects[i], i, me.datashifts);
|
||||
me.datashifts += 10;
|
||||
}
|
||||
},
|
||||
|
||||
updateElement: function(rectangle, index, reset) {
|
||||
var me = this;
|
||||
var chart = me.chart;
|
||||
var meta = me.getMeta();
|
||||
var dataset = me.getDataset();
|
||||
|
||||
var custom = rectangle.custom || {};
|
||||
var rectangleOptions = chart.options.elements.rectangle;
|
||||
var gaugeOptions = chart.options.elements.gaugerect;
|
||||
rectangle._Scale = me.getScaleForId(chart.options.scale.id || 'gaugescale');
|
||||
rectangle._datasetIndex = me.index;
|
||||
rectangle._index = index;
|
||||
rectangle.rangeColorImage = null;
|
||||
|
||||
// Init element model
|
||||
rectangle._model = {
|
||||
datasetLabel: dataset.label,
|
||||
label: chart.data.labels[index],
|
||||
borderSkipped: custom.borderSkipped ? custom.borderSkipped : rectangleOptions.borderSkipped,
|
||||
backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.backgroundColor, index, gaugeOptions.backgroundColor),
|
||||
borderColor: custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.borderColor, index, rectangleOptions.borderColor),
|
||||
borderWidth: custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.borderWidth, index, rectangleOptions.borderWidth)
|
||||
};
|
||||
|
||||
// Set empty view as start point for animation
|
||||
if(typeof rectangle._view === 'undefined') rectangle._view = {};
|
||||
|
||||
me.updateElementGeometry(rectangle, index, reset);
|
||||
|
||||
},
|
||||
|
||||
updateElementGeometry: function(rectangle, index, reset) {
|
||||
var me = this;
|
||||
var model = rectangle._model;
|
||||
var start = rectangle._view;
|
||||
var dataset = me.getDataset().data;
|
||||
var dopt = me.getDataset();
|
||||
var chart = me.chart;
|
||||
var datasets = chart.data.datasets;
|
||||
var gaugeOptions = chart.options.elements.gaugerect;
|
||||
var vscale = me.getScaleForId(chart.options.scale.id || 'gaugescale');
|
||||
//var base = vscale.getBasePixel();
|
||||
var base = vscale.getBase();
|
||||
var horizontal = rectangle._Scale.isHorizontal();
|
||||
//var ruler = me._ruler || me.getRuler();
|
||||
var vpixels = me.calculateBarValuePixels(me.index, index, horizontal);
|
||||
|
||||
model.horizontal = horizontal;
|
||||
model.base = base;
|
||||
model.head = vpixels.head;
|
||||
model.x = horizontal ? vpixels.base : vpixels.offset;
|
||||
model.y = horizontal ? (vpixels.offset - (dopt.width || gaugeOptions.width)) : vpixels.head;
|
||||
model.height = horizontal ? (dopt.width || gaugeOptions.width) : (vpixels.base - vpixels.head);
|
||||
model.width = horizontal ? (vpixels.head - vpixels.base) : (dopt.width || gaugeOptions.width);
|
||||
model.value = vscale.getRightValue(datasets[me.index].data[index]);
|
||||
|
||||
model.scaleValue = 0;
|
||||
if (horizontal) {
|
||||
model.scaleValue = vscale.width / (vscale.options.range.endValue - vscale.options.range.startValue);
|
||||
} else {
|
||||
model.scaleValue = vscale.height / (vscale.options.range.endValue - vscale.options.range.startValue);
|
||||
}
|
||||
|
||||
if(typeof start.x === 'undefined' && typeof start.y === 'undefined'){
|
||||
if(horizontal){
|
||||
start.x = vpixels.base;
|
||||
start.width = 0;
|
||||
} else {
|
||||
start.y = vpixels.base;
|
||||
start.height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
calculateBarValuePixels: function(datasetIndex, index, horizontal) {
|
||||
var me = this;
|
||||
var chart = me.chart;
|
||||
var scale = me.getScaleForId(chart.options.scale.id || 'gaugescale');
|
||||
var datasets = chart.data.datasets;
|
||||
var dopt = datasets[datasetIndex];
|
||||
var value = scale.getRightValue(datasets[datasetIndex].data[index]);
|
||||
var stacked = scale.options.stacked;
|
||||
var start = 0;
|
||||
var i, imeta, ivalue, base, head, size, offset;
|
||||
|
||||
base = scale.scalePoint(start);
|
||||
head = scale.scalePoint(start + value);
|
||||
size = (head - base) / 2;
|
||||
offset = horizontal ? scale.yCenter - dopt.offset : scale.xCenter + dopt.offset;
|
||||
|
||||
return {
|
||||
size: size,
|
||||
base: base,
|
||||
head: head,
|
||||
center: head + size / 2,
|
||||
offset: offset
|
||||
};
|
||||
},
|
||||
|
||||
draw: function() {
|
||||
var me = this;
|
||||
var chart = me.chart;
|
||||
var rects = me.getMeta().data;
|
||||
var dataset = me.getDataset();
|
||||
var ilen = rects.length;
|
||||
var i = 0;
|
||||
|
||||
helpers.canvas.clipArea(chart.ctx, chart.chartArea);
|
||||
|
||||
for (; i < ilen; ++i) {
|
||||
if (!isNaN(dataset.data[i])) {
|
||||
rects[i].draw();
|
||||
}
|
||||
}
|
||||
|
||||
helpers.canvas.unclipArea(chart.ctx);
|
||||
},
|
||||
|
||||
setHoverStyle: function(rectangle) {
|
||||
var dataset = this.chart.data.datasets[rectangle._datasetIndex];
|
||||
var index = rectangle._index;
|
||||
var custom = rectangle.custom || {};
|
||||
var model = rectangle._model;
|
||||
|
||||
model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : helpers.valueAtIndexOrDefault(dataset.hoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));
|
||||
model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : helpers.valueAtIndexOrDefault(dataset.hoverBorderColor, index, helpers.getHoverColor(model.borderColor));
|
||||
model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : helpers.valueAtIndexOrDefault(dataset.hoverBorderWidth, index, model.borderWidth);
|
||||
},
|
||||
|
||||
removeHoverStyle: function(rectangle) {
|
||||
var dataset = this.chart.data.datasets[rectangle._datasetIndex];
|
||||
var index = rectangle._index;
|
||||
var custom = rectangle.custom || {};
|
||||
var model = rectangle._model;
|
||||
var rectangleElementOptions = this.chart.options.elements.gaugerect;
|
||||
|
||||
model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor);
|
||||
model.borderColor = custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.borderColor, index, rectangleElementOptions.borderColor);
|
||||
model.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth);
|
||||
}
|
||||
|
||||
});
|
||||
}).call(this, Chart);
|
||||
7
data/www/chart.min.js
vendored
Normal file
7
data/www/chart.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
data/www/filesaver.min.js
vendored
Normal file
1
data/www/filesaver.min.js
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
(function(a,b){if("function"==typeof define&&define.amd)define([],b);else if("undefined"!=typeof exports)b();else{b(),a.FileSaver={exports:{}}.exports}})(this,function(){"use strict";function b(a,b){return"undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(a,b,c){var d=new XMLHttpRequest;d.open("GET",a),d.responseType="blob",d.onload=function(){g(d.response,b,c)},d.onerror=function(){console.error("could not download file")},d.send()}function d(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,a=/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download",j.download=g,j.rel="noopener","string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement("a");i.href=f,i.target="_blank",setTimeout(function(){e(i)})}}:function(b,d,e,g){if(g=g||open("","_blank"),g&&(g.document.title=g.document.body.innerText="downloading..."),"string"==typeof b)return c(b,d,e);var h="application/octet-stream"===b.type,i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\/[\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&"undefined"!=typeof FileReader){var k=new FileReader;k.onloadend=function(){var a=k.result;a=j?a:a.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=a:location=a,g=null},k.readAsDataURL(b)}else{var l=f.URL||f.webkitURL,m=l.createObjectURL(b);g?g.location=m:location.href=m,g=null,setTimeout(function(){l.revokeObjectURL(m)},4E4)}});f.saveAs=g.saveAs=g,"undefined"!=typeof module&&(module.exports=g)});
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue