From 15ce373f8489013439105a893dca6c2249cfa9e3 Mon Sep 17 00:00:00 2001
From: makerbase-mks <4146049@qq.com>
Date: Thu, 6 Aug 2020 13:34:27 +0800
Subject: [PATCH] Robin e3/e3d firmware update to marlin2.0.6 version
---
.../README.md | 1 +
.../README.md | 1 +
.../README.md | 1 +
firmware/marlin2.0 for Ender3/.editorconfig | 19 +
firmware/marlin2.0 for Ender3/.gitignore | 7 +-
firmware/marlin2.0 for Ender3/LICENSE | 8 +-
.../Marlin/Configuration.h | 278 +-
.../Marlin/Configuration_adv.h | 1156 ++++--
firmware/marlin2.0 for Ender3/Marlin/Makefile | 128 +-
.../marlin2.0 for Ender3/Marlin/Marlin.ino | 26 +-
.../marlin2.0 for Ender3/Marlin/Version.h | 18 +-
.../Marlin/src/HAL/{HAL_AVR => AVR}/HAL.cpp | 5 +-
.../Marlin/src/HAL/AVR/HAL.h | 202 +
.../src/HAL/{HAL_AVR => AVR}/HAL_SPI.cpp | 8 +-
.../src/HAL/{HAL_AVR => AVR}/MarlinSerial.cpp | 61 +-
.../src/HAL/{HAL_AVR => AVR}/MarlinSerial.h | 40 +-
.../Marlin/src/HAL/{HAL_AVR => AVR}/Servo.cpp | 5 +-
.../src/HAL/{HAL_AVR => AVR}/ServoTimers.h | 4 +-
.../eeprom.cpp} | 23 +-
.../HAL/{HAL_AVR => AVR}/endstop_interrupts.h | 20 +-
.../src/HAL/{HAL_AVR => AVR}/fast_pwm.cpp | 12 +-
.../src/HAL/{HAL_AVR => AVR}/fastio.cpp | 54 +-
.../Marlin/src/HAL/{HAL_AVR => AVR}/fastio.h | 29 +-
.../HAL/{HAL_AVR => AVR}/fastio/fastio_1280.h | 6 +-
.../HAL/{HAL_AVR => AVR}/fastio/fastio_1281.h | 4 +-
.../HAL/{HAL_AVR => AVR}/fastio/fastio_168.h | 4 +-
.../HAL/{HAL_AVR => AVR}/fastio/fastio_644.h | 4 +-
.../{HAL_AVR => AVR}/fastio/fastio_AT90USB.h | 4 +-
.../{HAL_AVR => AVR}/inc/Conditionals_LCD.h | 4 +-
.../{HAL_DUE => AVR}/inc/Conditionals_adv.h | 4 +-
.../{HAL_DUE => AVR}/inc/Conditionals_post.h | 4 +-
.../HAL/{HAL_AVR => AVR}/inc/SanityCheck.h | 22 +-
.../Marlin/src/HAL/{HAL_AVR => AVR}/math.h | 4 +-
.../src/HAL/{HAL_AVR => AVR}/pinsDebug.h | 16 +-
.../{HAL_AVR => AVR}/pinsDebug_Teensyduino.h | 4 +-
.../HAL/{HAL_AVR => AVR}/pinsDebug_plus_70.h | 4 +-
.../src/HAL/{HAL_AVR => AVR}/spi_pins.h | 4 +-
.../src/HAL/{HAL_AVR/HAL.h => AVR/timers.h} | 181 +-
.../u8g_com_HAL_AVR_sw_spi.cpp | 8 +-
.../src/HAL/{HAL_AVR => AVR}/watchdog.cpp | 9 +-
.../src/HAL/{HAL_AVR => AVR}/watchdog.h | 4 +-
.../src/HAL/{HAL_DUE => DUE}/DebugMonitor.cpp | 5 +-
.../Marlin/src/HAL/{HAL_DUE => DUE}/HAL.cpp | 8 +-
.../Marlin/src/HAL/{HAL_DUE => DUE}/HAL.h | 50 +-
.../src/HAL/{HAL_DUE => DUE}/HAL_SPI.cpp | 6 +-
.../HAL/{HAL_DUE => DUE}/InterruptVectors.cpp | 12 +-
.../HAL/{HAL_DUE => DUE}/InterruptVectors.h | 4 +-
.../src/HAL/{HAL_DUE => DUE}/MarlinSerial.cpp | 30 +-
.../src/HAL/{HAL_DUE => DUE}/MarlinSerial.h | 28 +-
.../HAL/{HAL_DUE => DUE}/MarlinSerialUSB.cpp | 28 +-
.../HAL/{HAL_DUE => DUE}/MarlinSerialUSB.h | 16 +-
.../Marlin/src/HAL/{HAL_DUE => DUE}/Servo.cpp | 5 +-
.../src/HAL/{HAL_DUE => DUE}/ServoTimers.h | 0
.../Marlin/src/HAL/{HAL_DUE => DUE}/Tone.cpp | 7 +-
.../dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp | 6 +-
.../dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp | 4 +-
.../dogm/u8g_com_HAL_DUE_sw_spi.cpp | 4 +-
.../dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp | 8 +-
.../dogm/u8g_com_HAL_DUE_sw_spi_shared.h | 4 +-
.../eeprom_flash.cpp} | 247 +-
.../eeprom_wired.cpp} | 41 +-
.../HAL/{HAL_DUE => DUE}/endstop_interrupts.h | 54 +-
.../Marlin/src/HAL/{HAL_DUE => DUE}/fastio.h | 10 +-
.../Marlin/src/HAL/DUE/fastio/G2_PWM.cpp | 206 +
.../src/HAL/{HAL_DUE => DUE}/fastio/G2_PWM.h | 6 +-
.../src/HAL/{HAL_DUE => DUE}/fastio/G2_pins.h | 4 +-
.../{HAL_ESP32 => DUE}/inc/Conditionals_LCD.h | 4 +-
.../{HAL_AVR => DUE}/inc/Conditionals_adv.h | 4 +-
.../src/HAL/DUE/inc/Conditionals_post.h | 28 +
.../HAL/{HAL_DUE => DUE}/inc/SanityCheck.h | 8 +-
.../src/HAL/{HAL_DUE => DUE}/pinsDebug.h | 4 +-
.../src/HAL/{HAL_DUE => DUE}/spi_pins.h | 4 +-
.../src/HAL/{HAL_DUE => DUE}/timers.cpp | 6 +-
.../Marlin/src/HAL/{HAL_DUE => DUE}/timers.h | 26 +-
.../Marlin/src/HAL/DUE/upload_extra_script.py | 18 +
.../HAL/{HAL_DUE => DUE}/usb/arduino_due_x.h | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/compiler.h | 2 +-
.../HAL/{HAL_DUE => DUE}/usb/conf_access.h | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/conf_clock.h | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/conf_usb.h | 6 +-
.../HAL/{HAL_DUE => DUE}/usb/ctrl_access.c | 2 +-
.../HAL/{HAL_DUE => DUE}/usb/ctrl_access.h | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/genclk.h | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/mrepeat.h | 2 +-
.../Marlin/src/HAL/{HAL_DUE => DUE}/usb/osc.h | 2 +-
.../Marlin/src/HAL/{HAL_DUE => DUE}/usb/pll.h | 2 +-
.../HAL/{HAL_DUE => DUE}/usb/preprocessor.h | 2 +-
.../HAL/{HAL_DUE => DUE}/usb/sbc_protocol.h | 2 +-
.../{HAL_DUE => DUE}/usb/sd_mmc_spi_mem.cpp | 0
.../HAL/{HAL_DUE => DUE}/usb/sd_mmc_spi_mem.h | 2 +-
.../HAL/{HAL_DUE => DUE}/usb/spc_protocol.h | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/stringz.h | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/sysclk.c | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/sysclk.h | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/tpaste.h | 2 +-
.../Marlin/src/HAL/{HAL_DUE => DUE}/usb/udc.c | 2 +-
.../Marlin/src/HAL/{HAL_DUE => DUE}/usb/udc.h | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/udc_desc.h | 2 +-
.../Marlin/src/HAL/{HAL_DUE => DUE}/usb/udd.h | 2 +-
.../Marlin/src/HAL/{HAL_DUE => DUE}/usb/udi.h | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/udi_cdc.c | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/udi_cdc.h | 4 +-
.../HAL/{HAL_DUE => DUE}/usb/udi_cdc_conf.h | 2 +-
.../HAL/{HAL_DUE => DUE}/usb/udi_cdc_desc.c | 2 +-
.../{HAL_DUE => DUE}/usb/udi_composite_desc.c | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/udi_msc.c | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/udi_msc.h | 4 +-
.../{HAL_DUE => DUE}/usb/uotghs_device_due.c | 4 +-
.../{HAL_DUE => DUE}/usb/uotghs_device_due.h | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/uotghs_otg.h | 2 +-
.../HAL/{HAL_DUE => DUE}/usb/usb_protocol.h | 2 +-
.../{HAL_DUE => DUE}/usb/usb_protocol_cdc.h | 2 +-
.../{HAL_DUE => DUE}/usb/usb_protocol_msc.h | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/usb_task.c | 2 +-
.../src/HAL/{HAL_DUE => DUE}/usb/usb_task.h | 2 +-
.../src/HAL/{HAL_DUE => DUE}/watchdog.cpp | 7 +-
.../src/HAL/{HAL_DUE => DUE}/watchdog.h | 4 +-
.../FlushableHardwareSerial.cpp | 4 +-
.../FlushableHardwareSerial.h | 4 +-
.../src/HAL/{HAL_ESP32 => ESP32}/HAL.cpp | 110 +-
.../Marlin/src/HAL/{HAL_ESP32 => ESP32}/HAL.h | 78 +-
.../src/HAL/{HAL_ESP32 => ESP32}/HAL_SPI.cpp | 12 +-
.../src/HAL/{HAL_ESP32 => ESP32}/Servo.cpp | 10 +-
.../src/HAL/{HAL_ESP32 => ESP32}/Servo.h | 4 +-
.../{HAL_ESP32 => ESP32}/WebSocketSerial.cpp | 4 +-
.../{HAL_ESP32 => ESP32}/WebSocketSerial.h | 4 +-
.../eeprom.cpp} | 28 +-
.../{HAL_ESP32 => ESP32}/endstop_interrupts.h | 54 +-
.../src/HAL/{HAL_ESP32 => ESP32}/fastio.h | 6 +-
.../src/HAL/{HAL_ESP32 => ESP32}/i2s.cpp | 12 +-
.../Marlin/src/HAL/{HAL_ESP32 => ESP32}/i2s.h | 4 +-
.../inc/Conditionals_LCD.h | 4 +-
.../inc/Conditionals_adv.h | 4 +-
.../inc/Conditionals_post.h | 4 +-
.../{HAL_ESP32 => ESP32}/inc/SanityCheck.h | 12 +-
.../src/HAL/{HAL_ESP32 => ESP32}/ota.cpp | 9 +-
.../Marlin/src/HAL/{HAL_ESP32 => ESP32}/ota.h | 4 +-
.../HAL/{HAL_ESP32 => ESP32}/servotimers.h | 4 +-
.../src/HAL/{HAL_ESP32 => ESP32}/spi_pins.h | 4 +-
.../src/HAL/{HAL_ESP32 => ESP32}/spiffs.cpp | 9 +-
.../src/HAL/{HAL_ESP32 => ESP32}/spiffs.h | 4 +-
.../src/HAL/{HAL_ESP32 => ESP32}/timers.cpp | 11 +-
.../src/HAL/{HAL_ESP32 => ESP32}/timers.h | 34 +-
.../src/HAL/{HAL_ESP32 => ESP32}/watchdog.cpp | 5 +-
.../src/HAL/{HAL_ESP32 => ESP32}/watchdog.h | 4 +-
.../src/HAL/{HAL_ESP32 => ESP32}/web.cpp | 16 +-
.../Marlin/src/HAL/{HAL_ESP32 => ESP32}/web.h | 4 +-
.../src/HAL/{HAL_ESP32 => ESP32}/wifi.cpp | 5 +-
.../src/HAL/{HAL_ESP32 => ESP32}/wifi.h | 4 +-
.../marlin2.0 for Ender3/Marlin/src/HAL/HAL.h | 22 +-
.../Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.cpp | 145 -
.../HAL/HAL_LPC1768/inc/Conditionals_LCD.h | 22 -
.../HAL/HAL_LPC1768/inc/Conditionals_adv.h | 22 -
.../HAL/HAL_LPC1768/inc/Conditionals_post.h | 22 -
.../src/HAL/HAL_LPC1768/inc/SanityCheck.h | 74 -
...LPC1768_ssd_sw_i2c.cpp under construction | 254 --
.../HAL/HAL_LPC1768/upload_extra_script.py | 144 -
.../src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h | 22 -
.../src/HAL/HAL_SAMD51/inc/Conditionals_adv.h | 22 -
.../HAL/HAL_SAMD51/inc/Conditionals_post.h | 22 -
.../HAL_SAMD51/persistent_store_eeprom.cpp | 129 -
.../Marlin/src/HAL/HAL_SAMD51/timers.cpp | 135 -
.../Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp | 158 -
.../Marlin/src/HAL/HAL_STM32/Servo.cpp | 62 -
.../src/HAL/HAL_STM32/endstop_interrupts.h | 64 -
.../src/HAL/HAL_STM32/inc/Conditionals_LCD.h | 22 -
.../src/HAL/HAL_STM32/inc/Conditionals_adv.h | 22 -
.../src/HAL/HAL_STM32/inc/Conditionals_post.h | 22 -
.../HAL/HAL_STM32/persistent_store_impl.cpp | 97 -
.../HAL/HAL_STM32/persistent_store_sdcard.cpp | 103 -
.../HAL/HAL_STM32F1/inc/Conditionals_LCD.h | 22 -
.../HAL/HAL_STM32F1/inc/Conditionals_adv.h | 22 -
.../HAL/HAL_STM32F1/inc/Conditionals_post.h | 22 -
.../HAL/HAL_STM32_F4_F7/endstop_interrupts.h | 64 -
.../HAL_STM32_F4_F7/inc/Conditionals_LCD.h | 22 -
.../HAL_STM32_F4_F7/inc/Conditionals_adv.h | 22 -
.../HAL_STM32_F4_F7/inc/Conditionals_post.h | 22 -
.../HAL_TEENSY31_32/inc/Conditionals_LCD.h | 22 -
.../HAL_TEENSY31_32/inc/Conditionals_adv.h | 22 -
.../HAL_TEENSY31_32/inc/Conditionals_post.h | 22 -
.../HAL_TEENSY35_36/inc/Conditionals_LCD.h | 22 -
.../HAL_TEENSY35_36/inc/Conditionals_adv.h | 22 -
.../HAL_TEENSY35_36/inc/Conditionals_post.h | 22 -
.../src/HAL/{HAL_LINUX => LINUX}/HAL.cpp | 7 +-
.../Marlin/src/HAL/{HAL_LINUX => LINUX}/HAL.h | 29 +-
.../src/HAL/{HAL_LINUX => LINUX}/arduino.cpp | 19 +-
.../eeprom.cpp} | 22 +-
.../src/HAL/{HAL_LINUX => LINUX}/fastio.h | 6 +-
.../{HAL_LINUX => LINUX}/hardware/Clock.cpp | 5 +-
.../HAL/{HAL_LINUX => LINUX}/hardware/Clock.h | 4 +-
.../{HAL_LINUX => LINUX}/hardware/Gpio.cpp | 5 +-
.../HAL/{HAL_LINUX => LINUX}/hardware/Gpio.h | 4 +-
.../{HAL_LINUX => LINUX}/hardware/Heater.cpp | 5 +-
.../{HAL_LINUX => LINUX}/hardware/Heater.h | 4 +-
.../hardware/IOLoggerCSV.cpp | 5 +-
.../hardware/IOLoggerCSV.h | 4 +-
.../hardware/LinearAxis.cpp | 5 +-
.../hardware/LinearAxis.h | 4 +-
.../{HAL_LINUX => LINUX}/hardware/Timer.cpp | 5 +-
.../HAL/{HAL_LINUX => LINUX}/hardware/Timer.h | 4 +-
.../{HAL_DUE => LINUX}/inc/Conditionals_LCD.h | 4 +-
.../inc/Conditionals_adv.h | 4 +-
.../inc/Conditionals_post.h | 4 +-
.../{HAL_LINUX => LINUX}/inc/SanityCheck.h | 8 +-
.../{HAL_LINUX => LINUX}/include/Arduino.h | 10 +-
.../include/pinmapping.cpp | 5 +-
.../{HAL_LINUX => LINUX}/include/pinmapping.h | 4 +-
.../HAL/{HAL_LINUX => LINUX}/include/serial.h | 6 +-
.../src/HAL/{HAL_LINUX => LINUX}/main.cpp | 5 +-
.../src/HAL/{HAL_LINUX => LINUX}/pinsDebug.h | 4 +-
.../HAL/{HAL_LINUX => LINUX}/servo_private.h | 4 +-
.../src/HAL/{HAL_LINUX => LINUX}/spi_pins.h | 6 +-
.../src/HAL/{HAL_LINUX => LINUX}/timers.cpp | 6 +-
.../src/HAL/{HAL_LINUX => LINUX}/timers.h | 24 +-
.../src/HAL/{HAL_LINUX => LINUX}/watchdog.cpp | 5 +-
.../src/HAL/{HAL_LINUX => LINUX}/watchdog.h | 4 +-
.../{HAL_LPC1768 => LPC1768}/DebugMonitor.cpp | 16 +-
.../src/HAL/{HAL_LPC1768 => LPC1768}/HAL.cpp | 13 +-
.../src/HAL/{HAL_LPC1768 => LPC1768}/HAL.h | 62 +-
.../HAL/{HAL_LPC1768 => LPC1768}/HAL_SPI.cpp | 8 +-
.../{HAL_LPC1768 => LPC1768}/MarlinSerial.cpp | 13 +-
.../{HAL_LPC1768 => LPC1768}/MarlinSerial.h | 11 +-
.../src/HAL/{HAL_LPC1768 => LPC1768}/Servo.h | 8 +-
.../eeprom_flash.cpp} | 39 +-
.../eeprom_sdcard.cpp} | 34 +-
.../Marlin/src/HAL/LPC1768/eeprom_wired.cpp | 81 +
.../endstop_interrupts.h | 18 +-
.../HAL/{HAL_LPC1768 => LPC1768}/fast_pwm.cpp | 7 +-
.../src/HAL/{HAL_LPC1768 => LPC1768}/fastio.h | 8 +-
.../src/HAL/LPC1768/inc/Conditionals_LCD.h | 22 +
.../src/HAL/LPC1768/inc/Conditionals_adv.h | 22 +
.../src/HAL/LPC1768/inc/Conditionals_post.h | 28 +
.../Marlin/src/HAL/LPC1768/inc/SanityCheck.h | 259 ++
.../{HAL_LPC1768 => LPC1768}/include/SPI.h | 8 +-
.../include/digipot_mcp4451_I2C_routines.c | 50 +-
.../include/digipot_mcp4451_I2C_routines.h | 43 +
.../Marlin/src/HAL/LPC1768/include/i2c_util.c | 70 +
.../include/i2c_util.h} | 33 +-
.../src/HAL/{HAL_LPC1768 => LPC1768}/main.cpp | 24 +-
.../HAL/{HAL_LPC1768 => LPC1768}/pinsDebug.h | 4 +-
.../HAL/{HAL_LPC1768 => LPC1768}/spi_pins.h | 6 +-
.../HAL/{HAL_LPC1768 => LPC1768}/timers.cpp | 5 +-
.../src/HAL/{HAL_LPC1768 => LPC1768}/timers.h | 48 +-
.../u8g/LCD_I2C_routines.cpp | 75 +-
.../u8g/LCD_I2C_routines.h | 8 +-
.../u8g/LCD_defines.h | 4 +-
.../{HAL_LPC1768 => LPC1768}/u8g/LCD_delay.h | 8 +-
.../u8g/LCD_pin_routines.c | 4 +-
.../u8g/LCD_pin_routines.h | 4 +-
.../u8g/u8g_com_HAL_LPC1768_hw_spi.cpp | 4 +-
.../u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp | 6 +-
.../u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp | 4 +-
.../u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp | 4 +-
.../u8g/u8g_com_HAL_LPC1768_sw_spi.cpp | 20 +-
.../src/HAL/LPC1768/upload_extra_script.py | 145 +
.../{HAL_LPC1768 => LPC1768}/usb_serial.cpp | 7 +-
.../HAL/{HAL_LPC1768 => LPC1768}/watchdog.cpp | 6 +-
.../HAL/{HAL_LPC1768 => LPC1768}/watchdog.h | 4 +-
.../win_usb_driver/lpc176x_usb_driver.inf | 0
.../src/HAL/{HAL_SAMD51 => SAMD51}/HAL.cpp | 163 +-
.../src/HAL/{HAL_SAMD51 => SAMD51}/HAL.h | 66 +-
.../HAL/{HAL_SAMD51 => SAMD51}/HAL_SPI.cpp | 7 +-
.../MarlinSerial_AGCM4.cpp | 5 +-
.../MarlinSerial_AGCM4.h | 4 +-
.../Marlin/src/HAL/SAMD51/QSPIFlash.cpp | 78 +
.../Marlin/src/HAL/SAMD51/QSPIFlash.h | 51 +
.../src/HAL/{HAL_SAMD51 => SAMD51}/SAMD51.h | 4 +-
.../src/HAL/{HAL_SAMD51 => SAMD51}/Servo.cpp | 14 +-
.../HAL/{HAL_SAMD51 => SAMD51}/ServoTimers.h | 4 +-
.../Marlin/src/HAL/SAMD51/eeprom_flash.cpp | 95 +
.../Marlin/src/HAL/SAMD51/eeprom_qspi.cpp | 71 +
.../Marlin/src/HAL/SAMD51/eeprom_wired.cpp | 74 +
.../endstop_interrupts.h | 49 +-
.../src/HAL/{HAL_SAMD51 => SAMD51}/fastio.h | 13 +-
.../src/HAL/SAMD51/inc/Conditionals_LCD.h | 22 +
.../src/HAL/SAMD51/inc/Conditionals_adv.h | 22 +
.../src/HAL/SAMD51/inc/Conditionals_post.h | 28 +
.../{HAL_SAMD51 => SAMD51}/inc/SanityCheck.h | 16 +-
.../HAL/{HAL_SAMD51 => SAMD51}/pinsDebug.h | 5 +-
.../src/HAL/{HAL_SAMD51 => SAMD51}/spi_pins.h | 4 +-
.../Marlin/src/HAL/SAMD51/timers.cpp | 168 +
.../src/HAL/{HAL_SAMD51 => SAMD51}/timers.h | 75 +-
.../HAL/{HAL_SAMD51 => SAMD51}/watchdog.cpp | 5 +-
.../src/HAL/{HAL_SAMD51 => SAMD51}/watchdog.h | 4 +-
.../src/HAL/{HAL_STM32 => STM32}/HAL.cpp | 68 +-
.../Marlin/src/HAL/{HAL_STM32 => STM32}/HAL.h | 103 +-
.../Marlin/src/HAL/STM32/HAL_SPI.cpp | 230 ++
.../Marlin/src/HAL/STM32/MarlinSerial.cpp | 88 +
.../Marlin/src/HAL/STM32/MarlinSerial.h | 60 +
.../src/HAL/{HAL_STM32 => STM32}/README.md | 0
.../src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp | 286 ++
.../Marlin/src/HAL/STM32/Servo.cpp | 110 +
.../src/HAL/{HAL_STM32 => STM32}/Servo.h | 25 +-
.../{HAL_STM32 => STM32}/SoftwareSerial.cpp | 53 +-
.../HAL/{HAL_STM32 => STM32}/SoftwareSerial.h | 15 +-
.../eeprom_flash.cpp} | 91 +-
.../Marlin/src/HAL/STM32/eeprom_sdcard.cpp | 92 +
.../Marlin/src/HAL/STM32/eeprom_sram.cpp | 68 +
.../Marlin/src/HAL/STM32/eeprom_wired.cpp | 81 +
.../Marlin/src/HAL/STM32/endstop_interrupts.h | 49 +
.../src/HAL/{HAL_STM32 => STM32}/fastio.cpp | 6 +-
.../src/HAL/{HAL_STM32 => STM32}/fastio.h | 9 +-
.../src/HAL/STM32/inc/Conditionals_LCD.h | 22 +
.../src/HAL/STM32/inc/Conditionals_adv.h | 22 +
.../src/HAL/STM32/inc/Conditionals_post.h | 29 +
.../Marlin/src/HAL/STM32/inc/SanityCheck.h | 56 +
.../src/HAL/{HAL_STM32 => STM32}/pinsDebug.h | 4 +-
.../pinsDebug_STM32GENERIC.h | 8 +-
.../pinsDebug_STM32duino.h | 4 +-
.../src/HAL/{HAL_STM32 => STM32}/pins_Xref.h | 4 +-
.../src/HAL/{HAL_STM32 => STM32}/spi_pins.h | 4 +-
.../src/HAL/{HAL_STM32 => STM32}/timers.cpp | 85 +-
.../src/HAL/{HAL_STM32 => STM32}/timers.h | 84 +-
.../Marlin/src/HAL/STM32/usb_serial.cpp | 55 +
.../Marlin/src/HAL/STM32/usb_serial.h | 21 +
.../src/HAL/{HAL_STM32 => STM32}/watchdog.cpp | 5 +-
.../src/HAL/{HAL_STM32 => STM32}/watchdog.h | 4 +-
.../src/HAL/{HAL_STM32F1 => STM32F1}/HAL.cpp | 68 +-
.../src/HAL/{HAL_STM32F1 => STM32F1}/HAL.h | 81 +-
.../HAL/{HAL_STM32F1 => STM32F1}/HAL_SPI.cpp | 4 +-
.../HAL/{HAL_STM32F1 => STM32F1}/README.md | 0
.../src/HAL/{HAL_STM32F1 => STM32F1}/SPI.cpp | 8 +-
.../src/HAL/{HAL_STM32F1 => STM32F1}/SPI.h | 7 +-
.../HAL/{HAL_STM32F1 => STM32F1}/Servo.cpp | 11 +-
.../src/HAL/{HAL_STM32F1 => STM32F1}/Servo.h | 4 +-
.../SoftwareSerial.cpp | 4 +-
.../{HAL_STM32F1 => STM32F1}/SoftwareSerial.h | 4 +-
.../{HAL_STM32F1 => STM32F1}/build_flags.py | 2 +-
.../dogm/u8g_com_stm32duino_fsmc.cpp | 21 +-
.../dogm/u8g_com_stm32duino_swspi.cpp | 22 +-
.../Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp | 81 +
.../eeprom_flash.cpp} | 29 +-
.../Marlin/src/HAL/STM32F1/eeprom_if_iic.cpp | 51 +
.../eeprom_sdcard.cpp} | 76 +-
.../eeprom_wired.cpp} | 32 +-
.../endstop_interrupts.h | 55 +-
.../src/HAL/{HAL_STM32F1 => STM32F1}/fastio.h | 4 +-
.../src/HAL/STM32F1/inc/Conditionals_LCD.h | 27 +
.../src/HAL/STM32F1/inc/Conditionals_adv.h | 22 +
.../src/HAL/STM32F1/inc/Conditionals_post.h | 34 +
.../inc/SanityCheck.h | 24 +-
.../maple_win_usb_driver/maple_serial.inf | 0
.../HAL/{HAL_STM32F1 => STM32F1}/msc_sd.cpp | 8 +-
.../src/HAL/{HAL_STM32F1 => STM32F1}/msc_sd.h | 4 +-
.../{HAL_STM32F1 => STM32F1}/onboard_sd.cpp | 8 +-
.../HAL/{HAL_STM32F1 => STM32F1}/onboard_sd.h | 2 +-
.../HAL/{HAL_STM32F1 => STM32F1}/pinsDebug.h | 8 +-
.../src/HAL/{HAL_STM32F1 => STM32F1}/sdio.cpp | 27 +-
.../src/HAL/{HAL_STM32F1 => STM32F1}/sdio.h | 14 +-
.../HAL/{HAL_STM32F1 => STM32F1}/spi_pins.h | 4 +-
.../HAL/{HAL_STM32F1 => STM32F1}/timers.cpp | 22 +-
.../src/HAL/{HAL_STM32F1 => STM32F1}/timers.h | 49 +-
.../HAL/{HAL_STM32F1 => STM32F1}/watchdog.cpp | 4 +-
.../HAL/{HAL_STM32F1 => STM32F1}/watchdog.h | 4 +-
.../{HAL_STM32_F4_F7 => STM32_F4_F7}/HAL.cpp | 5 +-
.../{HAL_STM32_F4_F7 => STM32_F4_F7}/HAL.h | 84 +-
.../HAL_SPI.cpp | 11 +-
.../README.md | 0
.../STM32F4/README.md | 0
.../STM32F4/timers.cpp | 8 +-
.../STM32F4/timers.h | 34 +-
.../STM32F7/README.md | 0
.../STM32F7/TMC2660.cpp | 2 +-
.../STM32F7/TMC2660.h | 0
.../STM32F7/timers.cpp | 8 +-
.../STM32F7/timers.h | 24 +-
.../Servo.cpp | 9 +-
.../{HAL_STM32_F4_F7 => STM32_F4_F7}/Servo.h | 4 +-
.../eeprom_emul.cpp | 14 +-
.../eeprom_emul.h | 1 -
.../eeprom_flash.cpp} | 125 +-
.../eeprom_wired.cpp} | 32 +-
.../src/HAL/STM32_F4_F7/endstop_interrupts.h | 49 +
.../{HAL_STM32_F4_F7 => STM32_F4_F7}/fastio.h | 4 +-
.../HAL/STM32_F4_F7/inc/Conditionals_LCD.h | 22 +
.../HAL/STM32_F4_F7/inc/Conditionals_adv.h | 22 +
.../HAL/STM32_F4_F7/inc/Conditionals_post.h | 29 +
.../inc/SanityCheck.h | 8 +-
.../pinsDebug.h | 8 +-
.../spi_pins.h | 4 +-
.../{HAL_STM32_F4_F7 => STM32_F4_F7}/timers.h | 4 +-
.../watchdog.cpp | 5 +-
.../watchdog.h | 4 +-
.../{HAL_TEENSY31_32 => TEENSY31_32}/HAL.cpp | 4 +-
.../{HAL_TEENSY31_32 => TEENSY31_32}/HAL.h | 12 +-
.../HAL_SPI.cpp | 4 +-
.../Servo.cpp | 8 +-
.../{HAL_TEENSY31_32 => TEENSY31_32}/Servo.h | 4 +-
.../eeprom.cpp} | 27 +-
.../endstop_interrupts.h | 48 +-
.../{HAL_TEENSY31_32 => TEENSY31_32}/fastio.h | 9 +-
.../HAL/TEENSY31_32/inc/Conditionals_LCD.h | 22 +
.../HAL/TEENSY31_32/inc/Conditionals_adv.h | 22 +
.../inc/Conditionals_post.h | 8 +-
.../inc/SanityCheck.h | 8 +-
.../pinsDebug.h | 0
.../spi_pins.h | 4 +-
.../timers.cpp | 7 +-
.../{HAL_TEENSY31_32 => TEENSY31_32}/timers.h | 24 +-
.../watchdog.cpp | 5 +-
.../watchdog.h | 4 +-
.../{HAL_TEENSY35_36 => TEENSY35_36}/HAL.cpp | 6 +-
.../{HAL_TEENSY35_36 => TEENSY35_36}/HAL.h | 13 +-
.../HAL_SPI.cpp | 4 +-
.../Servo.cpp | 8 +-
.../{HAL_TEENSY35_36 => TEENSY35_36}/Servo.h | 4 +-
.../eeprom.cpp} | 29 +-
.../endstop_interrupts.h | 54 +-
.../{HAL_TEENSY35_36 => TEENSY35_36}/fastio.h | 9 +-
.../HAL/TEENSY35_36/inc/Conditionals_LCD.h | 22 +
.../HAL/TEENSY35_36/inc/Conditionals_adv.h | 22 +
.../HAL/TEENSY35_36/inc/Conditionals_post.h | 26 +
.../inc/SanityCheck.h | 8 +-
.../pinsDebug.h | 4 +-
.../spi_pins.h | 4 +-
.../timers.cpp | 7 +-
.../{HAL_TEENSY35_36 => TEENSY35_36}/timers.h | 24 +-
.../watchdog.cpp | 5 +-
.../watchdog.h | 4 +-
.../Marlin/src/HAL/platforms.h | 32 +-
.../Marlin/src/HAL/shared/Delay.h | 23 +-
.../Marlin/src/HAL/shared/HAL_SPI.h | 4 +-
.../Marlin/src/HAL/shared/HAL_ST7920.h | 8 +-
.../Marlin/src/HAL/shared/HAL_spi_L6470.cpp | 81 +-
.../Marlin/src/HAL/shared/Marduino.h | 4 +-
.../Marlin/src/HAL/shared/MarlinSerial.h | 60 -
.../src/HAL/shared/backtrace/backtrace.cpp | 7 +-
.../src/HAL/shared/backtrace/backtrace.h | 4 +-
.../src/HAL/shared/backtrace/unwarm_thumb.cpp | 2 +-
.../src/HAL/shared/backtrace/unwarmbytab.cpp | 2 +-
.../src/HAL/shared/backtrace/unwinder.h | 2 +-
...ersistent_store_api.cpp => eeprom_api.cpp} | 6 +-
.../{persistent_store_api.h => eeprom_api.h} | 24 +-
.../Marlin/src/HAL/shared/eeprom_i2c.cpp | 120 -
.../Marlin/src/HAL/shared/eeprom_if.h | 29 +
.../Marlin/src/HAL/shared/eeprom_if_i2c.cpp | 78 +
.../{eeprom_spi.cpp => eeprom_if_spi.cpp} | 63 +-
.../Marlin/src/HAL/shared/esp_wifi.cpp | 43 +
.../Marlin/src/HAL/shared/esp_wifi.h | 24 +
.../Marlin/src/HAL/shared/math_32bit.h | 4 +-
.../Marlin/src/HAL/shared/servo.cpp | 14 +-
.../Marlin/src/HAL/shared/servo.h | 18 +-
.../Marlin/src/HAL/shared/servo_private.h | 10 +-
.../marlin2.0 for Ender3/Marlin/src/Marlin.h | 381 --
.../Marlin/src/{Marlin.cpp => MarlinCore.cpp} | 749 ++--
.../Marlin/src/MarlinCore.h | 125 +
.../Marlin/src/core/boards.h | 259 +-
.../Marlin/src/core/debug_out.h | 22 +-
.../Marlin/src/core/debug_section.h | 49 +
.../Marlin/src/core/drivers.h | 243 +-
.../Marlin/src/core/language.h | 429 +-
.../Marlin/src/core/macros.h | 130 +-
.../Marlin/src/core/millis_t.h | 8 +-
.../Marlin/src/core/multi_language.h | 10 +-
.../Marlin/src/core/serial.cpp | 28 +-
.../Marlin/src/core/serial.h | 71 +-
.../Marlin/src/core/types.h | 61 +-
.../Marlin/src/core/utility.cpp | 140 +-
.../Marlin/src/core/utility.h | 20 +-
.../Marlin/src/feature/babystep.cpp | 90 +-
.../Marlin/src/feature/babystep.h | 47 +-
.../Marlin/src/feature/backlash.cpp | 6 +-
.../Marlin/src/feature/backlash.h | 26 +-
.../Marlin/src/feature/baricuda.cpp | 6 +-
.../Marlin/src/feature/baricuda.h | 4 +-
.../Marlin/src/feature/bedlevel/abl/abl.cpp | 37 +-
.../Marlin/src/feature/bedlevel/abl/abl.h | 4 +-
.../Marlin/src/feature/bedlevel/bedlevel.cpp | 60 +-
.../Marlin/src/feature/bedlevel/bedlevel.h | 4 +-
.../bedlevel/mbl/mesh_bed_leveling.cpp | 14 +-
.../feature/bedlevel/mbl/mesh_bed_leveling.h | 8 +-
.../Marlin/src/feature/bedlevel/ubl/ubl.cpp | 60 +-
.../Marlin/src/feature/bedlevel/ubl/ubl.h | 13 +-
.../src/feature/bedlevel/ubl/ubl_G29.cpp | 530 ++-
.../src/feature/bedlevel/ubl/ubl_motion.cpp | 6 +-
.../Marlin/src/feature/binary_protocol.cpp | 4 +-
.../Marlin/src/feature/binary_protocol.h | 22 +-
.../Marlin/src/feature/bltouch.cpp | 24 +-
.../Marlin/src/feature/bltouch.h | 24 +-
.../Marlin/src/feature/cancel_object.cpp | 4 +-
.../Marlin/src/feature/cancel_object.h | 4 +-
.../Marlin/src/feature/caselight.cpp | 12 +-
.../Marlin/src/feature/caselight.h | 4 +-
.../Marlin/src/feature/closedloop.cpp | 10 +-
.../Marlin/src/feature/closedloop.h | 15 +-
.../Marlin/src/feature/controllerfan.cpp | 90 +-
.../Marlin/src/feature/controllerfan.h | 54 +-
.../Marlin/src/feature/dac/dac_dac084s085.cpp | 2 +-
.../Marlin/src/feature/dac/dac_dac084s085.h | 4 +-
.../Marlin/src/feature/dac/dac_mcp4728.cpp | 10 +-
.../Marlin/src/feature/dac/dac_mcp4728.h | 22 +-
.../Marlin/src/feature/dac/stepper_dac.cpp | 18 +-
.../Marlin/src/feature/dac/stepper_dac.h | 4 +-
.../Marlin/src/feature/digipot/digipot.h | 4 +-
.../src/feature/digipot/digipot_mcp4018.cpp | 79 +-
.../src/feature/digipot/digipot_mcp4451.cpp | 50 +-
.../Marlin/src/feature/direct_stepping.cpp | 273 ++
.../Marlin/src/feature/direct_stepping.h | 137 +
.../{emergency_parser.cpp => e_parser.cpp} | 6 +-
.../{emergency_parser.h => e_parser.h} | 11 +-
...I2CPositionEncoder.cpp => encoder_i2c.cpp} | 56 +-
.../{I2CPositionEncoder.h => encoder_i2c.h} | 8 +-
.../Marlin/src/feature/fanmux.cpp | 4 +-
.../Marlin/src/feature/fanmux.h | 4 +-
.../Marlin/src/feature/filwidth.cpp | 6 +-
.../Marlin/src/feature/filwidth.h | 4 +-
.../Marlin/src/feature/fwretract.cpp | 41 +-
.../Marlin/src/feature/fwretract.h | 4 +-
.../Marlin/src/feature/host_actions.cpp | 121 +-
.../Marlin/src/feature/host_actions.h | 22 +-
.../Marlin/src/feature/hotend_idle.cpp | 89 +
.../Marlin/src/feature/hotend_idle.h | 37 +
.../Marlin/src/feature/joystick.cpp | 40 +-
.../Marlin/src/feature/joystick.h | 20 +-
.../Marlin/src/feature/leds/blinkm.cpp | 4 +-
.../Marlin/src/feature/leds/blinkm.h | 4 +-
.../Marlin/src/feature/leds/leds.cpp | 22 +-
.../Marlin/src/feature/leds/leds.h | 15 +-
.../Marlin/src/feature/leds/neopixel.cpp | 32 +-
.../Marlin/src/feature/leds/neopixel.h | 31 +-
.../Marlin/src/feature/leds/pca9533.cpp | 127 +
.../Marlin/src/feature/leds/pca9533.h | 59 +
.../Marlin/src/feature/leds/pca9632.cpp | 4 +-
.../Marlin/src/feature/leds/pca9632.h | 4 +-
.../src/feature/leds/printer_event_leds.cpp | 12 +-
.../src/feature/leds/printer_event_leds.h | 6 +-
.../Marlin/src/feature/leds/tempstat.cpp | 9 +-
.../Marlin/src/feature/leds/tempstat.h | 4 +-
.../{Max7219_Debug_LEDs.cpp => max7219.cpp} | 206 +-
.../{Max7219_Debug_LEDs.h => max7219.h} | 19 +-
.../Marlin/src/feature/mixing.cpp | 22 +-
.../Marlin/src/feature/mixing.h | 54 +-
.../src/feature/{prusa_MMU2 => mmu2}/mmu2.cpp | 421 +-
.../src/feature/{prusa_MMU2 => mmu2}/mmu2.h | 36 +-
.../{prusa_MMU2 => mmu2}/serial-protocol.md | 0
.../Marlin/src/feature/pause.cpp | 307 +-
.../Marlin/src/feature/pause.h | 27 +-
.../Marlin/src/feature/power.cpp | 40 +-
.../Marlin/src/feature/power.h | 4 +-
.../Marlin/src/feature/power_monitor.cpp | 75 +
.../Marlin/src/feature/power_monitor.h | 140 +
...{power_loss_recovery.cpp => powerloss.cpp} | 264 +-
.../{power_loss_recovery.h => powerloss.h} | 77 +-
.../Marlin/src/feature/probe_temp_comp.cpp | 240 ++
.../Marlin/src/feature/probe_temp_comp.h | 147 +
.../Marlin/src/feature/runout.cpp | 49 +-
.../Marlin/src/feature/runout.h | 125 +-
.../Marlin/src/feature/snmm.cpp | 4 +-
.../Marlin/src/feature/snmm.h | 4 +-
.../Marlin/src/feature/solenoid.cpp | 6 +-
.../Marlin/src/feature/solenoid.h | 4 +-
.../Marlin/src/feature/spindle_laser.cpp | 84 +-
.../Marlin/src/feature/spindle_laser.h | 259 +-
.../Marlin/src/feature/spindle_laser_types.h | 53 +
.../Marlin/src/feature/tmc_util.cpp | 258 +-
.../Marlin/src/feature/tmc_util.h | 88 +-
.../Marlin/src/feature/touch/xpt2046.cpp | 100 +-
.../Marlin/src/feature/touch/xpt2046.h | 4 +-
.../Marlin/src/feature/twibus.cpp | 64 +-
.../Marlin/src/feature/twibus.h | 15 +-
.../Marlin/src/feature/z_stepper_align.cpp | 137 +
.../Marlin/src/feature/z_stepper_align.h | 41 +
.../Marlin/src/gcode/bedlevel/G26.cpp | 323 +-
.../Marlin/src/gcode/bedlevel/G35.cpp | 185 +
.../Marlin/src/gcode/bedlevel/G42.cpp | 19 +-
.../Marlin/src/gcode/bedlevel/M420.cpp | 63 +-
.../Marlin/src/gcode/bedlevel/abl/G29.cpp | 261 +-
.../Marlin/src/gcode/bedlevel/abl/M421.cpp | 47 +-
.../Marlin/src/gcode/bedlevel/mbl/G29.cpp | 24 +-
.../Marlin/src/gcode/bedlevel/mbl/M421.cpp | 8 +-
.../Marlin/src/gcode/bedlevel/ubl/G29.cpp | 4 +-
.../Marlin/src/gcode/bedlevel/ubl/M421.cpp | 14 +-
.../Marlin/src/gcode/calibrate/G28.cpp | 248 +-
.../Marlin/src/gcode/calibrate/G33.cpp | 49 +-
.../Marlin/src/gcode/calibrate/G34_M422.cpp | 335 +-
.../Marlin/src/gcode/calibrate/G425.cpp | 236 +-
.../Marlin/src/gcode/calibrate/G76_M871.cpp | 325 ++
.../Marlin/src/gcode/calibrate/M100.cpp | 27 +-
.../Marlin/src/gcode/calibrate/M12.cpp | 9 +-
.../Marlin/src/gcode/calibrate/M425.cpp | 25 +-
.../Marlin/src/gcode/calibrate/M48.cpp | 38 +-
.../Marlin/src/gcode/calibrate/M665.cpp | 12 +-
.../Marlin/src/gcode/calibrate/M666.cpp | 43 +-
.../Marlin/src/gcode/calibrate/M852.cpp | 6 +-
.../Marlin/src/gcode/config/M200-M205.cpp | 57 +-
.../Marlin/src/gcode/config/M217.cpp | 116 +-
.../Marlin/src/gcode/config/M218.cpp | 6 +-
.../Marlin/src/gcode/config/M220.cpp | 11 +-
.../Marlin/src/gcode/config/M221.cpp | 13 +-
.../Marlin/src/gcode/config/M281.cpp | 17 +-
.../Marlin/src/gcode/config/M301.cpp | 11 +-
.../Marlin/src/gcode/config/M302.cpp | 4 +-
.../Marlin/src/gcode/config/M304.cpp | 11 +-
.../Marlin/src/gcode/config/M305.cpp | 6 +-
.../Marlin/src/gcode/config/M43.cpp | 42 +-
.../Marlin/src/gcode/config/M540.cpp | 4 +-
.../Marlin/src/gcode/config/M575.cpp | 10 +-
.../Marlin/src/gcode/config/M672.cpp | 99 +
.../Marlin/src/gcode/config/M92.cpp | 8 +-
.../src/gcode/control/M108_M112_M410.cpp | 12 +-
.../Marlin/src/gcode/control/M111.cpp | 33 +-
.../Marlin/src/gcode/control/M120_M121.cpp | 4 +-
.../Marlin/src/gcode/control/M17_M18_M84.cpp | 36 +-
.../Marlin/src/gcode/control/M211.cpp | 10 +-
.../Marlin/src/gcode/control/M226.cpp | 6 +-
.../Marlin/src/gcode/control/M280.cpp | 4 +-
.../Marlin/src/gcode/control/M3-M5.cpp | 68 +-
.../Marlin/src/gcode/control/M350_M351.cpp | 6 +-
.../Marlin/src/gcode/control/M380_M381.cpp | 4 +-
.../Marlin/src/gcode/control/M400.cpp | 4 +-
.../Marlin/src/gcode/control/M42.cpp | 57 +-
.../Marlin/src/gcode/control/M605.cpp | 14 +-
.../Marlin/src/gcode/control/M7-M9.cpp | 4 +-
.../Marlin/src/gcode/control/M80_M81.cpp | 21 +-
.../Marlin/src/gcode/control/M85.cpp | 10 +-
.../Marlin/src/gcode/control/M997.cpp | 4 +-
.../Marlin/src/gcode/control/M999.cpp | 8 +-
.../Marlin/src/gcode/control/T.cpp | 20 +-
.../Marlin/src/gcode/eeprom/M500-M504.cpp | 40 +-
.../Marlin/src/gcode/feature/L6470/M122.cpp | 146 +-
.../Marlin/src/gcode/feature/L6470/M906.cpp | 356 +-
.../src/gcode/feature/L6470/M916-918.cpp | 534 ++-
.../Marlin/src/gcode/feature/advance/M900.cpp | 125 +-
.../src/gcode/feature/baricuda/M126-M129.cpp | 4 +-
.../Marlin/src/gcode/feature/camera/M240.cpp | 63 +-
.../Marlin/src/gcode/feature/cancel/M486.cpp | 4 +-
.../src/gcode/feature/caselight/M355.cpp | 4 +-
.../Marlin/src/gcode/feature/clean/G12.cpp | 24 +-
.../src/gcode/feature/controllerfan/M710.cpp | 81 +
.../src/gcode/feature/digipot/M907-M910.cpp | 26 +-
.../src/gcode/feature/filwidth/M404-M407.cpp | 6 +-
.../src/gcode/feature/fwretract/G10_G11.cpp | 4 +-
.../src/gcode/feature/fwretract/M207-M209.cpp | 4 +-
.../src/gcode/feature/i2c/M260_M261.cpp | 8 +-
.../Marlin/src/gcode/feature/leds/M150.cpp | 11 +-
.../Marlin/src/gcode/feature/leds/M7219.cpp | 8 +-
.../src/gcode/feature/macro/M810-M819.cpp | 4 +-
.../src/gcode/feature/mixing/M163-M165.cpp | 4 +-
.../Marlin/src/gcode/feature/mixing/M166.cpp | 6 +-
.../Marlin/src/gcode/feature/pause/G27.cpp | 4 +-
.../Marlin/src/gcode/feature/pause/G60.cpp | 58 +
.../Marlin/src/gcode/feature/pause/G61.cpp | 70 +
.../Marlin/src/gcode/feature/pause/M125.cpp | 34 +-
.../Marlin/src/gcode/feature/pause/M600.cpp | 38 +-
.../Marlin/src/gcode/feature/pause/M603.cpp | 4 +-
.../src/gcode/feature/pause/M701_M702.cpp | 42 +-
.../src/gcode/feature/power_monitor/M430.cpp | 70 +
.../src/gcode/feature/powerloss/M1000.cpp | 25 +-
.../src/gcode/feature/powerloss/M413.cpp | 9 +-
.../src/gcode/feature/prusa_MMU2/M403.cpp | 6 +-
.../Marlin/src/gcode/feature/runout/M412.cpp | 22 +-
.../src/gcode/feature/trinamic/M122.cpp | 18 +-
.../src/gcode/feature/trinamic/M569.cpp | 29 +-
.../src/gcode/feature/trinamic/M906.cpp | 30 +-
.../src/gcode/feature/trinamic/M911-M914.cpp | 60 +-
.../Marlin/src/gcode/gcode.cpp | 198 +-
.../Marlin/src/gcode/gcode.h | 340 +-
.../Marlin/src/gcode/geometry/G17-G19.cpp | 4 +-
.../Marlin/src/gcode/geometry/G53-G59.cpp | 4 +-
.../Marlin/src/gcode/geometry/G92.cpp | 12 +-
.../Marlin/src/gcode/geometry/M206_M428.cpp | 8 +-
.../Marlin/src/gcode/host/M110.cpp | 9 +-
.../Marlin/src/gcode/host/M113.cpp | 4 +-
.../Marlin/src/gcode/host/M114.cpp | 98 +-
.../Marlin/src/gcode/host/M115.cpp | 171 +-
.../Marlin/src/gcode/host/M118.cpp | 14 +-
.../Marlin/src/gcode/host/M119.cpp | 4 +-
.../Marlin/src/gcode/host/M16.cpp | 8 +-
.../Marlin/src/gcode/host/M360.cpp | 188 +
.../Marlin/src/gcode/host/M876.cpp | 8 +-
.../Marlin/src/gcode/lcd/M0_M1.cpp | 77 +-
.../Marlin/src/gcode/lcd/M117.cpp | 4 +-
.../Marlin/src/gcode/lcd/M145.cpp | 38 +-
.../Marlin/src/gcode/lcd/M250.cpp | 4 +-
.../Marlin/src/gcode/lcd/M300.cpp | 4 +-
.../Marlin/src/gcode/lcd/M73.cpp | 7 +-
.../Marlin/src/gcode/motion/G0_G1.cpp | 14 +-
.../Marlin/src/gcode/motion/G2_G3.cpp | 65 +-
.../Marlin/src/gcode/motion/G4.cpp | 6 +-
.../Marlin/src/gcode/motion/G5.cpp | 10 +-
.../Marlin/src/gcode/motion/G6.cpp | 61 +
.../Marlin/src/gcode/motion/G80.cpp | 4 +-
.../Marlin/src/gcode/motion/M290.cpp | 24 +-
.../Marlin/src/gcode/parser.cpp | 146 +-
.../Marlin/src/gcode/parser.h | 44 +-
.../Marlin/src/gcode/probe/G30.cpp | 24 +-
.../Marlin/src/gcode/probe/G31_G32.cpp | 8 +-
.../Marlin/src/gcode/probe/G38.cpp | 8 +-
.../Marlin/src/gcode/probe/M401_M402.cpp | 12 +-
.../Marlin/src/gcode/probe/M851.cpp | 51 +-
.../Marlin/src/gcode/probe/M951.cpp | 12 +-
.../Marlin/src/gcode/queue.cpp | 448 ++-
.../Marlin/src/gcode/queue.h | 59 +-
.../Marlin/src/gcode/scara/M360-M364.cpp | 6 +-
.../Marlin/src/gcode/sd/M1001.cpp | 100 +
.../Marlin/src/gcode/{sdcard => sd}/M20.cpp | 8 +-
.../src/gcode/{sdcard => sd}/M21_M22.cpp | 4 +-
.../Marlin/src/gcode/{sdcard => sd}/M23.cpp | 8 +-
.../src/gcode/{sdcard => sd}/M24_M25.cpp | 38 +-
.../Marlin/src/gcode/{sdcard => sd}/M26.cpp | 4 +-
.../Marlin/src/gcode/{sdcard => sd}/M27.cpp | 4 +-
.../src/gcode/{sdcard => sd}/M28_M29.cpp | 10 +-
.../Marlin/src/gcode/{sdcard => sd}/M30.cpp | 4 +-
.../Marlin/src/gcode/{sdcard => sd}/M32.cpp | 6 +-
.../Marlin/src/gcode/{sdcard => sd}/M33.cpp | 4 +-
.../Marlin/src/gcode/{sdcard => sd}/M34.cpp | 4 +-
.../Marlin/src/gcode/{sdcard => sd}/M524.cpp | 4 +-
.../Marlin/src/gcode/{sdcard => sd}/M928.cpp | 4 +-
.../Marlin/src/gcode/stats/M31.cpp | 4 +-
.../Marlin/src/gcode/stats/M75-M78.cpp | 6 +-
.../gcode/{temperature => temp}/M104_M109.cpp | 118 +-
.../src/gcode/{temperature => temp}/M105.cpp | 6 +-
.../gcode/{temperature => temp}/M106_M107.cpp | 40 +-
.../Marlin/src/gcode/temp/M140_M190.cpp | 138 +
.../gcode/{temperature => temp}/M141_M191.cpp | 30 +-
.../src/gcode/{temperature => temp}/M155.cpp | 6 +-
.../Marlin/src/gcode/temp/M303.cpp | 85 +
.../src/gcode/temperature/M140_M190.cpp | 72 -
.../Marlin/src/gcode/temperature/M303.cpp | 66 -
.../Marlin/src/gcode/units/G20_G21.cpp | 4 +-
.../Marlin/src/gcode/units/M149.cpp | 4 +-
.../Marlin/src/gcode/units/M82_M83.cpp | 4 +-
.../Marlin/src/inc/Conditionals_LCD.h | 333 +-
.../Marlin/src/inc/Conditionals_adv.h | 248 +-
.../Marlin/src/inc/Conditionals_post.h | 2151 ++++++----
.../Marlin/src/inc/MarlinConfig.h | 8 +-
.../Marlin/src/inc/MarlinConfigPre.h | 12 +-
.../Marlin/src/inc/SanityCheck.h | 1031 +++--
.../Marlin/src/inc/Version.h | 14 +-
.../src/lcd/HD44780/lcdprint_hd44780.cpp | 609 +--
.../src/lcd/HD44780/ultralcd_HD44780.cpp | 138 +-
.../Marlin/src/lcd/HD44780/ultralcd_HD44780.h | 35 +-
.../src/lcd/dogm/HAL_LCD_class_defines.h | 4 +-
.../Marlin/src/lcd/dogm/HAL_LCD_com_defines.h | 7 +-
.../Marlin/src/lcd/dogm/dogm_Bootscreen.h | 6 +-
.../Marlin/src/lcd/dogm/dogm_Statusscreen.h | 106 +-
.../lcd/dogm/fontdata/fontdata_6x9_marlin.h | 4 +-
.../lcd/dogm/fontdata/fontdata_ISO10646_1.h | 12 +-
.../src/lcd/dogm/fontdata/langdata_bg.h | 16 +-
.../src/lcd/dogm/fontdata/langdata_cz.h | 32 +-
.../src/lcd/dogm/fontdata/langdata_el.h | 22 +-
.../src/lcd/dogm/fontdata/langdata_el_gr.h | 20 +-
.../src/lcd/dogm/fontdata/langdata_hr.h | 10 +-
.../src/lcd/dogm/fontdata/langdata_hu.h | 15 +
.../src/lcd/dogm/fontdata/langdata_ko_KR.h | 65 +-
.../src/lcd/dogm/fontdata/langdata_pl.h | 19 +-
.../src/lcd/dogm/fontdata/langdata_ro.h | 9 +
.../src/lcd/dogm/fontdata/langdata_ru.h | 12 +-
.../src/lcd/dogm/fontdata/langdata_sk.h | 40 +-
.../src/lcd/dogm/fontdata/langdata_test.h | 164 +-
.../src/lcd/dogm/fontdata/langdata_tr.h | 13 +-
.../src/lcd/dogm/fontdata/langdata_uk.h | 24 +-
.../src/lcd/dogm/fontdata/langdata_vi.h | 95 +-
.../src/lcd/dogm/fontdata/langdata_zh_CN.h | 1128 ++++--
.../src/lcd/dogm/fontdata/langdata_zh_TW.h | 831 ++--
.../Marlin/src/lcd/dogm/lcdprint_u8g.cpp | 2 +-
.../src/lcd/dogm/status_screen_DOGM.cpp | 281 +-
.../lcd/dogm/status_screen_lite_ST7920.cpp | 74 +-
.../u8g_dev_ssd1306_sh1106_128x64_I2C.cpp | 4 +-
.../lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp | 4 +-
.../lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp | 12 +-
...8g_dev_tft_320x240_upscale_from_128x64.cpp | 481 ++-
.../lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp | 6 +-
.../Marlin/src/lcd/dogm/u8g_fontutf8.cpp | 2 -
.../Marlin/src/lcd/dogm/ultralcd_DOGM.cpp | 112 +-
.../Marlin/src/lcd/dogm/ultralcd_DOGM.h | 79 +-
.../dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp | 25 +-
.../lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h | 17 +-
.../Marlin/src/lcd/dwin/README.md | 7 +
.../Marlin/src/lcd/dwin/dwin.cpp | 3529 +++++++++++++++++
.../Marlin/src/lcd/dwin/dwin.h | 364 ++
.../Marlin/src/lcd/dwin/dwin_lcd.cpp | 302 ++
.../Marlin/src/lcd/dwin/dwin_lcd.h | 111 +
.../Marlin/src/lcd/dwin/rotary_encoder.cpp | 251 ++
.../Marlin/src/lcd/dwin/rotary_encoder.h | 105 +
.../extensible_ui/lib/dgus/DGUSDisplay.cpp | 1094 -----
.../lib/dgus/DGUSDisplayDefinition.cpp | 231 --
.../lib/ftdi_eve_touch_ui/config.h | 124 -
.../ftdi_eve_lib/basic/boards.h | 183 -
.../extended/unicode/western_char_set.cpp | 449 ---
.../lib/ftdi_eve_touch_ui/pin_mappings.h | 142 -
.../screens/advanced_settings_menu.cpp | 205 -
.../ftdi_eve_touch_ui/screens/main_menu.cpp | 148 -
.../ftdi_eve_touch_ui/screens/tune_menu.cpp | 164 -
.../lib/ftdi_eve_touch_ui/theme/colors.h | 149 -
.../extui/lib/anycubic/anycubic_serial.cpp | 290 ++
.../lcd/extui/lib/anycubic/anycubic_serial.h | 145 +
.../lcd/extui/lib/anycubic/anycubic_tft.cpp | 1066 +++++
.../src/lcd/extui/lib/anycubic/anycubic_tft.h | 114 +
.../src/lcd/extui/lib/dgus/DGUSDisplay.cpp | 273 ++
.../src/lcd/extui/lib/dgus/DGUSDisplay.h | 117 +
.../src/lcd/extui/lib/dgus/DGUSDisplayDef.h | 54 +
.../lcd/extui/lib/dgus/DGUSScreenHandler.cpp | 1140 ++++++
.../lib/dgus/DGUSScreenHandler.h} | 168 +-
.../lib/dgus/DGUSVPVariable.h | 6 +-
.../extui/lib/dgus/fysetc/DGUSDisplayDef.cpp | 486 +++
.../extui/lib/dgus/fysetc/DGUSDisplayDef.h | 294 ++
.../extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp | 485 +++
.../extui/lib/dgus/hiprecy/DGUSDisplayDef.h | 290 ++
.../extui/lib/dgus/origin/DGUSDisplayDef.cpp | 310 ++
.../lib/dgus/origin/DGUSDisplayDef.h} | 134 +-
.../archim2-flash/flash_storage.cpp | 15 +-
.../archim2-flash/flash_storage.h | 2 +-
.../archim2-flash/media_file_reader.cpp | 2 +-
.../archim2-flash/media_file_reader.h | 2 +-
.../lib/ftdi_eve_touch_ui/compat.h | 6 +-
.../lcd/extui/lib/ftdi_eve_touch_ui/config.h | 26 +
.../ftdi_eve_lib/LICENSE.txt | 8 +-
.../ftdi_eve_touch_ui/ftdi_eve_lib/README.md | 0
.../ftdi_eve_lib/basic/boards.h | 184 +
.../ftdi_eve_lib/basic/commands.cpp | 160 +-
.../ftdi_eve_lib/basic/commands.h | 2 +-
.../ftdi_eve_lib/basic/constants.h | 2 +-
.../ftdi_eve_lib/basic/display_list.h | 0
.../ftdi_eve_lib/basic/ftdi_basic.h | 2 +-
.../ftdi_eve_lib/basic/registers_ft800.h | 2 +-
.../ftdi_eve_lib/basic/registers_ft810.h | 2 +-
.../ftdi_eve_lib/basic/resolutions.h | 4 +-
.../ftdi_eve_lib/basic/spi.cpp | 52 +-
.../ftdi_eve_lib/basic/spi.h | 14 +-
.../ftdi_eve_touch_ui/ftdi_eve_lib/compat.h | 81 +-
.../ftdi_eve_lib/extended/bitmap_info.h | 2 +-
.../extended/command_processor.cpp | 2 +-
.../ftdi_eve_lib/extended/command_processor.h | 13 +-
.../ftdi_eve_lib/extended/dl_cache.cpp | 2 +-
.../ftdi_eve_lib/extended/dl_cache.h | 8 +-
.../ftdi_eve_lib/extended/event_loop.cpp | 19 +-
.../ftdi_eve_lib/extended/event_loop.h | 2 +-
.../ftdi_eve_lib/extended/ftdi_extended.h | 2 +-
.../ftdi_eve_lib/extended/grid_layout.h | 2 +-
.../ftdi_eve_lib/extended/polygon.h | 2 +-
.../ftdi_eve_lib/extended/rgb_t.h | 2 +-
.../ftdi_eve_lib/extended/screen_types.cpp | 2 +-
.../ftdi_eve_lib/extended/screen_types.h | 5 +-
.../ftdi_eve_lib/extended/sound_list.h | 6 +-
.../ftdi_eve_lib/extended/sound_player.cpp | 5 +-
.../ftdi_eve_lib/extended/sound_player.h | 2 +-
.../ftdi_eve_lib/extended/text_box.cpp | 2 +-
.../ftdi_eve_lib/extended/text_box.h | 2 +-
.../ftdi_eve_lib/extended/tiny_timer.cpp | 2 +-
.../ftdi_eve_lib/extended/tiny_timer.h | 2 +-
.../ftdi_eve_lib/extended/unicode/README.txt | 0
.../extended/unicode/font_bitmaps.cpp | 5 +-
.../extended/unicode/font_bitmaps.h | 2 +-
.../unicode/font_bitmaps/romfont_31.pbm | Bin
.../western_char_set_bitmap_31.png | Bin
.../western_char_set_bitmap_31.svg | 0
.../extended/unicode/font_size_t.cpp | 4 +-
.../extended/unicode/font_size_t.h | 2 +-
.../extended/unicode/standard_char_set.cpp | 4 +-
.../extended/unicode/standard_char_set.h | 2 +-
.../ftdi_eve_lib/extended/unicode/unicode.cpp | 4 +-
.../ftdi_eve_lib/extended/unicode/unicode.h | 2 +-
.../extended/unicode/western_char_set.cpp | 450 +++
.../extended/unicode/western_char_set.h | 2 +-
.../unicode/western_char_set_bitmap_31.h | 2 +-
.../ftdi_eve_lib/extras/bitmap2cpp.py | 2 +-
.../ftdi_eve_lib/extras/circular_progress.h | 2 +-
.../ftdi_eve_lib/extras/poly_ui.h | 8 +-
.../ftdi_eve_lib/extras/svg2cpp.py | 4 +-
.../ftdi_eve_lib/ftdi_eve_lib.h | 2 +-
.../ftdi_eve_touch_ui/language/language.cpp | 4 +-
.../lib/ftdi_eve_touch_ui/language/language.h | 2 +-
.../ftdi_eve_touch_ui/language/language_en.h | 18 +-
.../lib/ftdi_eve_touch_ui/marlin_events.cpp | 52 +-
.../lib/ftdi_eve_touch_ui/pin_mappings.h | 144 +
.../screens/about_screen.cpp | 86 +-
.../screens/advanced_settings_menu.cpp | 159 +
.../screens/alert_dialog_box.cpp | 2 +-
.../screens/backlash_compensation_screen.cpp | 2 +-
.../base_numeric_adjustment_screen.cpp | 18 +-
.../ftdi_eve_touch_ui/screens/base_screen.cpp | 10 +-
.../screens/bed_mesh_screen.cpp | 306 ++
.../screens/bio_advanced_settings.cpp | 20 +-
.../screens/bio_confirm_home_e.cpp | 14 +-
.../screens/bio_confirm_home_xyz.cpp | 12 +-
.../screens/bio_main_menu.cpp | 6 +-
.../screens/bio_printer_ui_landscape.h | 2 +-
.../screens/bio_printer_ui_portrait.h | 2 +-
.../screens/bio_printing_dialog_box.cpp | 16 +-
.../screens/bio_status_screen.cpp | 32 +-
.../screens/bio_tune_menu.cpp | 8 +-
.../ftdi_eve_touch_ui/screens/boot_screen.cpp | 18 +-
.../screens/case_light_screen.cpp | 2 +-
.../screens/change_filament_screen.cpp | 9 +-
.../confirm_abort_print_dialog_box.cpp | 2 +-
.../confirm_auto_calibration_dialog_box.cpp | 2 +-
.../confirm_erase_flash_dialog_box.cpp | 2 +-
.../confirm_start_print_dialog_box.cpp | 7 +-
.../confirm_user_request_alert_box.cpp | 2 +-
.../screens/default_acceleration_screen.cpp | 2 +-
.../screens/developer_menu.cpp | 2 +-
.../screens/dialog_box_base_class.cpp | 2 +-
.../screens/display_tuning_screen.cpp | 2 +-
.../screens/endstop_state_screen.cpp | 36 +-
.../screens/feedrate_percent_screen.cpp | 2 +-
.../screens/filament_menu.cpp | 2 +-
.../screens/filament_runout_screen.cpp | 6 +-
.../screens/files_screen.cpp | 11 +-
.../screens/interface_settings_screen.cpp | 24 +-
.../screens/interface_sounds_screen.cpp | 4 +-
.../ftdi_eve_touch_ui/screens/jerk_screen.cpp | 2 +-
.../screens/junction_deviation_screen.cpp | 4 +-
.../ftdi_eve_touch_ui/screens/kill_screen.cpp | 2 +-
.../screens/language_menu.cpp | 2 +-
.../screens/linear_advance_screen.cpp | 2 +-
.../ftdi_eve_touch_ui/screens/lock_screen.cpp | 20 +-
.../ftdi_eve_touch_ui/screens/main_menu.cpp | 169 +
.../screens/max_acceleration_screen.cpp | 16 +-
.../screens/max_velocity_screen.cpp | 10 +-
.../screens/media_player_screen.cpp | 2 +-
.../screens/move_axis_screen.cpp | 4 +-
.../screens/nozzle_offsets_screen.cpp | 4 +-
.../screens/nudge_nozzle_screen.cpp | 47 +-
.../screens/preheat_menu.cpp | 83 +
.../screens/preheat_timer_screen.cpp | 5 +-
.../screens/restore_failsafe_dialog_box.cpp | 2 +-
.../screens/save_settings_dialog_box.cpp | 2 +-
.../ftdi_eve_touch_ui/screens/screen_data.h | 8 +-
.../lib/ftdi_eve_touch_ui/screens/screens.cpp | 12 +-
.../lib/ftdi_eve_touch_ui/screens/screens.h | 52 +-
.../screens/spinner_dialog_box.cpp | 2 +-
.../screens/statistics_screen.cpp | 2 +-
.../screens/status_screen.cpp | 248 +-
.../stepper_bump_sensitivity_screen.cpp | 42 +-
.../screens/stepper_current_screen.cpp | 4 +-
.../screens/steps_screen.cpp | 2 +-
.../screens/stress_test_screen.cpp | 40 +-
.../screens/string_format.cpp | 2 +-
.../ftdi_eve_touch_ui/screens/string_format.h | 2 +-
.../screens/temperature_screen.cpp | 40 +-
.../screens/touch_calibration_screen.cpp | 8 +-
.../screens/touch_registers_screen.cpp | 2 +-
.../ftdi_eve_touch_ui/screens/tune_menu.cpp | 120 +
.../screens/widget_demo_screen.cpp | 2 +-
.../screens/z_offset_screen.cpp | 4 +-
.../lib/ftdi_eve_touch_ui/theme/bitmaps.h | 2 +-
.../lib/ftdi_eve_touch_ui/theme/colors.h | 177 +
.../lib/ftdi_eve_touch_ui/theme/fonts.h | 2 +-
.../theme/marlin_bootscreen_landscape.h | 6 +-
.../theme/marlin_bootscreen_portrait.h | 6 +-
.../lib/ftdi_eve_touch_ui/theme/sounds.cpp | 2 +-
.../lib/ftdi_eve_touch_ui/theme/sounds.h | 2 +-
.../lib/ftdi_eve_touch_ui/theme/theme.h | 2 +-
.../src/lcd/extui/lib/mks_ui/SPI_TFT.cpp | 338 ++
.../Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h | 57 +
.../src/lcd/extui/lib/mks_ui/W25Qxx.cpp | 395 ++
.../Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h | 124 +
.../src/lcd/extui/lib/mks_ui/draw_about.cpp | 126 +
.../src/lcd/extui/lib/mks_ui/draw_about.h | 34 +
.../lib/mks_ui/draw_acceleration_settings.cpp | 483 +++
.../lib/mks_ui/draw_acceleration_settings.h | 33 +
.../lib/mks_ui/draw_advance_settings.cpp | 140 +
.../extui/lib/mks_ui/draw_advance_settings.h | 33 +
.../extui/lib/mks_ui/draw_change_speed.cpp | 335 ++
.../lcd/extui/lib/mks_ui/draw_change_speed.h | 40 +
.../src/lcd/extui/lib/mks_ui/draw_dialog.cpp | 372 ++
.../src/lcd/extui/lib/mks_ui/draw_dialog.h | 83 +
.../extui/lib/mks_ui/draw_eeprom_settings.cpp | 237 ++
.../extui/lib/mks_ui/draw_eeprom_settings.h | 33 +
.../extui/lib/mks_ui/draw_error_message.cpp | 88 +
.../lcd/extui/lib/mks_ui/draw_error_message.h | 38 +
.../lcd/extui/lib/mks_ui/draw_extrusion.cpp | 377 ++
.../src/lcd/extui/lib/mks_ui/draw_extrusion.h | 39 +
.../src/lcd/extui/lib/mks_ui/draw_fan.cpp | 250 ++
.../src/lcd/extui/lib/mks_ui/draw_fan.h | 35 +
.../src/lcd/extui/lib/mks_ui/draw_home.cpp | 270 ++
.../src/lcd/extui/lib/mks_ui/draw_home.h | 34 +
.../extui/lib/mks_ui/draw_jerk_settings.cpp | 263 ++
.../lcd/extui/lib/mks_ui/draw_jerk_settings.h | 33 +
.../lcd/extui/lib/mks_ui/draw_language.cpp | 368 ++
.../src/lcd/extui/lib/mks_ui/draw_language.h | 34 +
.../extui/lib/mks_ui/draw_machine_para.cpp | 232 ++
.../lcd/extui/lib/mks_ui/draw_machine_para.h | 33 +
.../lib/mks_ui/draw_machine_settings.cpp | 241 ++
.../extui/lib/mks_ui/draw_machine_settings.h | 33 +
.../lcd/extui/lib/mks_ui/draw_manuaLevel.cpp | 281 ++
.../lcd/extui/lib/mks_ui/draw_manuaLevel.h | 34 +
.../lib/mks_ui/draw_max_feedrate_settings.cpp | 359 ++
.../lib/mks_ui/draw_max_feedrate_settings.h | 33 +
.../extui/lib/mks_ui/draw_motor_settings.cpp | 247 ++
.../extui/lib/mks_ui/draw_motor_settings.h | 33 +
.../lcd/extui/lib/mks_ui/draw_move_motor.cpp | 324 ++
.../lcd/extui/lib/mks_ui/draw_move_motor.h | 35 +
.../lcd/extui/lib/mks_ui/draw_number_key.cpp | 799 ++++
.../lcd/extui/lib/mks_ui/draw_number_key.h | 33 +
.../lcd/extui/lib/mks_ui/draw_operation.cpp | 326 ++
.../src/lcd/extui/lib/mks_ui/draw_operation.h | 34 +
.../extui/lib/mks_ui/draw_pause_message.cpp | 55 +
.../lcd/extui/lib/mks_ui/draw_pause_message.h | 33 +
.../extui/lib/mks_ui/draw_pause_position.cpp | 222 ++
.../extui/lib/mks_ui/draw_pause_position.h | 33 +
.../src/lcd/extui/lib/mks_ui/draw_preHeat.cpp | 387 ++
.../src/lcd/extui/lib/mks_ui/draw_preHeat.h | 37 +
.../lcd/extui/lib/mks_ui/draw_print_file.cpp | 621 +++
.../lcd/extui/lib/mks_ui/draw_print_file.h | 65 +
.../lcd/extui/lib/mks_ui/draw_printing.cpp | 443 +++
.../src/lcd/extui/lib/mks_ui/draw_printing.h | 52 +
.../lcd/extui/lib/mks_ui/draw_ready_print.cpp | 336 ++
.../lcd/extui/lib/mks_ui/draw_ready_print.h | 39 +
.../src/lcd/extui/lib/mks_ui/draw_set.cpp | 318 ++
.../src/lcd/extui/lib/mks_ui/draw_set.h | 34 +
.../extui/lib/mks_ui/draw_step_settings.cpp | 358 ++
.../lcd/extui/lib/mks_ui/draw_step_settings.h | 33 +
.../lib/mks_ui/draw_tmc_current_settings.cpp | 385 ++
.../lib/mks_ui/draw_tmc_current_settings.h | 34 +
.../mks_ui/draw_tmc_step_mode_settings.cpp | 478 +++
.../lib/mks_ui/draw_tmc_step_mode_settings.h | 33 +
.../src/lcd/extui/lib/mks_ui/draw_tool.cpp | 267 ++
.../src/lcd/extui/lib/mks_ui/draw_tool.h | 34 +
.../src/lcd/extui/lib/mks_ui/draw_ui.cpp | 1521 +++++++
.../Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h | 332 ++
.../lcd/extui/lib/mks_ui/gb2312_puhui16.cpp | 115 +
.../extui/lib/mks_ui/mks_hardware_test.cpp | 627 +++
.../lcd/extui/lib/mks_ui/mks_hardware_test.h | 33 +
.../src/lcd/extui/lib/mks_ui/pic_manager.cpp | 574 +++
.../src/lcd/extui/lib/mks_ui/pic_manager.h | 159 +
.../extui/lib/mks_ui/printer_operation.cpp | 217 +
.../lcd/extui/lib/mks_ui/printer_operation.h | 36 +
.../lcd/extui/lib/mks_ui/tft_Language_en.h | 748 ++++
.../lcd/extui/lib/mks_ui/tft_Language_fr.h | 286 ++
.../lcd/extui/lib/mks_ui/tft_Language_it.h | 281 ++
.../lcd/extui/lib/mks_ui/tft_Language_ru.h | 282 ++
.../lcd/extui/lib/mks_ui/tft_Language_s_cn.h | 479 +++
.../lcd/extui/lib/mks_ui/tft_Language_sp.h | 289 ++
.../lcd/extui/lib/mks_ui/tft_Language_t_cn.h | 480 +++
.../src/lcd/extui/lib/mks_ui/tft_fsmc.cpp | 273 ++
.../extui/lib/mks_ui/tft_fsmc.h} | 12 +-
.../lib/mks_ui/tft_lvgl_configuration.cpp | 761 ++++
.../lib/mks_ui/tft_lvgl_configuration.h} | 33 +-
.../extui/lib/mks_ui/tft_multi_language.cpp | 2614 ++++++++++++
.../lcd/extui/lib/mks_ui/tft_multi_language.h | 848 ++++
.../lcd/{extensible_ui => extui}/ui_api.cpp | 367 +-
.../src/lcd/{extensible_ui => extui}/ui_api.h | 54 +-
.../Marlin/src/lcd/extui_anycubic_tft.cpp | 104 +
.../Marlin/src/lcd/extui_dgus_lcd.cpp | 98 +-
.../Marlin/src/lcd/extui_example.cpp | 36 +-
.../Marlin/src/lcd/extui_malyan_lcd.cpp | 130 +-
.../Marlin/src/lcd/fontutils.cpp | 2 +-
.../Marlin/src/lcd/language/language_an.h | 46 +-
.../Marlin/src/lcd/language/language_bg.h | 47 +-
.../Marlin/src/lcd/language/language_ca.h | 63 +-
.../Marlin/src/lcd/language/language_cz.h | 87 +-
.../Marlin/src/lcd/language/language_da.h | 46 +-
.../Marlin/src/lcd/language/language_de.h | 125 +-
.../Marlin/src/lcd/language/language_el.h | 47 +-
.../Marlin/src/lcd/language/language_el_gr.h | 57 +-
.../Marlin/src/lcd/language/language_en.h | 182 +-
.../Marlin/src/lcd/language/language_es.h | 257 +-
.../Marlin/src/lcd/language/language_eu.h | 60 +-
.../Marlin/src/lcd/language/language_fi.h | 45 +-
.../Marlin/src/lcd/language/language_fr.h | 231 +-
.../Marlin/src/lcd/language/language_gl.h | 576 ++-
.../Marlin/src/lcd/language/language_hr.h | 45 +-
.../Marlin/src/lcd/language/language_hu.h | 638 +++
.../Marlin/src/lcd/language/language_it.h | 150 +-
.../src/lcd/language/language_jp_kana.h | 55 +-
.../Marlin/src/lcd/language/language_ko_KR.h | 35 +-
.../Marlin/src/lcd/language/language_nl.h | 81 +-
.../Marlin/src/lcd/language/language_pl.h | 170 +-
.../Marlin/src/lcd/language/language_pt.h | 47 +-
.../Marlin/src/lcd/language/language_pt_br.h | 159 +-
.../Marlin/src/lcd/language/language_ro.h | 645 +++
.../Marlin/src/lcd/language/language_ru.h | 736 +++-
.../Marlin/src/lcd/language/language_sk.h | 165 +-
.../Marlin/src/lcd/language/language_test.h | 20 +-
.../Marlin/src/lcd/language/language_tr.h | 271 +-
.../Marlin/src/lcd/language/language_uk.h | 786 +++-
.../Marlin/src/lcd/language/language_vi.h | 75 +-
.../Marlin/src/lcd/language/language_zh_CN.h | 373 +-
.../Marlin/src/lcd/language/language_zh_TW.h | 246 +-
.../Marlin/src/lcd/lcdprint.cpp | 38 +-
.../Marlin/src/lcd/lcdprint.h | 63 +-
.../Marlin/src/lcd/menu/game/brickout.cpp | 10 +-
.../Marlin/src/lcd/menu/game/brickout.h | 4 +-
.../Marlin/src/lcd/menu/game/game.cpp | 4 +-
.../Marlin/src/lcd/menu/game/game.h | 20 +-
.../Marlin/src/lcd/menu/game/invaders.cpp | 10 +-
.../Marlin/src/lcd/menu/game/invaders.h | 4 +-
.../Marlin/src/lcd/menu/game/maze.cpp | 6 +-
.../Marlin/src/lcd/menu/game/maze.h | 4 +-
.../Marlin/src/lcd/menu/game/snake.cpp | 18 +-
.../Marlin/src/lcd/menu/game/snake.h | 4 +-
.../Marlin/src/lcd/menu/game/types.h | 4 +-
.../Marlin/src/lcd/menu/menu.cpp | 221 +-
.../Marlin/src/lcd/menu/menu.h | 339 +-
.../Marlin/src/lcd/menu/menu_addon.h | 7 +-
.../Marlin/src/lcd/menu/menu_advanced.cpp | 386 +-
.../Marlin/src/lcd/menu/menu_backlash.cpp | 12 +-
.../Marlin/src/lcd/menu/menu_bed_corners.cpp | 60 +-
.../Marlin/src/lcd/menu/menu_bed_leveling.cpp | 42 +-
.../Marlin/src/lcd/menu/menu_cancelobject.cpp | 24 +-
.../src/lcd/menu/menu_configuration.cpp | 173 +-
.../Marlin/src/lcd/menu/menu_custom.cpp | 96 +-
.../src/lcd/menu/menu_delta_calibrate.cpp | 44 +-
.../Marlin/src/lcd/menu/menu_filament.cpp | 140 +-
.../Marlin/src/lcd/menu/menu_game.cpp | 6 +-
.../Marlin/src/lcd/menu/menu_info.cpp | 139 +-
.../Marlin/src/lcd/menu/menu_job_recovery.cpp | 13 +-
.../Marlin/src/lcd/menu/menu_led.cpp | 105 +-
.../Marlin/src/lcd/menu/menu_main.cpp | 145 +-
.../Marlin/src/lcd/menu/menu_media.cpp | 38 +-
.../Marlin/src/lcd/menu/menu_mixer.cpp | 32 +-
.../Marlin/src/lcd/menu/menu_mmu2.cpp | 13 +-
.../Marlin/src/lcd/menu/menu_mmu2.h | 4 +-
.../Marlin/src/lcd/menu/menu_motion.cpp | 192 +-
.../src/lcd/menu/menu_power_monitor.cpp | 62 +
.../src/lcd/menu/menu_spindle_laser.cpp | 26 +-
.../Marlin/src/lcd/menu/menu_temperature.cpp | 308 +-
.../Marlin/src/lcd/menu/menu_tmc.cpp | 103 +-
.../Marlin/src/lcd/menu/menu_tune.cpp | 147 +-
.../Marlin/src/lcd/menu/menu_ubl.cpp | 509 +--
.../Marlin/src/lcd/thermistornames.h | 18 +-
.../Marlin/src/lcd/ultralcd.cpp | 755 ++--
.../Marlin/src/lcd/ultralcd.h | 280 +-
.../Marlin/src/libs/BL24CXX.cpp | 273 ++
.../Marlin/src/libs/BL24CXX.h | 72 +
.../src/libs/L6470/000_l6470_read_me.md | 105 -
.../Marlin/src/libs/L6470/L6470_Marlin.cpp | 796 ----
.../Marlin/src/libs/L6470/L6470_Marlin.h | 72 -
.../Marlin/src/libs/L64XX/L64XX_Marlin.cpp | 936 +++++
.../Marlin/src/libs/L64XX/L64XX_Marlin.h | 139 +
.../Marlin/src/libs/L64XX/README.md | 98 +
.../Marlin/src/libs/bresenham.h | 4 +-
.../Marlin/src/libs/buzzer.cpp | 17 +-
.../Marlin/src/libs/buzzer.h | 4 +-
.../Marlin/src/libs/circularqueue.h | 4 +-
.../Marlin/src/libs/crc16.cpp | 4 +-
.../Marlin/src/libs/crc16.h | 4 +-
.../Marlin/src/libs/duration_t.h | 4 +-
.../Marlin/src/libs/hex_print_routines.cpp | 6 +-
.../Marlin/src/libs/hex_print_routines.h | 4 +-
.../Marlin/src/libs/least_squares_fit.cpp | 4 +-
.../Marlin/src/libs/least_squares_fit.h | 4 +-
.../Marlin/src/libs/nozzle.cpp | 108 +-
.../Marlin/src/libs/nozzle.h | 4 +-
.../Marlin/src/libs/numtostr.cpp | 127 +-
.../Marlin/src/libs/numtostr.h | 44 +-
.../Marlin/src/libs/private_spi.h | 4 +-
.../Marlin/src/libs/softspi.h | 11 +-
.../Marlin/src/libs/stopwatch.cpp | 41 +-
.../Marlin/src/libs/stopwatch.h | 8 +-
.../Marlin/src/libs/vector_3.cpp | 16 +-
.../Marlin/src/libs/vector_3.h | 4 +-
.../Marlin/src/module/configuration_store.cpp | 1461 ++++---
.../Marlin/src/module/configuration_store.h | 10 +-
.../Marlin/src/module/delta.cpp | 65 +-
.../Marlin/src/module/delta.h | 10 +-
.../Marlin/src/module/endstops.cpp | 374 +-
.../Marlin/src/module/endstops.h | 34 +-
.../Marlin/src/module/motion.cpp | 758 ++--
.../Marlin/src/module/motion.h | 110 +-
.../Marlin/src/module/planner.cpp | 1028 +++--
.../Marlin/src/module/planner.h | 429 +-
.../Marlin/src/module/planner_bezier.cpp | 7 +-
.../Marlin/src/module/planner_bezier.h | 4 +-
.../Marlin/src/module/printcounter.cpp | 59 +-
.../Marlin/src/module/printcounter.h | 14 +-
.../Marlin/src/module/probe.cpp | 296 +-
.../Marlin/src/module/probe.h | 280 +-
.../Marlin/src/module/scara.cpp | 12 +-
.../Marlin/src/module/scara.h | 4 +-
.../Marlin/src/module/servo.cpp | 8 +-
.../Marlin/src/module/servo.h | 73 +-
.../Marlin/src/module/speed_lookuptable.h | 4 +-
.../Marlin/src/module/stepper.cpp | 1425 ++++---
.../Marlin/src/module/stepper.h | 197 +-
.../Marlin/src/module/stepper/L6470.cpp | 143 -
.../Marlin/src/module/stepper/L6470.h | 176 -
.../Marlin/src/module/stepper/L64xx.cpp | 225 ++
.../Marlin/src/module/stepper/L64xx.h | 364 ++
.../Marlin/src/module/stepper/TMC26X.cpp | 26 +-
.../Marlin/src/module/stepper/TMC26X.h | 58 +-
.../Marlin/src/module/stepper/indirection.cpp | 18 +-
.../Marlin/src/module/stepper/indirection.h | 792 +++-
.../Marlin/src/module/stepper/trinamic.cpp | 294 +-
.../Marlin/src/module/stepper/trinamic.h | 106 +-
.../Marlin/src/module/temperature.cpp | 1247 +++---
.../Marlin/src/module/temperature.h | 318 +-
.../src/module/thermistor/thermistor_1.h | 6 +-
.../src/module/thermistor/thermistor_10.h | 6 +-
.../src/module/thermistor/thermistor_1010.h | 8 +-
.../src/module/thermistor/thermistor_1047.h | 14 +-
.../src/module/thermistor/thermistor_11.h | 6 +-
.../src/module/thermistor/thermistor_110.h | 8 +-
.../src/module/thermistor/thermistor_12.h | 6 +-
.../src/module/thermistor/thermistor_13.h | 6 +-
.../src/module/thermistor/thermistor_147.h | 8 +-
.../src/module/thermistor/thermistor_15.h | 6 +-
.../src/module/thermistor/thermistor_18.h | 6 +-
.../src/module/thermistor/thermistor_2.h | 8 +-
.../src/module/thermistor/thermistor_20.h | 8 +-
.../src/module/thermistor/thermistor_201.h | 8 +-
.../src/module/thermistor/thermistor_202.h | 69 +
.../src/module/thermistor/thermistor_21.h | 77 +
.../src/module/thermistor/thermistor_22.h | 72 +
.../src/module/thermistor/thermistor_23.h | 128 +
.../src/module/thermistor/thermistor_3.h | 6 +-
.../src/module/thermistor/thermistor_331.h | 6 +-
.../src/module/thermistor/thermistor_332.h | 50 +
.../src/module/thermistor/thermistor_4.h | 6 +-
.../src/module/thermistor/thermistor_5.h | 8 +-
.../src/module/thermistor/thermistor_501.h | 6 +-
.../src/module/thermistor/thermistor_502.h | 60 +
.../src/module/thermistor/thermistor_51.h | 6 +-
.../src/module/thermistor/thermistor_512.h | 6 +-
.../src/module/thermistor/thermistor_52.h | 8 +-
.../src/module/thermistor/thermistor_55.h | 8 +-
.../src/module/thermistor/thermistor_6.h | 6 +-
.../src/module/thermistor/thermistor_60.h | 6 +-
.../src/module/thermistor/thermistor_61.h | 6 +-
.../src/module/thermistor/thermistor_66.h | 6 +-
.../src/module/thermistor/thermistor_666.h | 4 +-
.../src/module/thermistor/thermistor_67.h | 6 +-
.../src/module/thermistor/thermistor_7.h | 6 +-
.../src/module/thermistor/thermistor_70.h | 6 +-
.../src/module/thermistor/thermistor_71.h | 6 +-
.../src/module/thermistor/thermistor_75.h | 6 +-
.../src/module/thermistor/thermistor_8.h | 6 +-
.../src/module/thermistor/thermistor_9.h | 6 +-
.../src/module/thermistor/thermistor_99.h | 6 +-
.../src/module/thermistor/thermistor_998.h | 6 +-
.../src/module/thermistor/thermistor_999.h | 6 +-
.../src/module/thermistor/thermistors.h | 194 +-
.../Marlin/src/module/tool_change.cpp | 797 ++--
.../Marlin/src/module/tool_change.h | 43 +-
.../Marlin/src/pins/esp32/pins_E4D.h | 90 +
.../Marlin/src/pins/esp32/pins_ESP32.h | 60 +-
.../Marlin/src/pins/esp32/pins_MRR_ESPA.h | 75 +-
.../Marlin/src/pins/esp32/pins_MRR_ESPE.h | 135 +-
.../Marlin/src/pins/linux/pins_RAMPS_LINUX.h | 474 +--
.../Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h | 114 +-
.../src/pins/lpc1768/pins_BIQU_B300_V1.0.h | 94 +-
.../src/pins/lpc1768/pins_BIQU_BQ111_A4.h | 85 +-
.../Marlin/src/pins/lpc1768/pins_BTT_SKR.h | 105 -
.../src/pins/lpc1768/pins_BTT_SKR_V1_1.h | 145 +-
.../src/pins/lpc1768/pins_BTT_SKR_V1_3.h | 294 +-
.../src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 247 +-
.../src/pins/lpc1768/pins_BTT_SKR_common.h | 117 +
.../src/pins/lpc1768/pins_GMARSH_X6_REV1.h | 138 +-
.../Marlin/src/pins/lpc1768/pins_MKS_SBASE.h | 244 +-
.../Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 258 +-
.../src/pins/lpc1768/pins_RAMPS_RE_ARM.h | 330 +-
.../src/pins/lpc1768/pins_SELENA_COMPACT.h | 95 +-
.../src/pins/lpc1769/pins_AZTEEG_X5_GT.h | 96 +-
.../src/pins/lpc1769/pins_AZTEEG_X5_MINI.h | 150 +-
.../pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h | 4 +-
.../pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h | 30 +
.../src/pins/lpc1769/pins_COHESION3D_MINI.h | 127 +-
.../src/pins/lpc1769/pins_COHESION3D_REMIX.h | 221 +-
.../Marlin/src/pins/lpc1769/pins_MKS_SGEN.h | 43 +-
.../src/pins/lpc1769/pins_SMOOTHIEBOARD.h | 86 +-
.../src/pins/lpc1769/pins_TH3D_EZBOARD.h | 128 +-
.../Marlin/src/pins/mega/pins_CHEAPTRONIC.h | 52 +-
.../Marlin/src/pins/mega/pins_CHEAPTRONICv2.h | 116 +-
.../Marlin/src/pins/mega/pins_CNCONTROLS_11.h | 167 +-
.../Marlin/src/pins/mega/pins_CNCONTROLS_12.h | 173 +-
.../Marlin/src/pins/mega/pins_CNCONTROLS_15.h | 116 +-
.../Marlin/src/pins/mega/pins_EINSTART-S.h | 72 +-
.../Marlin/src/pins/mega/pins_ELEFU_3.h | 108 +-
.../Marlin/src/pins/mega/pins_GT2560_REV_A.h | 134 +-
.../src/pins/mega/pins_GT2560_REV_A_PLUS.h | 8 +-
.../Marlin/src/pins/mega/pins_GT2560_V3.h | 120 +-
.../Marlin/src/pins/mega/pins_GT2560_V3_A20.h | 20 +-
.../Marlin/src/pins/mega/pins_GT2560_V3_MC2.h | 12 +-
.../Marlin/src/pins/mega/pins_HJC2560C_REV2.h | 133 +-
.../Marlin/src/pins/mega/pins_INTAMSYS40.h | 152 +
.../Marlin/src/pins/mega/pins_LEAPFROG.h | 70 +-
.../src/pins/mega/pins_LEAPFROG_XEED2015.h | 115 +
.../src/pins/mega/pins_MEGACONTROLLER.h | 117 +-
.../Marlin/src/pins/mega/pins_MEGATRONICS.h | 103 +-
.../Marlin/src/pins/mega/pins_MEGATRONICS_2.h | 121 +-
.../Marlin/src/pins/mega/pins_MEGATRONICS_3.h | 171 +-
.../src/pins/mega/pins_MIGHTYBOARD_REVE.h | 225 +-
.../Marlin/src/pins/mega/pins_MINITRONICS.h | 112 +-
.../Marlin/src/pins/mega/pins_OVERLORD.h | 104 +-
.../Marlin/src/pins/mega/pins_PICA.h | 153 +
.../Marlin/src/pins/mega/pins_PICAOLD.h | 28 +
.../Marlin/src/pins/mega/pins_SILVER_GATE.h | 94 +-
.../src/pins/mega/pins_WANHAO_ONEPLUS.h | 74 +-
.../Marlin/src/pins/pins.h | 848 ++--
.../Marlin/src/pins/pinsDebug.h | 187 +-
.../Marlin/src/pins/pinsDebug_list.h | 611 ++-
.../Marlin/src/pins/rambo/pins_EINSY_RAMBO.h | 131 +-
.../Marlin/src/pins/rambo/pins_EINSY_RETRO.h | 151 +-
.../Marlin/src/pins/rambo/pins_MINIRAMBO.h | 158 +-
.../Marlin/src/pins/rambo/pins_RAMBO.h | 214 +-
.../Marlin/src/pins/rambo/pins_SCOOVO_X9H.h | 146 +-
.../Marlin/src/pins/ramps/pins_3DRAG.h | 64 +-
.../Marlin/src/pins/ramps/pins_AZTEEG_X3.h | 36 +-
.../src/pins/ramps/pins_AZTEEG_X3_PRO.h | 111 +-
.../Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h | 14 +-
.../Marlin/src/pins/ramps/pins_BIQU_KFB_2.h | 4 +-
.../src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h | 61 +-
.../src/pins/ramps/pins_COPYMASTER_3D.h | 34 +
.../src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h | 74 +-
.../Marlin/src/pins/ramps/pins_FELIX2.h | 14 +-
.../src/pins/ramps/pins_FORMBOT_RAPTOR.h | 132 +-
.../src/pins/ramps/pins_FORMBOT_RAPTOR2.h | 32 +-
.../src/pins/ramps/pins_FORMBOT_TREX2PLUS.h | 146 +-
.../src/pins/ramps/pins_FORMBOT_TREX3.h | 140 +-
.../Marlin/src/pins/ramps/pins_FYSETC_F6_13.h | 285 +-
.../Marlin/src/pins/ramps/pins_FYSETC_F6_14.h | 50 +
.../Marlin/src/pins/ramps/pins_K8200.h | 4 +-
.../Marlin/src/pins/ramps/pins_K8400.h | 14 +-
.../Marlin/src/pins/ramps/pins_K8600.h | 127 +
.../Marlin/src/pins/ramps/pins_K8800.h | 84 +-
.../src/pins/ramps/pins_MAKEBOARD_MINI.h | 4 +-
.../{pins_MKS_BASE.h => pins_MKS_BASE_10.h} | 22 +-
.../Marlin/src/pins/ramps/pins_MKS_BASE_14.h | 51 +-
.../Marlin/src/pins/ramps/pins_MKS_BASE_15.h | 25 +-
.../Marlin/src/pins/ramps/pins_MKS_BASE_16.h | 59 +
.../src/pins/ramps/pins_MKS_BASE_HEROIC.h | 4 +-
.../src/pins/ramps/pins_MKS_BASE_common.h | 75 +
.../Marlin/src/pins/ramps/pins_MKS_GEN_13.h | 32 +-
.../Marlin/src/pins/ramps/pins_MKS_GEN_L.h | 4 +-
.../Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h | 36 +-
.../Marlin/src/pins/ramps/pins_ORTUR_4.h | 116 +
.../Marlin/src/pins/ramps/pins_RAMPS.h | 561 +--
.../Marlin/src/pins/ramps/pins_RAMPS_13.h | 5 +-
.../src/pins/ramps/pins_RAMPS_CREALITY.h | 36 +-
.../Marlin/src/pins/ramps/pins_RAMPS_DAGOMA.h | 16 +-
.../src/pins/ramps/pins_RAMPS_ENDER_4.h | 4 +-
.../Marlin/src/pins/ramps/pins_RAMPS_OLD.h | 81 +-
.../Marlin/src/pins/ramps/pins_RAMPS_PLUS.h | 26 +-
.../Marlin/src/pins/ramps/pins_RIGIDBOARD.h | 61 +-
.../src/pins/ramps/pins_RIGIDBOARD_V2.h | 16 +-
.../Marlin/src/pins/ramps/pins_RL200.h | 32 +-
.../Marlin/src/pins/ramps/pins_RUMBA.h | 165 +-
.../src/pins/ramps/pins_RUMBA_RAISE3D.h | 4 +-
.../src/pins/ramps/pins_SAINSMART_2IN1.h | 4 +-
.../Marlin/src/pins/ramps/pins_TANGO.h | 20 +-
.../src/pins/ramps/pins_TENLOG_D3_HERO.h | 185 +
.../src/pins/ramps/pins_TRIGORILLA_13.h | 13 +-
.../src/pins/ramps/pins_TRIGORILLA_14.h | 106 +-
.../src/pins/ramps/pins_TRONXY_V3_1_0.h | 4 +-
.../Marlin/src/pins/ramps/pins_TT_OSCAR.h | 465 +--
.../Marlin/src/pins/ramps/pins_ULTIMAIN_2.h | 106 +-
.../Marlin/src/pins/ramps/pins_ULTIMAKER.h | 129 +-
.../src/pins/ramps/pins_ULTIMAKER_OLD.h | 180 +-
.../Marlin/src/pins/ramps/pins_VORON.h | 22 +-
.../Marlin/src/pins/ramps/pins_ZRIB_V20.h | 68 +-
.../src/pins/ramps/pins_Z_BOLT_X_SERIES.h | 202 +-
.../Marlin/src/pins/sam/pins_ADSK.h | 70 +-
.../Marlin/src/pins/sam/pins_ALLIGATOR_R2.h | 142 +-
.../Marlin/src/pins/sam/pins_ARCHIM1.h | 163 +-
.../Marlin/src/pins/sam/pins_ARCHIM2.h | 192 +-
.../Marlin/src/pins/sam/pins_CNCONTROLS_15D.h | 138 +
.../Marlin/src/pins/sam/pins_DUE3DOM.h | 152 +-
.../Marlin/src/pins/sam/pins_DUE3DOM_MINI.h | 156 +-
.../Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h | 120 +-
.../Marlin/src/pins/sam/pins_RADDS.h | 245 +-
.../Marlin/src/pins/sam/pins_RAMPS4DUE.h | 5 +-
.../Marlin/src/pins/sam/pins_RAMPS_DUO.h | 39 +-
.../Marlin/src/pins/sam/pins_RAMPS_FD_V1.h | 170 +-
.../Marlin/src/pins/sam/pins_RAMPS_FD_V2.h | 6 +-
.../Marlin/src/pins/sam/pins_RAMPS_SMART.h | 35 +-
.../Marlin/src/pins/sam/pins_RURAMPS4D_11.h | 206 +-
.../Marlin/src/pins/sam/pins_RURAMPS4D_13.h | 194 +-
.../src/pins/sam/pins_ULTRATRONICS_PRO.h | 146 +-
.../Marlin/src/pins/samd/pins_RAMPS_144.h | 611 +++
.../Marlin/src/pins/sanguino/pins_ANET_10.h | 92 +-
.../Marlin/src/pins/sanguino/pins_AZTEEG_X1.h | 4 +-
.../src/pins/sanguino/pins_GEN3_MONOLITHIC.h | 42 +-
.../Marlin/src/pins/sanguino/pins_GEN3_PLUS.h | 47 +-
.../Marlin/src/pins/sanguino/pins_GEN6.h | 61 +-
.../src/pins/sanguino/pins_GEN6_DELUXE.h | 4 +-
.../Marlin/src/pins/sanguino/pins_GEN7_12.h | 83 +-
.../Marlin/src/pins/sanguino/pins_GEN7_13.h | 4 +-
.../Marlin/src/pins/sanguino/pins_GEN7_14.h | 63 +-
.../src/pins/sanguino/pins_GEN7_CUSTOM.h | 83 +-
.../Marlin/src/pins/sanguino/pins_MELZI.h | 4 +-
.../src/pins/sanguino/pins_MELZI_CREALITY.h | 65 +-
.../src/pins/sanguino/pins_MELZI_MAKR3D.h | 4 +-
.../src/pins/sanguino/pins_MELZI_MALYAN.h | 37 +-
.../src/pins/sanguino/pins_MELZI_TRONXY.h | 43 +-
.../Marlin/src/pins/sanguino/pins_MELZI_V2.h | 39 +
.../Marlin/src/pins/sanguino/pins_OMCA.h | 78 +-
.../Marlin/src/pins/sanguino/pins_OMCA_A.h | 54 +-
.../src/pins/sanguino/pins_SANGUINOLOLU_11.h | 242 +-
.../src/pins/sanguino/pins_SANGUINOLOLU_12.h | 4 +-
.../Marlin/src/pins/sanguino/pins_SETHI.h | 60 +-
.../Marlin/src/pins/sanguino/pins_STB_11.h | 4 +-
.../Marlin/src/pins/sensitive_pins.h | 194 +-
.../Marlin/src/pins/stm32/pins_ARMED.h | 198 -
.../Marlin/src/pins/stm32/pins_BEAST.h | 285 --
.../src/pins/stm32/pins_BLACK_STM32F407VE.h | 134 -
.../src/pins/stm32/pins_BTT_BTT002_V1_0.h | 228 --
.../src/pins/stm32/pins_BTT_SKR_E3_DIP.h | 226 --
.../src/pins/stm32/pins_BTT_SKR_MINI_E3.h | 182 -
.../src/pins/stm32/pins_BTT_SKR_MINI_V1_1.h | 210 -
.../src/pins/stm32/pins_BTT_SKR_PRO_V1_1.h | 268 --
.../Marlin/src/pins/stm32/pins_CHITU3D.h | 283 --
.../Marlin/src/pins/stm32/pins_FLYF407ZG.h | 242 --
.../src/pins/stm32/pins_FYSETC_AIO_II.h | 189 -
.../src/pins/stm32/pins_FYSETC_CHEETAH.h | 151 -
.../Marlin/src/pins/stm32/pins_FYSETC_S6.h | 238 --
.../src/pins/stm32/pins_GENERIC_STM32F4.h | 190 -
.../Marlin/src/pins/stm32/pins_GTM32_MINI.h | 230 --
.../Marlin/src/pins/stm32/pins_GTM32_PRO_VB.h | 230 --
.../Marlin/src/pins/stm32/pins_GTM32_REV_B.h | 232 --
.../src/pins/stm32/pins_JGAURORA_A5S_A1.h | 130 -
.../Marlin/src/pins/stm32/pins_LERDGE_K.h | 177 -
.../Marlin/src/pins/stm32/pins_LERDGE_X.h | 174 -
.../Marlin/src/pins/stm32/pins_LONGER3D_LK.h | 170 -
.../Marlin/src/pins/stm32/pins_MALYAN_M200.h | 92 -
.../Marlin/src/pins/stm32/pins_MKS_ROBIN.h | 158 -
.../Marlin/src/pins/stm32/pins_MKS_ROBIN2.h | 98 -
.../Marlin/src/pins/stm32/pins_MKS_ROBIN_E3.h | 202 -
.../src/pins/stm32/pins_MKS_ROBIN_E3D.h | 230 --
.../src/pins/stm32/pins_MKS_ROBIN_LITE.h | 137 -
.../src/pins/stm32/pins_MKS_ROBIN_LITE3.h | 153 -
.../src/pins/stm32/pins_MKS_ROBIN_MINI.h | 154 -
.../src/pins/stm32/pins_MKS_ROBIN_NANO.h | 137 -
.../src/pins/stm32/pins_MKS_ROBIN_PRO.h | 274 --
.../Marlin/src/pins/stm32/pins_MORPHEUS.h | 91 -
.../Marlin/src/pins/stm32/pins_REMRAM_V1.h | 133 -
.../Marlin/src/pins/stm32/pins_RUMBA32.h | 130 -
.../Marlin/src/pins/stm32/pins_STEVAL.h | 150 -
.../Marlin/src/pins/stm32/pins_STM32F1R.h | 261 --
.../Marlin/src/pins/stm32/pins_STM3R_MINI.h | 285 --
.../Marlin/src/pins/stm32/pins_THE_BORG.h | 185 -
.../Marlin/src/pins/stm32/pins_VAKE403D.h | 194 -
.../src/pins/stm32f0/pins_MALYAN_M200_V2.h | 31 +
.../src/pins/stm32f0/pins_MALYAN_M300.h | 88 +
.../src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h | 292 ++
.../pins_BTT_SKR_MINI_E3_V1_0.h | 12 +-
.../pins_BTT_SKR_MINI_E3_V1_2.h | 28 +-
.../pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h | 59 +
.../stm32f1/pins_BTT_SKR_MINI_E3_common.h | 240 ++
.../src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h | 217 +
.../src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h | 179 +
.../Marlin/src/pins/stm32f1/pins_CHITU3D.h | 284 ++
.../Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h | 225 ++
.../Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h | 231 ++
.../src/pins/stm32f1/pins_CREALITY_V4.h | 179 +
.../src/pins/stm32f1/pins_FYSETC_AIO_II.h | 196 +
.../src/pins/stm32f1/pins_FYSETC_CHEETAH.h | 177 +
.../pins_FYSETC_CHEETAH_V12.h | 24 +-
.../Marlin/src/pins/stm32f1/pins_GTM32_MINI.h | 241 ++
.../{stm32 => stm32f1}/pins_GTM32_MINI_A30.h | 141 +-
.../src/pins/stm32f1/pins_GTM32_PRO_VB.h | 241 ++
.../src/pins/stm32f1/pins_GTM32_REV_B.h | 238 ++
.../src/pins/stm32f1/pins_JGAURORA_A5S_A1.h | 132 +
.../src/pins/stm32f1/pins_LONGER3D_LK.h | 171 +
.../src/pins/stm32f1/pins_MALYAN_M200.h | 92 +
.../Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h | 199 +
.../src/pins/stm32f1/pins_MKS_ROBIN_E3.h | 36 +
.../src/pins/stm32f1/pins_MKS_ROBIN_E3D.h | 67 +
.../pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 188 +
.../src/pins/stm32f1/pins_MKS_ROBIN_LITE.h | 143 +
.../src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h | 151 +
.../src/pins/stm32f1/pins_MKS_ROBIN_MINI.h | 154 +
.../src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 273 ++
.../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 322 ++
.../src/pins/stm32f1/pins_MKS_ROBIN_PRO.h | 272 ++
.../Marlin/src/pins/stm32f1/pins_MORPHEUS.h | 91 +
.../Marlin/src/pins/stm32f1/pins_STM32F1R.h | 261 ++
.../Marlin/src/pins/stm32f1/pins_STM3R_MINI.h | 285 ++
.../src/pins/stm32f1/pins_TRIGORILLA_PRO.h | 157 +
.../Marlin/src/pins/stm32f4/pins_ARMED.h | 229 ++
.../Marlin/src/pins/stm32f4/pins_BEAST.h | 285 ++
.../src/pins/stm32f4/pins_BLACK_STM32F407VE.h | 159 +
.../src/pins/stm32f4/pins_BTT_BTT002_V1_0.h | 267 ++
.../src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 399 ++
.../src/pins/stm32f4/pins_BTT_SKR_PRO_V1_1.h | 30 +
.../src/pins/stm32f4/pins_BTT_SKR_PRO_V1_2.h | 30 +
.../pins/stm32f4/pins_BTT_SKR_PRO_common.h | 374 ++
.../Marlin/src/pins/stm32f4/pins_FLYF407ZG.h | 268 ++
.../Marlin/src/pins/stm32f4/pins_FYSETC_S6.h | 268 ++
.../src/pins/stm32f4/pins_GENERIC_STM32F4.h | 197 +
.../Marlin/src/pins/stm32f4/pins_LERDGE_K.h | 180 +
.../Marlin/src/pins/stm32f4/pins_LERDGE_S.h | 208 +
.../Marlin/src/pins/stm32f4/pins_LERDGE_X.h | 151 +
.../Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h | 101 +
.../src/pins/stm32f4/pins_RUMBA32_AUS3D.h | 78 +
.../src/pins/stm32f4/pins_RUMBA32_MKS.h | 92 +
.../src/pins/stm32f4/pins_RUMBA32_common.h | 183 +
.../src/pins/stm32f4/pins_STEVAL_3DP001V1.h | 359 ++
.../Marlin/src/pins/stm32f4/pins_VAKE403D.h | 195 +
.../Marlin/src/pins/stm32f7/pins_REMRAM_V1.h | 137 +
.../Marlin/src/pins/stm32f7/pins_THE_BORG.h | 183 +
.../Marlin/src/pins/teensy2/pins_5DPRINT.h | 74 +-
.../Marlin/src/pins/teensy2/pins_BRAINWAVE.h | 60 +-
.../src/pins/teensy2/pins_BRAINWAVE_PRO.h | 56 +-
.../src/pins/teensy2/pins_PRINTRBOARD.h | 98 +-
.../src/pins/teensy2/pins_PRINTRBOARD_REVF.h | 164 +-
.../Marlin/src/pins/teensy2/pins_SAV_MKI.h | 114 +-
.../Marlin/src/pins/teensy2/pins_TEENSY2.h | 85 +-
.../Marlin/src/pins/teensy2/pins_TEENSYLU.h | 82 +-
.../src/pins/teensy3/pins_TEENSY31_32.h | 90 +-
.../src/pins/teensy3/pins_TEENSY35_36.h | 100 +-
.../Marlin/src/sd/Sd2Card.cpp | 37 +-
.../Marlin/src/sd/Sd2Card.h | 4 +-
.../Marlin/src/sd/Sd2Card_sdio.h | 4 +-
.../Marlin/src/sd/SdBaseFile.cpp | 62 +-
.../Marlin/src/sd/SdBaseFile.h | 4 +-
.../Marlin/src/sd/SdFatConfig.h | 4 +-
.../Marlin/src/sd/SdFatStructs.h | 6 +-
.../Marlin/src/sd/SdFatUtil.cpp | 4 +-
.../Marlin/src/sd/SdFatUtil.h | 4 +-
.../Marlin/src/sd/SdFile.cpp | 4 +-
.../Marlin/src/sd/SdFile.h | 4 +-
.../Marlin/src/sd/SdInfo.h | 6 +-
.../Marlin/src/sd/SdVolume.cpp | 42 +-
.../Marlin/src/sd/SdVolume.h | 4 +-
.../Marlin/src/sd/cardreader.cpp | 349 +-
.../Marlin/src/sd/cardreader.h | 46 +-
.../sd/usb_flashdrive/Sd2Card_FlashDrive.cpp | 6 +-
.../sd/usb_flashdrive/Sd2Card_FlashDrive.h | 4 +-
.../src/sd/usb_flashdrive/lib-uhs2/Usb.cpp | 14 +-
.../src/sd/usb_flashdrive/lib-uhs2/Usb.h | 2 +-
.../src/sd/usb_flashdrive/lib-uhs2/UsbCore.h | 2 +-
.../src/sd/usb_flashdrive/lib-uhs2/address.h | 2 +-
.../usb_flashdrive/lib-uhs2/confdescparser.h | 16 +-
.../src/sd/usb_flashdrive/lib-uhs2/hexdump.h | 2 +-
.../src/sd/usb_flashdrive/lib-uhs2/macros.h | 2 +-
.../sd/usb_flashdrive/lib-uhs2/masstorage.cpp | 10 +-
.../sd/usb_flashdrive/lib-uhs2/masstorage.h | 8 +-
.../src/sd/usb_flashdrive/lib-uhs2/max3421e.h | 2 +-
.../sd/usb_flashdrive/lib-uhs2/message.cpp | 4 +-
.../src/sd/usb_flashdrive/lib-uhs2/message.h | 2 +-
.../sd/usb_flashdrive/lib-uhs2/parsetools.cpp | 2 +-
.../sd/usb_flashdrive/lib-uhs2/parsetools.h | 2 +-
.../src/sd/usb_flashdrive/lib-uhs2/printhex.h | 2 +-
.../src/sd/usb_flashdrive/lib-uhs2/settings.h | 4 +-
.../src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h | 10 +-
.../sd/usb_flashdrive/lib-uhs2/usbhost.cpp | 2 +-
.../src/sd/usb_flashdrive/lib-uhs2/usbhost.h | 2 +-
.../UHS_BULK_STORAGE/UHS_BULK_STORAGE.h | 4 +-
.../UHS_BULK_STORAGE_INLINE.h | 4 +-
.../UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h | 4 +-
.../lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h | 2 +-
.../lib-uhs3/UHS_host/UHS_UsbCore.h | 2 +-
.../lib-uhs3/UHS_host/UHS_address.h | 2 +-
.../lib-uhs3/UHS_host/UHS_hexdump.h | 2 +-
.../lib-uhs3/UHS_host/UHS_host.h | 2 +-
.../lib-uhs3/UHS_host/UHS_host_INLINE.h | 34 +-
.../lib-uhs3/UHS_host/UHS_macros.h | 2 +-
.../lib-uhs3/UHS_host/UHS_message.h | 2 +-
.../lib-uhs3/UHS_host/UHS_printf_HELPER.h | 2 +-
.../lib-uhs3/UHS_host/UHS_printhex.h | 2 +-
.../lib-uhs3/UHS_host/UHS_settings.h | 4 +-
.../lib-uhs3/UHS_host/UHS_usb_ch9.h | 10 +-
.../lib-uhs3/UHS_host/UHS_usbhost.h | 6 +-
.../lib-uhs3/UHS_host/UHS_util_INLINE.h | 2 +-
.../UHS_host/USB_HOST_SHIELD/UHS_max3421e.h | 2 +-
.../USB_HOST_SHIELD/USB_HOST_SHIELD.h | 2 +-
.../USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h | 2 +-
firmware/marlin2.0 for Ender3/README.md | 14 +-
.../buildroot/bin/.gitattributes | 1 +
.../buildroot/bin/backup_ramps | 7 -
.../buildroot/bin/build_marlin | 8 -
.../buildroot/bin/build_marlin_fail | 4 -
.../buildroot/bin/build_marlin_pio | 3 -
.../buildroot/bin/build_marlin_teensy35 | 3 -
.../buildroot/bin/bump_date | 17 -
.../buildroot/bin/env_backup | 14 -
.../buildroot/bin/env_clean | 12 -
.../buildroot/bin/env_restore | 26 -
.../buildroot/bin/format_code | 30 +
.../buildroot/bin/generate_version | 4 +-
.../buildroot/bin/opt_set | 3 +-
.../buildroot/bin/restore_configs | 12 +-
.../buildroot/bin/uncrust | 16 +
.../buildroot/bin/update_defaults | 3 -
.../buildroot/bin/use_example_configs | 20 +-
.../etc/udev/rules.d/99-platformio-udev.rules | 4 +-
.../PlatformIO/boards/BigTree_Btt002.json | 12 +-
.../{MKS_ROBIN2.json => BigTree_GTR_v1.json} | 12 +-
.../PlatformIO/boards/BigTree_SKR_Pro.json | 4 +-
.../share/PlatformIO/boards/CHITU_F103.json | 48 +
.../share/PlatformIO/boards/FLYF407ZG.json | 3 +-
.../share/PlatformIO/boards/LERDGE.json | 64 +
.../share/PlatformIO/boards/MEEB_3DP.json | 53 +
.../PlatformIO/boards/STEVAL_STM32F401VE.json | 65 +
.../PlatformIO/boards/blackSTM32F407VET6.json | 3 +-
.../share/PlatformIO/boards/malyanM200.json | 3 +-
.../share/PlatformIO/boards/malyanM200v2.json | 2 +-
.../ldscripts/STM32F103RC_MEEB_3DP.ld | 14 +
.../ldscripts/STM32F103RC_SKR_MINI_256K.ld | 2 +-
.../ldscripts/STM32F103RC_SKR_MINI_512K.ld | 2 +-
.../ldscripts/STM32F103RE_SKR_E3_DIP.ld | 2 +-
.../share/PlatformIO/ldscripts/chitu_f103.ld | 4 +-
.../share/PlatformIO/ldscripts/creality.ld | 14 +
.../ldscripts/fysetc_stm32f103rc.ld | 18 +
.../share/PlatformIO/ldscripts/lerdge.ld | 186 +
.../PlatformIO/ldscripts/mks_robin_mini.ld | 2 +-
.../PlatformIO/ldscripts/mks_robin_nano.ld | 2 +-
.../PlatformIO/scripts/STEVAL__F401XX.py | 9 +
.../scripts/STM32F103RC_MEEB_3DP.py | 59 +
.../PlatformIO/scripts/STM32F103RC_fysetc.py | 37 +-
.../scripts/STM32F103RE_SKR_E3_DIP.py | 4 +
.../scripts/STM32F1_create_variant.py | 34 +
.../share/PlatformIO/scripts/chitu_crypt.py | 18 +-
.../PlatformIO/scripts/common-dependencies.h | 67 +
.../PlatformIO/scripts/common-dependencies.py | 222 ++
.../copy_marlin_variant_to_framework.py | 34 +
.../share/PlatformIO/scripts/creality.py | 17 +
.../PlatformIO/scripts/download_mks_assets.py | 46 +
.../PlatformIO/scripts/fysetc_STM32S6.py | 24 +-
.../share/PlatformIO/scripts/lerdge.py | 46 +
.../PlatformIO/scripts/mks_robin_nano35.py | 40 +
.../share/PlatformIO/scripts/random-bin.py | 5 +
.../PlatformIO/scripts/stm32_bootloader.py | 30 +
.../variants/BIGTREE_BTT002/PeripheralPins.c | 17 +-
.../variants/BIGTREE_BTT002/PinNamesVar.h | 38 +-
.../variants/BIGTREE_BTT002/variant.h | 8 +-
.../PeripheralPins.c | 139 +-
.../variants/BIGTREE_GTR_V1/PinNamesVar.h | 50 +
.../hal_conf_extra.h | 0
.../ldscript.ld | 6 +-
.../variant.cpp | 0
.../{MKS_ROBIN2 => BIGTREE_GTR_V1}/variant.h | 45 +-
.../BIGTREE_SKR_PRO_1v1/PeripheralPins.c | 122 +-
.../BIGTREE_SKR_PRO_1v1/PinNamesVar.h | 38 +-
.../variants/BIGTREE_SKR_PRO_1v1/variant.h | 45 +-
.../PlatformIO/variants/CHITU_F103/board.cpp | 233 ++
.../variants/CHITU_F103/board/board.h | 240 ++
.../variants/CHITU_F103/ld/common.inc | 220 +
.../variants/CHITU_F103/ld/extra_libs.inc | 7 +
.../variants/CHITU_F103/ld/stm32f103z_dfu.ld | 29 +
.../variants/CHITU_F103/ld/stm32f103zc.ld | 27 +
.../variants/CHITU_F103/ld/stm32f103zd.ld | 27 +
.../variants/CHITU_F103/ld/stm32f103ze.ld | 29 +
.../variants/CHITU_F103/ld/vector_symbols.inc | 78 +
.../variants/CHITU_F103/pins_arduino.h | 2 +
.../PlatformIO/variants/CHITU_F103/variant.h | 17 +
.../variants/CHITU_F103/wirish/boards.cpp | 225 ++
.../CHITU_F103/wirish/boards_setup.cpp | 128 +
.../variants/CHITU_F103/wirish/start_c.c | 144 +
.../variants/CHITU_F103/wirish/syscalls.c | 176 +
.../variants/FLY_F407ZG/PinNamesVar.h | 60 +-
.../variants/FLY_F407ZG/ldscript.ld | 16 +-
.../PlatformIO/variants/FLY_F407ZG/variant.h | 8 +-
.../variants/FYSETC_S6/PeripheralPins.c | 2 +-
.../variants/FYSETC_S6/PinNamesVar.h | 20 +-
.../PlatformIO/variants/FYSETC_S6/variant.h | 7 +-
.../variants/LERDGE/PeripheralPins.c | 418 ++
.../PlatformIO/variants/LERDGE/PinNamesVar.h | 50 +
.../PlatformIO/variants/LERDGE/variant.cpp | 297 ++
.../PlatformIO/variants/LERDGE/variant.h | 238 ++
.../variants/MARLIN_F407VE/PinNamesVar.h | 60 +-
.../PlatformIO/variants/MEEB_3DP/board.cpp | 161 +
.../variants/MEEB_3DP/board/board.h | 125 +
.../variants/MEEB_3DP/ld/bootloader.ld | 18 +
.../variants/MEEB_3DP/ld/common.inc | 220 +
.../variants/MEEB_3DP/ld/extra_libs.inc | 7 +
.../PlatformIO/variants/MEEB_3DP/ld/flash.ld | 26 +
.../PlatformIO/variants/MEEB_3DP/ld/jtag.ld | 31 +
.../variants/MEEB_3DP/ld/mem-flash.inc | 5 +
.../variants/MEEB_3DP/ld/mem-jtag.inc | 5 +
.../variants/MEEB_3DP/ld/mem-ram.inc | 5 +
.../PlatformIO/variants/MEEB_3DP/ld/ram.ld | 25 +
.../variants/MEEB_3DP/ld/stm32f103rb.ld | 18 +
.../MEEB_3DP/ld/stm32f103rb_bootloader.ld | 17 +
.../variants/MEEB_3DP/ld/stm32f103rc.ld | 18 +
.../MEEB_3DP/ld/stm32f103rc_bootloader.ld} | 2 +-
.../variants/MEEB_3DP/ld/stm32f103re.ld | 18 +
.../variants/MEEB_3DP/ld/vector_symbols.inc | 78 +
.../variants/MEEB_3DP/pins_arduino.h | 2 +
.../PlatformIO/variants/MEEB_3DP/variant.h | 17 +
.../variants/MEEB_3DP/wirish/boards.cpp | 225 ++
.../variants/MEEB_3DP/wirish/boards_setup.cpp | 106 +
.../variants/MEEB_3DP/wirish/start_c.c | 95 +
.../variants/MEEB_3DP/wirish/syscalls.c | 176 +
.../variants/MKS_ROBIN2/PinNamesVar.h | 50 -
.../variants/STEVAL_F401VE/PeripheralPins.c | 274 ++
.../variants/STEVAL_F401VE/PinNamesVar.h | 33 +
.../variants/STEVAL_F401VE/hal_conf_custom.h | 496 +++
.../variants/STEVAL_F401VE/ldscript.ld | 187 +
.../variants/STEVAL_F401VE/variant.cpp | 310 ++
.../variants/STEVAL_F401VE/variant.h | 327 ++
.../buildroot/share/extras/header.h | 26 +
.../buildroot/share/extras/uncrustify.cfg | 84 +
.../buildroot/share/fonts/README.md | 6 +-
.../buildroot/share/fonts/genallfont.sh | 6 +-
.../buildroot/share/fonts/uxggenpages.md | 6 +-
.../buildroot/share/git/firstpush | 6 +-
.../buildroot/share/git/mfadd | 20 +-
.../buildroot/share/git/mfdoc | 6 +-
.../buildroot/share/git/mffp | 6 +-
.../buildroot/share/git/mfnew | 6 +-
.../buildroot/share/git/mfpr | 8 +-
.../buildroot/share/git/mfpub | 83 +-
.../buildroot/share/git/mfqp | 24 +-
.../buildroot/share/git/mfrb | 4 +-
.../buildroot/share/git/mftest | 134 +-
.../buildroot/share/scripts/MarlinMesh.scad | 156 +-
.../buildroot/share/scripts/config-labels.py | 201 +
.../share/scripts/createSpeedLookupTable.py | 2 +-
.../scripts/createTemperatureLookupMarlin.py | 4 +-
.../buildroot/share/scripts/pinsformat.js | 141 +
.../RepRapTools/syntax_test_G-code.gcode | 2 +-
.../auto_build_sublime_menu/Main.sublime-menu | 16 +-
.../share/tests/BIGTREE_SKR_PRO-tests | 18 -
.../share/tests/SAMD51_grandcentral_m4-tests | 10 -
.../buildroot/share/tests/esp32-tests | 22 -
.../share/tests/megaatmega1280-tests | 27 -
.../buildroot/share/tests/rambo-tests | 37 -
.../share/{atom => vscode}/auto_build.py | 12 +-
.../share/{atom => vscode}/avrdude.conf | 0
.../share/{atom => vscode}/avrdude_5.10_linux | Bin
.../share/{atom => vscode}/avrdude_5.10_macOS | Bin
.../share/{atom => vscode}/avrdude_linux.conf | 0
.../share/{atom => vscode}/avrdude_macOS.conf | 0
.../create_custom_upload_command_CDC.py | 8 +-
.../create_custom_upload_command_DFU.py | 0
.../buildroot/tests/.gitattributes | 1 +
.../buildroot/{share => }/tests/ARMED-tests | 5 +-
.../buildroot/tests/BIGTREE_BTT002-tests | 20 +
.../buildroot/tests/BIGTREE_GTR_V1_0-tests | 43 +
.../buildroot/tests/BIGTREE_SKR_PRO-tests | 32 +
.../buildroot/{share => }/tests/DUE-tests | 20 +-
.../buildroot/tests/FLYF407ZG-tests | 18 +
.../{share => }/tests/FYSETC_F6_13-tests | 3 +-
.../buildroot/tests/FYSETC_S6-tests | 17 +
.../LERDGEX-tests} | 6 +-
.../buildroot/{share => }/tests/LPC1768-tests | 8 +-
.../buildroot/{share => }/tests/LPC1769-tests | 7 +-
.../tests/SAMD51_grandcentral_m4-tests | 39 +
.../buildroot/tests/STM32F070RB_malyan-tests | 15 +
.../tests/STM32F103CB_malyan-tests | 2 +-
.../STM32F103RC_btt-tests} | 6 +-
.../STM32F103RC_btt_USB-tests} | 2 +-
.../tests/STM32F103RC_fysetc-tests | 2 +-
.../buildroot/tests/STM32F103RC_meeb-tests | 23 +
.../{share => }/tests/STM32F103RE-tests | 0
.../tests/STM32F103RET6_creality-tests | 16 +
.../STM32F103RE_btt-tests} | 6 +-
.../STM32F103RE_btt_USB-tests} | 2 +-
.../tests/STM32F103VE_longer-tests | 0
.../buildroot/{share => }/tests/STM32F4-tests | 0
.../buildroot/tests/STM32F401VE_STEVAL-tests | 16 +
.../{share => }/tests/STM32F407VE_black-tests | 1 +
.../buildroot/{share => }/tests/STM32F7-tests | 0
.../{share => }/tests/at90usb1286_cdc-tests | 0
.../{share => }/tests/at90usb1286_dfu-tests | 0
.../buildroot/tests/esp32-tests | 37 +
.../{share => }/tests/jgaurora_a5s_a1-tests | 0
.../{share => }/tests/linux_native-tests | 0
.../buildroot/tests/malyan_M300-tests | 15 +
.../buildroot/tests/mega1280-tests | 67 +
.../mega2560-tests} | 129 +-
.../{share => }/tests/mks_robin-tests | 0
.../{share => }/tests/mks_robin_lite-tests | 10 +-
.../{share => }/tests/mks_robin_mini-tests | 0
.../{share => }/tests/mks_robin_nano-tests | 0
.../buildroot/tests/mks_robin_pro-tests | 18 +
.../buildroot/tests/rambo-tests | 74 +
.../buildroot/tests/rumba32-tests | 39 +
.../buildroot/{share => }/tests/run_tests | 15 +-
.../sanguino1284p-tests} | 0
.../sanguino644p-tests} | 0
.../{share => }/tests/teensy31-tests | 2 -
.../{share => }/tests/teensy35-tests | 23 +-
.../marlin2.0 for Ender3/config/README.md | 3 +
.../config/default/Configuration.h | 2217 -----------
.../config/default/Configuration_adv.h | 2864 -------------
.../examples/3DFabXYZ/Migbot/Configuration.h | 2249 -----------
.../3DFabXYZ/Migbot/Configuration_adv.h | 2875 --------------
.../config/examples/3DFabXYZ/Migbot/Readme.md | 4 -
.../ADIMLab/Gantry v1/Configuration.h | 2218 -----------
.../ADIMLab/Gantry v1/Configuration_adv.h | 2864 -------------
.../examples/ADIMLab/Gantry v1/_Bootscreen.h | 86 -
.../ADIMLab/Gantry v2/Configuration.h | 2218 -----------
.../ADIMLab/Gantry v2/Configuration_adv.h | 2864 -------------
.../examples/ADIMLab/Gantry v2/_Bootscreen.h | 86 -
.../AlephObjects/TAZ4/Configuration.h | 2237 -----------
.../AlephObjects/TAZ4/Configuration_adv.h | 2864 -------------
.../Alfawise/U20-bltouch/Configuration.h | 2318 -----------
.../Alfawise/U20-bltouch/Configuration_adv.h | 2866 -------------
.../Alfawise/U20-bltouch/_Statusscreen.h | 77 -
.../examples/Alfawise/U20/Configuration.h | 2317 -----------
.../examples/Alfawise/U20/Configuration_adv.h | 2865 -------------
.../examples/Alfawise/U20/_Statusscreen.h | 77 -
.../AliExpress/CL-260/Configuration.h | 2217 -----------
.../examples/AliExpress/CL-260/README.txt | 15 -
.../AliExpress/UM2pExt/Configuration.h | 2228 -----------
.../AliExpress/UM2pExt/Configuration_adv.h | 2866 -------------
.../config/examples/Anet/A2/Configuration.h | 2219 -----------
.../examples/Anet/A2/Configuration_adv.h | 2864 -------------
.../examples/Anet/A2plus/Configuration.h | 2219 -----------
.../examples/Anet/A2plus/Configuration_adv.h | 2864 -------------
.../config/examples/Anet/A6/Configuration.h | 2334 -----------
.../examples/Anet/A6/Configuration_adv.h | 2864 -------------
.../config/examples/Anet/A6/_Statusscreen.h | 56 -
.../config/examples/Anet/A8/Configuration.h | 2245 -----------
.../examples/Anet/A8/Configuration_adv.h | 2864 -------------
.../config/examples/Anet/A8/_Statusscreen.h | 56 -
.../examples/Anet/A8plus/Configuration.h | 2228 -----------
.../examples/Anet/A8plus/Configuration_adv.h | 2864 -------------
.../examples/Anet/A8plus/_Statusscreen.h | 66 -
.../config/examples/Anet/E16/Configuration.h | 2229 -----------
.../examples/Anet/E16/Configuration_adv.h | 2864 -------------
.../config/examples/Anet/E16/_Bootscreen.h | 73 -
.../config/examples/Anet/E16/_Statusscreen.h | 83 -
.../examples/AnimationExample/_Bootscreen.h | 193 -
.../examples/AnyCubic/i3/Configuration.h | 2227 -----------
.../examples/AnyCubic/i3/Configuration_adv.h | 2864 -------------
.../config/examples/ArmEd/Configuration.h | 2218 -----------
.../config/examples/ArmEd/Configuration_adv.h | 2868 --------------
.../examples/Azteeg/X5GT/Configuration.h | 2217 -----------
.../BIBO/TouchX/cyclops/Configuration.h | 2217 -----------
.../BIBO/TouchX/cyclops/Configuration_adv.h | 2864 -------------
.../BIBO/TouchX/default/Configuration.h | 2217 -----------
.../BIBO/TouchX/default/Configuration_adv.h | 2864 -------------
.../examples/BQ/Hephestos/Configuration.h | 2205 ----------
.../examples/BQ/Hephestos/Configuration_adv.h | 2864 -------------
.../examples/BQ/Hephestos_2/Configuration.h | 2218 -----------
.../BQ/Hephestos_2/Configuration_adv.h | 2872 --------------
.../config/examples/BQ/Hephestos_2/README.md | 29 -
.../examples/BQ/Hephestos_2/_Bootscreen.h | 101 -
.../config/examples/BQ/WITBOX/Configuration.h | 2205 ----------
.../examples/BQ/WITBOX/Configuration_adv.h | 2864 -------------
.../SKR Mini E3 1.0/Configuration.h | 2209 -----------
.../SKR Mini E3 1.0/Configuration_adv.h | 2864 -------------
.../SKR Mini E3 1.2/Configuration.h | 2210 -----------
.../SKR Mini E3 1.2/Configuration_adv.h | 2864 -------------
.../config/examples/Cartesio/Configuration.h | 2216 -----------
.../examples/Cartesio/Configuration_adv.h | 2864 -------------
.../config/examples/Cartesio/_Bootscreen.h | 101 -
.../examples/Creality/CR-10/Configuration.h | 2227 -----------
.../Creality/CR-10/Configuration_adv.h | 2867 -------------
.../examples/Creality/CR-10/_Bootscreen.h | 56 -
.../examples/Creality/CR-10/_Statusscreen.h | 66 -
.../examples/Creality/CR-10S/Configuration.h | 2218 -----------
.../Creality/CR-10S/Configuration_adv.h | 2864 -------------
.../examples/Creality/CR-10S/_Bootscreen.h | 56 -
.../examples/Creality/CR-10S/_Statusscreen.h | 74 -
.../Creality/CR-10_5S/Configuration.h | 2220 -----------
.../Creality/CR-10_5S/Configuration_adv.h | 2864 -------------
.../examples/Creality/CR-10_5S/_Bootscreen.h | 56 -
.../Creality/CR-10mini/Configuration.h | 2236 -----------
.../Creality/CR-10mini/Configuration_adv.h | 2864 -------------
.../examples/Creality/CR-10mini/_Bootscreen.h | 56 -
.../Creality/CR-10mini/_Statusscreen.h | 74 -
.../Creality/CR-20 Pro/Configuration.h | 2221 -----------
.../Creality/CR-20 Pro/Configuration_adv.h | 2864 -------------
.../Creality/CR-20 Pro/_Statusscreen.h | 72 -
.../examples/Creality/CR-20/Configuration.h | 2221 -----------
.../Creality/CR-20/Configuration_adv.h | 2864 -------------
.../examples/Creality/CR-8/Configuration.h | 2227 -----------
.../Creality/CR-8/Configuration_adv.h | 2864 -------------
.../examples/Creality/Ender-2/Configuration.h | 2221 -----------
.../Creality/Ender-2/Configuration_adv.h | 2864 -------------
.../examples/Creality/Ender-2/README.md | 33 -
.../examples/Creality/Ender-2/_Bootscreen.h | 97 -
.../examples/Creality/Ender-2/_Statusscreen.h | 66 -
.../examples/Creality/Ender-3/Configuration.h | 2221 -----------
.../Creality/Ender-3/Configuration_adv.h | 2864 -------------
.../examples/Creality/Ender-3/_Bootscreen.h | 97 -
.../examples/Creality/Ender-3/_Statusscreen.h | 62 -
.../examples/Creality/Ender-4/Configuration.h | 2227 -----------
.../Creality/Ender-4/Configuration_adv.h | 2864 -------------
.../Creality/Ender-5 Pro/Configuration.h | 2215 -----------
.../Creality/Ender-5 Pro/Configuration_adv.h | 2864 -------------
.../Creality/Ender-5 Pro/_Bootscreen.h | 96 -
.../Creality/Ender-5 Pro/_Statusscreen.h | 70 -
.../examples/Creality/Ender-5/Configuration.h | 2221 -----------
.../Creality/Ender-5/Configuration_adv.h | 2864 -------------
.../examples/Creality/Ender-5/_Bootscreen.h | 96 -
.../examples/Creality/Ender-5/_Statusscreen.h | 61 -
.../Dagoma/Disco Ultimate/Configuration.h | 2217 -----------
.../Dagoma/Disco Ultimate/Configuration_adv.h | 2864 -------------
.../Sidewinder X1/Configuration.h | 2222 -----------
.../Sidewinder X1/Configuration_adv.h | 2864 -------------
.../Sidewinder X1/_Bootscreen.h | 93 -
.../Imprimante multifonction/Configuration.h | 2217 -----------
.../Configuration_adv.h | 2860 -------------
.../examples/Einstart-S/Configuration.h | 2227 -----------
.../examples/Einstart-S/Configuration_adv.h | 2864 -------------
.../config/examples/Einstart-S/readme.md | 152 -
.../examples/FYSETC/AIO_II/Configuration.h | 2222 -----------
.../FYSETC/AIO_II/Configuration_adv.h | 2864 -------------
.../Cheetah 1.2/BLTouch/Configuration.h | 2222 -----------
.../Cheetah 1.2/BLTouch/Configuration_adv.h | 2864 -------------
.../FYSETC/Cheetah 1.2/base/Configuration.h | 2222 -----------
.../Cheetah 1.2/base/Configuration_adv.h | 2864 -------------
.../FYSETC/Cheetah/BLTouch/Configuration.h | 2222 -----------
.../Cheetah/BLTouch/Configuration_adv.h | 2864 -------------
.../FYSETC/Cheetah/base/Configuration.h | 2222 -----------
.../FYSETC/Cheetah/base/Configuration_adv.h | 2864 -------------
.../examples/FYSETC/F6_13/Configuration.h | 2223 -----------
.../examples/FYSETC/F6_13/Configuration_adv.h | 2864 -------------
.../config/examples/FYSETC/S6/Configuration.h | 2217 -----------
.../examples/FYSETC/S6/Configuration_adv.h | 2864 -------------
.../examples/Felix/DUAL/Configuration.h | 2198 ----------
.../examples/Felix/DUAL/Configuration_adv.h | 2864 -------------
.../config/examples/Felix/DUAL/README.md | 60 -
.../examples/Felix/Single/Configuration.h | 2198 ----------
.../examples/Felix/Single/Configuration_adv.h | 2864 -------------
.../config/examples/Felix/Single/README.md | 60 -
.../FlashForge/CreatorPro/Configuration.h | 2210 -----------
.../FlashForge/CreatorPro/Configuration_adv.h | 2863 -------------
.../FlashForge/CreatorPro/CuraSettings.txt | 157 -
.../FolgerTech/i3-2020/Configuration.h | 2236 -----------
.../FolgerTech/i3-2020/Configuration_adv.h | 2872 --------------
.../examples/Formbot/Raptor/Configuration.h | 2336 -----------
.../Formbot/Raptor/Configuration_adv.h | 2868 --------------
.../examples/Formbot/Raptor/_Bootscreen.h | 94 -
.../examples/Formbot/Raptor/_Statusscreen.h | 75 -
.../examples/Formbot/T_Rex_2+/Configuration.h | 2270 -----------
.../Formbot/T_Rex_2+/Configuration_adv.h | 2878 --------------
.../examples/Formbot/T_Rex_2+/_Bootscreen.h | 102 -
.../examples/Formbot/T_Rex_2+/_Statusscreen.h | 74 -
.../examples/Formbot/T_Rex_3/Configuration.h | 2260 -----------
.../Formbot/T_Rex_3/Configuration_adv.h | 2873 --------------
.../examples/Formbot/T_Rex_3/_Bootscreen.h | 102 -
.../examples/Formbot/T_Rex_3/_Statusscreen.h | 74 -
.../examples/Geeetech/A10/Configuration.h | 2202 ----------
.../examples/Geeetech/A10/Configuration_adv.h | 2864 -------------
.../examples/Geeetech/A10D/Configuration.h | 2201 ----------
.../Geeetech/A10D/Configuration_adv.h | 2864 -------------
.../examples/Geeetech/A10M/Configuration.h | 2202 ----------
.../Geeetech/A10M/Configuration_adv.h | 2864 -------------
.../examples/Geeetech/A10T/Configuration.h | 2203 ----------
.../Geeetech/A10T/Configuration_adv.h | 2864 -------------
.../examples/Geeetech/A20/Configuration.h | 2203 ----------
.../examples/Geeetech/A20/Configuration_adv.h | 2864 -------------
.../examples/Geeetech/A20M/Configuration.h | 2204 ----------
.../Geeetech/A20M/Configuration_adv.h | 2864 -------------
.../examples/Geeetech/A20T/Configuration.h | 2205 ----------
.../Geeetech/A20T/Configuration_adv.h | 2864 -------------
.../examples/Geeetech/A30/Configuration.h | 2205 ----------
.../examples/Geeetech/A30/Configuration_adv.h | 2863 -------------
.../examples/Geeetech/E180/Configuration.h | 2206 -----------
.../Geeetech/E180/Configuration_adv.h | 2863 -------------
.../examples/Geeetech/GT2560/Configuration.h | 2241 -----------
.../Geeetech/I3_Pro_X-GT2560/Configuration.h | 2217 -----------
.../Geeetech/MeCreator2/Configuration.h | 2224 -----------
.../Geeetech/MeCreator2/Configuration_adv.h | 2863 -------------
.../Geeetech/PI3A PRO/Configuration.h | 2238 -----------
.../Geeetech/PI3A PRO/Configuration_adv.h | 2864 -------------
.../Prusa i3 Pro B/bltouch/Configuration.h | 2238 -----------
.../Geeetech/Prusa i3 Pro B/bltouch/README.md | 54 -
.../Prusa i3 Pro B/noprobe/Configuration.h | 2237 -----------
.../Geeetech/Prusa i3 Pro B/noprobe/README.md | 54 -
.../Geeetech/Prusa i3 Pro C/Configuration.h | 2217 -----------
.../Prusa i3 Pro C/Configuration_adv.h | 2864 -------------
.../Geeetech/Prusa i3 Pro W/Configuration.h | 2217 -----------
.../Prusa i3 Pro W/Configuration_adv.h | 2864 -------------
.../config/examples/HMS434/Configuration.h | 2206 -----------
.../examples/HMS434/Configuration_adv.h | 2856 -------------
.../examples/Infitary/i3-M508/Configuration.h | 2221 -----------
.../Infitary/i3-M508/Configuration_adv.h | 2864 -------------
.../examples/JGAurora/A1/Configuration.h | 2227 -----------
.../examples/JGAurora/A1/Configuration_adv.h | 2869 --------------
.../examples/JGAurora/A5/Configuration.h | 2229 -----------
.../examples/JGAurora/A5/Configuration_adv.h | 2864 -------------
.../config/examples/JGAurora/A5/README.md | 39 -
.../examples/JGAurora/A5S/Configuration.h | 2227 -----------
.../examples/JGAurora/A5S/Configuration_adv.h | 2869 --------------
.../examples/MakerParts/Configuration.h | 2217 -----------
.../examples/MakerParts/Configuration_adv.h | 2864 -------------
.../config/examples/MakerParts/_Bootscreen.h | 81 -
.../examples/Malyan/M150/Configuration.h | 2258 -----------
.../examples/Malyan/M150/Configuration_adv.h | 2864 -------------
.../config/examples/Malyan/M150/README.md | 55 -
.../config/examples/Malyan/M150/_Bootscreen.h | 71 -
.../examples/Malyan/M200/Configuration.h | 2227 -----------
.../examples/Malyan/M200/Configuration_adv.h | 2866 -------------
.../config/examples/Malyan/M200/README.md | 33 -
.../Micromake/C1/basic/Configuration.h | 2221 -----------
.../examples/Micromake/C1/basic/README.md | 15 -
.../Micromake/C1/enhanced/Configuration.h | 2221 -----------
.../Micromake/C1/enhanced/Configuration_adv.h | 2864 -------------
.../examples/Micromake/C1/enhanced/README.md | 15 -
.../config/examples/Mks/Robin/Configuration.h | 2226 -----------
.../examples/Mks/Robin/Configuration_adv.h | 2864 -------------
.../examples/Mks/Robin_Lite3/Configuration.h | 2224 -----------
.../examples/Mks/Robin_Lite3/ReadMe.txt | 5 -
.../examples/Mks/Robin_Pro/Configuration.h | 2223 -----------
.../config/examples/Mks/Robin_Pro/ReadMe.txt | 4 -
.../config/examples/Mks/Sbase/Configuration.h | 2216 -----------
.../examples/Mks/Sbase/Configuration_adv.h | 2865 -------------
.../config/examples/Mks/Sbase/README.txt | 38 -
.../examples/Modix/Big60/Configuration.h | 2216 -----------
.../examples/Modix/Big60/Configuration_adv.h | 2864 -------------
.../config/examples/Modix/Big60/_Bootscreen.h | 91 -
.../examples/Modix/Big60/_Statusscreen.h | 60 -
.../Printrbot/PrintrboardG2/Configuration.h | 2222 -----------
.../examples/RapideLite/RL200/Configuration.h | 2217 -----------
.../RapideLite/RL200/Configuration_adv.h | 2864 -------------
.../examples/Renkforce/RF100/Configuration.h | 2225 -----------
.../Renkforce/RF100/Configuration_adv.h | 2864 -------------
.../Renkforce/RF100XL/Configuration.h | 2225 -----------
.../Renkforce/RF100XL/Configuration_adv.h | 2864 -------------
.../Renkforce/RF100v2/Configuration.h | 2225 -----------
.../Renkforce/RF100v2/Configuration_adv.h | 2864 -------------
.../examples/RepRapPro/Huxley/Configuration.h | 2266 -----------
.../RepRapWorld/Megatronics/Configuration.h | 2217 -----------
.../config/examples/RigidBot/Configuration.h | 2217 -----------
.../examples/RigidBot/Configuration_adv.h | 2864 -------------
.../examples/SCARA/MP_SCARA/Configuration.h | 2251 -----------
.../SCARA/MP_SCARA/Configuration_adv.h | 2756 -------------
.../examples/SCARA/Morgan/Configuration.h | 2239 -----------
.../examples/SCARA/Morgan/Configuration_adv.h | 2861 -------------
.../STM32/Black_STM32F407VET6/Configuration.h | 2217 -----------
.../Black_STM32F407VET6/Configuration_adv.h | 2864 -------------
.../STM32/STM32F103RE/Configuration.h | 2219 -----------
.../examples/STM32/STM32F4/Configuration.h | 2217 -----------
.../STM32/stm32f103ret6/Configuration.h | 2219 -----------
.../examples/Sanguinololu/Configuration.h | 2248 -----------
.../examples/Sanguinololu/Configuration_adv.h | 2864 -------------
.../Tevo/Michelangelo/Configuration.h | 2222 -----------
.../Tevo/Michelangelo/Configuration_adv.h | 2864 -------------
.../examples/Tevo/Michelangelo/_Bootscreen.h | 83 -
.../examples/Tevo/Nereus/Configuration.h | 2201 ----------
.../examples/Tevo/Nereus/Configuration_adv.h | 2864 -------------
.../config/examples/Tevo/Nereus/_Bootscreen.h | 90 -
.../Tevo/Tarantula Pro/Configuration.h | 2222 -----------
.../Tevo/Tarantula Pro/Configuration_adv.h | 2864 -------------
.../examples/Tevo/Tarantula Pro/_Bootscreen.h | 80 -
.../Tornado/V1 (MKS Base)/Configuration.h | 2222 -----------
.../Tornado/V1 (MKS Base)/Configuration_adv.h | 2864 -------------
.../Tornado/V2 (MKS GEN-L)/Configuration.h | 2222 -----------
.../V2 (MKS GEN-L)/Configuration_adv.h | 2864 -------------
.../examples/Tevo/Tornado/_Bootscreen.h | 85 -
.../config/examples/TheBorg/Configuration.h | 2217 -----------
.../examples/TheBorg/Configuration_adv.h | 2864 -------------
.../config/examples/TinyBoy2/Configuration.h | 2273 -----------
.../examples/TinyBoy2/Configuration_adv.h | 2864 -------------
.../config/examples/Tronxy/X1/Configuration.h | 2217 -----------
.../examples/Tronxy/X3A/Configuration.h | 2221 -----------
.../examples/Tronxy/X3A/Configuration_adv.h | 2864 -------------
.../examples/Tronxy/X5S-2E/Configuration.h | 2238 -----------
.../Tronxy/X5S-2E/Configuration_adv.h | 2864 -------------
.../examples/Tronxy/X5S/Configuration.h | 2217 -----------
.../examples/Tronxy/XY100/Configuration.h | 2228 -----------
.../UltiMachine/Archim1/Configuration.h | 2217 -----------
.../UltiMachine/Archim1/Configuration_adv.h | 2864 -------------
.../UltiMachine/Archim2/Configuration.h | 2217 -----------
.../UltiMachine/Archim2/Configuration_adv.h | 2864 -------------
.../examples/VORONDesign/Configuration.h | 2226 -----------
.../examples/VORONDesign/Configuration_adv.h | 2864 -------------
.../config/examples/VORONDesign/_Bootscreen.h | 82 -
.../examples/Velleman/K8200/Configuration.h | 2252 -----------
.../Velleman/K8200/Configuration_adv.h | 2877 --------------
.../config/examples/Velleman/K8200/README.md | 20 -
.../Velleman/K8400/Dual-head/Configuration.h | 2218 -----------
.../K8400/Dual-head/Configuration_adv.h | 2864 -------------
.../Velleman/K8400/Dual-head/README.md | 15 -
.../K8400/Single-head/Configuration.h | 2218 -----------
.../K8400/Single-head/Configuration_adv.h | 2864 -------------
.../Velleman/K8400/Single-head/README.md | 15 -
.../examples/WASP/PowerWASP/Configuration.h | 2236 -----------
.../WASP/PowerWASP/Configuration_adv.h | 2864 -------------
.../config/examples/WASP/PowerWASP/README.md | 72 -
.../Wanhao/Duplicator 6/Configuration.h | 2228 -----------
.../Wanhao/Duplicator 6/Configuration_adv.h | 2866 -------------
.../Duplicator i3 2.1/Chippy_Bootscreen.h | 74 -
.../Wanhao/Duplicator i3 2.1/Configuration.h | 2228 -----------
.../Duplicator i3 2.1/Configuration_adv.h | 2864 -------------
.../Wanhao/Duplicator i3 2.1/README.md | 21 -
.../Wanhao/Duplicator i3 2.1/_Bootscreen.h | 72 -
.../Wanhao/Duplicator i3 Mini/Configuration.h | 2217 -----------
.../Duplicator i3 Mini/Configuration_adv.h | 2864 -------------
.../Wanhao/Duplicator i3 Mini/_Bootscreen.h | 53 -
.../examples/adafruit/ST7565/Configuration.h | 2217 -----------
.../delta/Anycubic/Kossel/Configuration.h | 2385 -----------
.../delta/Anycubic/Kossel/Configuration_adv.h | 2866 -------------
.../examples/delta/Anycubic/Kossel/README.md | 50 -
.../Anycubic/Kossel/images/Version1Probe.jpg | Bin 94933 -> 0 bytes
.../Anycubic/Kossel/images/Version2Probe.jpg | Bin 51853 -> 0 bytes
.../delta/Dreammaker/Overlord/Configuration.h | 2324 -----------
.../Dreammaker/Overlord/Configuration_adv.h | 2865 -------------
.../delta/Dreammaker/Overlord/_Bootscreen.h | 35 -
.../Dreammaker/Overlord_Pro/Configuration.h | 2335 -----------
.../Overlord_Pro/Configuration_adv.h | 2866 -------------
.../Dreammaker/Overlord_Pro/_Bootscreen.h | 35 -
.../examples/delta/FLSUN/QQ-S/Configuration.h | 2327 -----------
.../delta/FLSUN/QQ-S/Configuration_adv.h | 2866 -------------
.../FLSUN/auto_calibrate/Configuration.h | 2329 -----------
.../FLSUN/auto_calibrate/Configuration_adv.h | 2866 -------------
.../delta/FLSUN/kossel/Configuration.h | 2328 -----------
.../delta/FLSUN/kossel/Configuration_adv.h | 2866 -------------
.../delta/FLSUN/kossel_mini/Configuration.h | 2328 -----------
.../FLSUN/kossel_mini/Configuration_adv.h | 2866 -------------
.../Geeetech/Rostock 301/Configuration.h | 2317 -----------
.../Geeetech/Rostock 301/Configuration_adv.h | 2866 -------------
.../delta/Hatchbox_Alpha/Configuration.h | 2344 -----------
.../examples/delta/MKS/SBASE/Configuration.h | 2315 -----------
.../delta/MKS/SBASE/Configuration_adv.h | 2866 -------------
.../RRD Full Graphic Smart Controller.md | 34 -
.../delta/Tevo Little Monster/Configuration.h | 2320 -----------
.../Tevo Little Monster/Configuration_adv.h | 2866 -------------
.../examples/delta/generic/Configuration.h | 2316 -----------
.../delta/generic/Configuration_adv.h | 2866 -------------
.../delta/kossel_clear/Configuration.h | 2322 -----------
.../delta/kossel_clear/Configuration_adv.h | 2866 -------------
.../delta/kossel_mini/Configuration.h | 2318 -----------
.../delta/kossel_mini/Configuration_adv.h | 2866 -------------
.../examples/delta/kossel_pro/Configuration.h | 2318 -----------
.../examples/delta/kossel_pro/README.md | 5 -
.../examples/delta/kossel_xl/Configuration.h | 2319 -----------
.../delta/kossel_xl/Configuration_adv.h | 2866 -------------
.../config/examples/delta/kossel_xl/README.md | 21 -
.../examples/gCreate/gMax1.5+/Configuration.h | 2244 -----------
.../gCreate/gMax1.5+/Configuration_adv.h | 2864 -------------
.../examples/gCreate/gMax1.5+/_Bootscreen.h | 101 -
.../config/examples/makibox/Configuration.h | 2220 -----------
.../examples/makibox/Configuration_adv.h | 2864 -------------
.../examples/tvrrug/Round2/Configuration.h | 2212 -----------
.../tvrrug/Round2/Configuration_adv.h | 2864 -------------
.../config/examples/wt150/Configuration.h | 2222 -----------
.../config/examples/wt150/Configuration_adv.h | 2865 -------------
firmware/marlin2.0 for Ender3/platformio.ini | 1214 +++---
.../marlin2.0 for Ender3/process-palette.json | 16 +-
firmware/marlin2.0.6 bin/README.md | 14 +
firmware/marlin2.0.6 bin/Robin_e3_TMC2209.bin | Bin 0 -> 219580 bytes
2111 files changed, 107846 insertions(+), 734273 deletions(-)
create mode 100644 firmware/marlin2.0 for Ender3/.editorconfig
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/HAL.cpp (92%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/HAL.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/HAL_SPI.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/MarlinSerial.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/MarlinSerial.h (87%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/Servo.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/ServoTimers.h (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR/persistent_store_eeprom.cpp => AVR/eeprom.cpp} (76%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/endstop_interrupts.h (92%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/fast_pwm.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/fastio.cpp (65%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/fastio.h (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/fastio/fastio_1280.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/fastio/fastio_1281.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/fastio/fastio_168.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/fastio/fastio_644.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/fastio/fastio_AT90USB.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/inc/Conditionals_LCD.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => AVR}/inc/Conditionals_adv.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => AVR}/inc/Conditionals_post.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/inc/SanityCheck.h (76%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/math.h (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/pinsDebug.h (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/pinsDebug_Teensyduino.h (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/pinsDebug_plus_70.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/spi_pins.h (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR/HAL.h => AVR/timers.h} (71%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/u8g_com_HAL_AVR_sw_spi.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/watchdog.cpp (91%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => AVR}/watchdog.h (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/DebugMonitor.cpp (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/HAL.cpp (90%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/HAL.h (74%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/HAL_SPI.cpp (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/InterruptVectors.cpp (92%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/InterruptVectors.h (91%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/MarlinSerial.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/MarlinSerial.h (90%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/MarlinSerialUSB.cpp (92%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/MarlinSerialUSB.h (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/Servo.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/ServoTimers.h (100%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/Tone.cpp (86%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/dogm/u8g_com_HAL_DUE_sw_spi.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/dogm/u8g_com_HAL_DUE_sw_spi_shared.h (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE/EepromEmulation.cpp => DUE/eeprom_flash.cpp} (86%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE/persistent_store_eeprom.cpp => DUE/eeprom_wired.cpp} (70%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/endstop_interrupts.h (66%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/fastio.h (97%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/fastio/G2_PWM.h (92%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/fastio/G2_pins.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => DUE}/inc/Conditionals_LCD.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => DUE}/inc/Conditionals_adv.h (84%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/inc/Conditionals_post.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/inc/SanityCheck.h (90%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/pinsDebug.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/spi_pins.h (92%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/timers.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/timers.h (85%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/upload_extra_script.py
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/arduino_due_x.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/compiler.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/conf_access.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/conf_clock.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/conf_usb.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/ctrl_access.c (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/ctrl_access.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/genclk.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/mrepeat.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/osc.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/pll.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/preprocessor.h (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/sbc_protocol.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/sd_mmc_spi_mem.cpp (100%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/sd_mmc_spi_mem.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/spc_protocol.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/stringz.h (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/sysclk.c (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/sysclk.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/tpaste.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/udc.c (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/udc.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/udc_desc.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/udd.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/udi.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/udi_cdc.c (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/udi_cdc.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/udi_cdc_conf.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/udi_cdc_desc.c (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/udi_composite_desc.c (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/udi_msc.c (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/udi_msc.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/uotghs_device_due.c (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/uotghs_device_due.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/uotghs_otg.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/usb_protocol.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/usb_protocol_cdc.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/usb_protocol_msc.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/usb_task.c (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/usb/usb_task.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/watchdog.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => DUE}/watchdog.h (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/FlushableHardwareSerial.cpp (87%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/FlushableHardwareSerial.h (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/HAL.cpp (67%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/HAL.h (53%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/HAL_SPI.cpp (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/Servo.cpp (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/Servo.h (92%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/WebSocketSerial.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/WebSocketSerial.h (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32/persistent_store_impl.cpp => ESP32/eeprom.cpp} (72%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/endstop_interrupts.h (65%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/fastio.h (92%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/i2s.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/i2s.h (87%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => ESP32}/inc/Conditionals_LCD.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/inc/Conditionals_adv.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/inc/Conditionals_post.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/inc/SanityCheck.h (72%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/ota.cpp (90%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/ota.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/servotimers.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/spi_pins.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/spiffs.cpp (83%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/spiffs.h (85%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/timers.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/timers.h (82%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/watchdog.cpp (87%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/watchdog.h (87%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/web.cpp (83%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/web.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/wifi.cpp (92%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_ESP32 => ESP32}/wifi.h (86%)
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_LCD.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_post.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/timers.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/Servo.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/inc/Conditionals_LCD.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/inc/Conditionals_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/inc/Conditionals_post.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/persistent_store_sdcard.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_LCD.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_post.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/endstop_interrupts.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_LCD.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_LCD.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_LCD.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/HAL.cpp (90%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/HAL.h (76%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/arduino.cpp (83%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX/persistent_store_impl.cpp => LINUX/eeprom.cpp} (83%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/fastio.h (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/hardware/Clock.cpp (87%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/hardware/Clock.h (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/hardware/Gpio.cpp (86%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/hardware/Gpio.h (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/hardware/Heater.cpp (91%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/hardware/Heater.h (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/hardware/IOLoggerCSV.cpp (90%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/hardware/IOLoggerCSV.h (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/hardware/LinearAxis.cpp (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/hardware/LinearAxis.h (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/hardware/Timer.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/hardware/Timer.h (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_DUE => LINUX}/inc/Conditionals_LCD.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/inc/Conditionals_adv.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_AVR => LINUX}/inc/Conditionals_post.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/inc/SanityCheck.h (82%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/include/Arduino.h (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/include/pinmapping.cpp (92%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/include/pinmapping.h (92%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/include/serial.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/main.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/pinsDebug.h (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/servo_private.h (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/spi_pins.h (85%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/timers.cpp (92%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/timers.h (83%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/watchdog.cpp (86%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => LINUX}/watchdog.h (85%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/DebugMonitor.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/HAL.cpp (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/HAL.h (77%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/HAL_SPI.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/MarlinSerial.cpp (74%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/MarlinSerial.h (86%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/Servo.h (91%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768/persistent_store_flash.cpp => LPC1768/eeprom_flash.cpp} (80%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768/persistent_store_sdcard.cpp => LPC1768/eeprom_sdcard.cpp} (88%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/eeprom_wired.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/endstop_interrupts.h (87%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/fast_pwm.cpp (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/fastio.h (92%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/Conditionals_LCD.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/Conditionals_adv.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/Conditionals_post.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/SanityCheck.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/include/SPI.h (82%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/include/digipot_mcp4451_I2C_routines.c (72%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/i2c_util.c
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h => LPC1768/include/i2c_util.h} (66%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/main.cpp (86%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/pinsDebug.h (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/spi_pins.h (85%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/timers.cpp (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/timers.h (77%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/u8g/LCD_I2C_routines.cpp (69%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/u8g/LCD_I2C_routines.h (77%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/u8g/LCD_defines.h (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/u8g/LCD_delay.h (79%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/u8g/LCD_pin_routines.c (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/u8g/LCD_pin_routines.h (90%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp (92%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/upload_extra_script.py
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/usb_serial.cpp (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/watchdog.cpp (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/watchdog.h (86%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LPC1768 => LPC1768}/win_usb_driver/lpc176x_usb_driver.inf (100%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/HAL.cpp (77%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/HAL.h (65%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/HAL_SPI.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/MarlinSerial_AGCM4.cpp (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/MarlinSerial_AGCM4.h (84%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/QSPIFlash.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/QSPIFlash.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/SAMD51.h (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/Servo.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/ServoTimers.h (89%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/eeprom_flash.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/eeprom_wired.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/endstop_interrupts.h (78%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/fastio.h (97%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/inc/Conditionals_LCD.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/inc/Conditionals_adv.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/inc/Conditionals_post.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/inc/SanityCheck.h (83%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/pinsDebug.h (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/spi_pins.h (90%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/timers.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/timers.h (62%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/watchdog.cpp (92%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_SAMD51 => SAMD51}/watchdog.h (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/HAL.cpp (65%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/HAL.h (61%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/HAL_SPI.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/MarlinSerial.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/MarlinSerial.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/README.md (100%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/Servo.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/Servo.h (61%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/SoftwareSerial.cpp (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/SoftwareSerial.h (91%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32/persistent_store_flash.cpp => STM32/eeprom_flash.cpp} (72%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/eeprom_sdcard.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/eeprom_sram.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/eeprom_wired.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/endstop_interrupts.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/fastio.cpp (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/fastio.h (89%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/Conditionals_LCD.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/Conditionals_adv.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/Conditionals_post.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/SanityCheck.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/pinsDebug.h (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/pinsDebug_STM32GENERIC.h (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/pinsDebug_STM32duino.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/pins_Xref.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/spi_pins.h (86%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/timers.cpp (60%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/timers.h (68%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/usb_serial.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/usb_serial.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/watchdog.cpp (90%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32 => STM32}/watchdog.h (85%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/HAL.cpp (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/HAL.h (73%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/HAL_SPI.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/README.md (100%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/SPI.cpp (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/SPI.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/Servo.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/Servo.h (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/SoftwareSerial.cpp (90%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/SoftwareSerial.h (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/build_flags.py (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/dogm/u8g_com_stm32duino_fsmc.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/dogm/u8g_com_stm32duino_swspi.cpp (87%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1/persistent_store_flash.cpp => STM32F1/eeprom_flash.cpp} (79%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_if_iic.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1/persistent_store_sdcard.cpp => STM32F1/eeprom_sdcard.cpp} (50%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1/persistent_store_eeprom.cpp => STM32F1/eeprom_wired.cpp} (75%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/endstop_interrupts.h (67%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/fastio.h (97%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/inc/Conditionals_adv.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/inc/Conditionals_post.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/inc/SanityCheck.h (61%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/maple_win_usb_driver/maple_serial.inf (100%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/msc_sd.cpp (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/msc_sd.h (81%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/onboard_sd.cpp (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/onboard_sd.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/pinsDebug.h (78%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/sdio.cpp (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/sdio.h (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/spi_pins.h (91%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/timers.cpp (92%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/timers.h (82%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/watchdog.cpp (91%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32F1 => STM32F1}/watchdog.h (90%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/HAL.cpp (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/HAL.h (68%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/HAL_SPI.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/README.md (100%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/STM32F4/README.md (100%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/STM32F4/timers.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/STM32F4/timers.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/STM32F7/README.md (100%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/STM32F7/TMC2660.cpp (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/STM32F7/TMC2660.h (100%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/STM32F7/timers.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/STM32F7/timers.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/Servo.cpp (87%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/Servo.h (90%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/eeprom_emul.cpp (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/eeprom_emul.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7/EmulatedEeprom.cpp => STM32_F4_F7/eeprom_flash.cpp} (53%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7/persistent_store_eeprom.cpp => STM32_F4_F7/eeprom_wired.cpp} (72%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/endstop_interrupts.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/fastio.h (98%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_LCD.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_adv.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/inc/SanityCheck.h (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/pinsDebug.h (78%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/spi_pins.h (86%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/timers.h (85%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/watchdog.cpp (92%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_STM32_F4_F7 => STM32_F4_F7}/watchdog.h (85%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY31_32 => TEENSY31_32}/HAL.cpp (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY31_32 => TEENSY31_32}/HAL.h (90%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY31_32 => TEENSY31_32}/HAL_SPI.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY31_32 => TEENSY31_32}/Servo.cpp (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY31_32 => TEENSY31_32}/Servo.h (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY31_32/persistent_store_impl.cpp => TEENSY31_32/eeprom.cpp} (71%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY31_32 => TEENSY31_32}/endstop_interrupts.h (66%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY31_32 => TEENSY31_32}/fastio.h (90%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_LCD.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_adv.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_LINUX => TEENSY31_32}/inc/Conditionals_post.h (78%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY31_32 => TEENSY31_32}/inc/SanityCheck.h (81%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY31_32 => TEENSY31_32}/pinsDebug.h (100%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY31_32 => TEENSY31_32}/spi_pins.h (86%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY31_32 => TEENSY31_32}/timers.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY31_32 => TEENSY31_32}/timers.h (83%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY31_32 => TEENSY31_32}/watchdog.cpp (87%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY31_32 => TEENSY31_32}/watchdog.h (87%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY35_36 => TEENSY35_36}/HAL.cpp (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY35_36 => TEENSY35_36}/HAL.h (90%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY35_36 => TEENSY35_36}/HAL_SPI.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY35_36 => TEENSY35_36}/Servo.cpp (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY35_36 => TEENSY35_36}/Servo.h (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY35_36/persistent_store_eeprom.cpp => TEENSY35_36/eeprom.cpp} (75%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY35_36 => TEENSY35_36}/endstop_interrupts.h (66%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY35_36 => TEENSY35_36}/fastio.h (90%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_LCD.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_adv.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_post.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY35_36 => TEENSY35_36}/inc/SanityCheck.h (81%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY35_36 => TEENSY35_36}/pinsDebug.h (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY35_36 => TEENSY35_36}/spi_pins.h (86%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY35_36 => TEENSY35_36}/timers.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY35_36 => TEENSY35_36}/timers.h (83%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY35_36 => TEENSY35_36}/watchdog.cpp (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/{HAL_TEENSY35_36 => TEENSY35_36}/watchdog.h (86%)
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/MarlinSerial.h
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/{persistent_store_api.cpp => eeprom_api.cpp} (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/{persistent_store_api.h => eeprom_api.h} (72%)
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_i2c.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_if.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_if_i2c.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/{eeprom_spi.cpp => eeprom_if_spi.cpp} (55%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/esp_wifi.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/esp_wifi.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/Marlin.h
rename firmware/marlin2.0 for Ender3/Marlin/src/{Marlin.cpp => MarlinCore.cpp} (55%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/MarlinCore.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/core/debug_section.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/feature/direct_stepping.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/feature/direct_stepping.h
rename firmware/marlin2.0 for Ender3/Marlin/src/feature/{emergency_parser.cpp => e_parser.cpp} (87%)
rename firmware/marlin2.0 for Ender3/Marlin/src/feature/{emergency_parser.h => e_parser.h} (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/feature/{I2CPositionEncoder.cpp => encoder_i2c.cpp} (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/feature/{I2CPositionEncoder.h => encoder_i2c.h} (97%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/feature/hotend_idle.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/feature/hotend_idle.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/feature/leds/pca9533.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/feature/leds/pca9533.h
rename firmware/marlin2.0 for Ender3/Marlin/src/feature/{Max7219_Debug_LEDs.cpp => max7219.cpp} (83%)
rename firmware/marlin2.0 for Ender3/Marlin/src/feature/{Max7219_Debug_LEDs.h => max7219.h} (90%)
rename firmware/marlin2.0 for Ender3/Marlin/src/feature/{prusa_MMU2 => mmu2}/mmu2.cpp (62%)
rename firmware/marlin2.0 for Ender3/Marlin/src/feature/{prusa_MMU2 => mmu2}/mmu2.h (69%)
rename firmware/marlin2.0 for Ender3/Marlin/src/feature/{prusa_MMU2 => mmu2}/serial-protocol.md (100%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/feature/power_monitor.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/feature/power_monitor.h
rename firmware/marlin2.0 for Ender3/Marlin/src/feature/{power_loss_recovery.cpp => powerloss.cpp} (70%)
rename firmware/marlin2.0 for Ender3/Marlin/src/feature/{power_loss_recovery.h => powerloss.h} (77%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/feature/probe_temp_comp.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/feature/probe_temp_comp.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/feature/spindle_laser_types.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/feature/z_stepper_align.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/feature/z_stepper_align.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/gcode/bedlevel/G35.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/gcode/calibrate/G76_M871.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/gcode/config/M672.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/gcode/feature/controllerfan/M710.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/gcode/feature/pause/G60.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/gcode/feature/pause/G61.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/gcode/feature/power_monitor/M430.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/gcode/host/M360.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/gcode/motion/G6.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/gcode/sd/M1001.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{sdcard => sd}/M20.cpp (81%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{sdcard => sd}/M21_M22.cpp (87%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{sdcard => sd}/M23.cpp (84%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{sdcard => sd}/M24_M25.cpp (74%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{sdcard => sd}/M26.cpp (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{sdcard => sd}/M27.cpp (90%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{sdcard => sd}/M28_M29.cpp (85%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{sdcard => sd}/M30.cpp (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{sdcard => sd}/M32.cpp (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{sdcard => sd}/M33.cpp (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{sdcard => sd}/M34.cpp (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{sdcard => sd}/M524.cpp (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{sdcard => sd}/M928.cpp (87%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{temperature => temp}/M104_M109.cpp (51%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{temperature => temp}/M105.cpp (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{temperature => temp}/M106_M107.cpp (61%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/gcode/temp/M140_M190.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{temperature => temp}/M141_M191.cpp (72%)
rename firmware/marlin2.0 for Ender3/Marlin/src/gcode/{temperature => temp}/M155.cpp (84%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/gcode/temp/M303.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/gcode/temperature/M140_M190.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/gcode/temperature/M303.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/dogm/fontdata/langdata_hu.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/dogm/fontdata/langdata_ro.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/dwin/README.md
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/dwin/dwin.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/dwin/dwin.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/dwin/dwin_lcd.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/dwin/dwin_lcd.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/dwin/rotary_encoder.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/dwin/rotary_encoder.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/config.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/theme/colors.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/anycubic/anycubic_serial.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/anycubic/anycubic_serial.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/anycubic/anycubic_tft.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/anycubic/anycubic_tft.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/dgus/DGUSDisplayDef.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/dgus/DGUSScreenHandler.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui/lib/dgus/DGUSDisplay.h => extui/lib/dgus/DGUSScreenHandler.h} (65%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/dgus/DGUSVPVariable.h (89%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui/lib/dgus/DGUSDisplayDefinition.h => extui/lib/dgus/origin/DGUSDisplayDef.h} (66%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.cpp (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/archim2-flash/flash_storage.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/compat.h (90%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/config.h
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/LICENSE.txt (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/README.md (100%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp (85%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/constants.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/display_list.h (100%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/ftdi_basic.h (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft800.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/registers_ft810.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp (77%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h (65%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/bitmap_info.h (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.cpp (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.cpp (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp (92%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/ftdi_extended.h (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/grid_layout.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/polygon.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/rgb_t.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/screen_types.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h (87%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.h (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.cpp (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/text_box.h (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.h (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/README.txt (100%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps.h (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/romfont_31.pbm (100%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.png (100%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.svg (100%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.cpp (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/font_size_t.h (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/standard_char_set.h (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h (98%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.h (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/bitmap2cpp.py (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/circular_progress.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/ftdi_eve_lib/ftdi_eve_lib.h (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/language/language.cpp (91%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/language/language.h (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/language/language_en.h (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/marlin_events.cpp (71%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/pin_mappings.h
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/about_screen.cpp (53%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/alert_dialog_box.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/backlash_compensation_screen.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/base_numeric_adjustment_screen.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/base_screen.cpp (92%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_e.cpp (85%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/bio_confirm_home_xyz.cpp (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/bio_main_menu.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_landscape.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/bio_printer_ui_portrait.h (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/bio_printing_dialog_box.cpp (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/bio_status_screen.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/bio_tune_menu.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp (91%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/case_light_screen.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/change_filament_screen.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/confirm_abort_print_dialog_box.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/confirm_auto_calibration_dialog_box.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/confirm_erase_flash_dialog_box.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp (82%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/feedrate_percent_screen.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/filament_menu.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/filament_runout_screen.cpp (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/files_screen.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/interface_sounds_screen.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/jerk_screen.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/junction_deviation_screen.cpp (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/kill_screen.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/language_menu.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/linear_advance_screen.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp (94%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/main_menu.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/max_acceleration_screen.cpp (91%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/max_velocity_screen.cpp (93%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/media_player_screen.cpp (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/move_axis_screen.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp (60%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/preheat_menu.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/preheat_timer_screen.cpp (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/restore_failsafe_dialog_box.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/screen_data.h (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/screens.cpp (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/screens.h (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/spinner_dialog_box.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/statistics_screen.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/status_screen.cpp (55%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/stepper_bump_sensitivity_screen.cpp (73%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/stepper_current_screen.cpp (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/steps_screen.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/stress_test_screen.cpp (88%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/string_format.cpp (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/string_format.h (95%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/temperature_screen.cpp (77%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/touch_calibration_screen.cpp (89%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/touch_registers_screen.cpp (98%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/tune_menu.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/widget_demo_screen.cpp (98%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/screens/z_offset_screen.cpp (94%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/theme/bitmaps.h (98%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/theme/colors.h
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/theme/fonts.h (97%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_landscape.h (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/theme/marlin_bootscreen_portrait.h (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/theme/sounds.cpp (99%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/theme/sounds.h (96%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/lib/ftdi_eve_touch_ui/theme/theme.h (94%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_about.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_acceleration_settings.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_change_speed.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_eeprom_settings.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_fan.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_home.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_home.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_jerk_settings.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_language.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_language.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_para.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_machine_settings.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_max_feedrate_settings.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_motor_settings.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_number_key.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_operation.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_message.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_pause_position.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_set.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_step_settings.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_current_settings.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_tmc_step_mode_settings.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_tool.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/gb2312_puhui16.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/printer_operation.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/tft_fsmc.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/{HAL/HAL_LPC1768/persistent_store_api.h => lcd/extui/lib/mks_ui/tft_fsmc.h} (73%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp
rename firmware/marlin2.0 for Ender3/Marlin/src/{HAL/HAL_STM32/inc/SanityCheck.h => lcd/extui/lib/mks_ui/tft_lvgl_configuration.h} (51%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.h
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/ui_api.cpp (78%)
rename firmware/marlin2.0 for Ender3/Marlin/src/lcd/{extensible_ui => extui}/ui_api.h (86%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/extui_anycubic_tft.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/language/language_hu.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/language/language_ro.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/lcd/menu/menu_power_monitor.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/libs/BL24CXX.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/libs/BL24CXX.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/libs/L6470/000_l6470_read_me.md
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/libs/L6470/L6470_Marlin.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/libs/L6470/L6470_Marlin.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/libs/L64XX/L64XX_Marlin.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/libs/L64XX/L64XX_Marlin.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/libs/L64XX/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/module/stepper/L6470.cpp
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/module/stepper/L6470.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/module/stepper/L64xx.cpp
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/module/stepper/L64xx.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/module/thermistor/thermistor_202.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/module/thermistor/thermistor_21.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/module/thermistor/thermistor_22.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/module/thermistor/thermistor_23.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/module/thermistor/thermistor_332.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/module/thermistor/thermistor_502.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/esp32/pins_E4D.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/lpc1768/pins_BTT_SKR.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/mega/pins_INTAMSYS40.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/mega/pins_PICA.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/mega/pins_PICAOLD.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/ramps/pins_COPYMASTER_3D.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/ramps/pins_FYSETC_F6_14.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/ramps/pins_K8600.h
rename firmware/marlin2.0 for Ender3/Marlin/src/pins/ramps/{pins_MKS_BASE.h => pins_MKS_BASE_10.h} (69%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/ramps/pins_MKS_BASE_16.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/ramps/pins_MKS_BASE_common.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/ramps/pins_ORTUR_4.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/sam/pins_CNCONTROLS_15D.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/samd/pins_RAMPS_144.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/sanguino/pins_MELZI_V2.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_ARMED.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_BEAST.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_BLACK_STM32F407VE.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_BTT_BTT002_V1_0.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_BTT_SKR_E3_DIP.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_V1_1.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_BTT_SKR_PRO_V1_1.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_CHITU3D.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_FLYF407ZG.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_FYSETC_AIO_II.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_FYSETC_S6.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_GENERIC_STM32F4.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_GTM32_MINI.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_GTM32_PRO_VB.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_GTM32_REV_B.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_JGAURORA_A5S_A1.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_LERDGE_K.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_LERDGE_X.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_LONGER3D_LK.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_MALYAN_M200.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_MKS_ROBIN.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_MKS_ROBIN2.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_MKS_ROBIN_E3.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_MKS_ROBIN_E3D.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_MKS_ROBIN_LITE.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_MKS_ROBIN_LITE3.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_MKS_ROBIN_MINI.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_MKS_ROBIN_NANO.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_MKS_ROBIN_PRO.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_MORPHEUS.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_REMRAM_V1.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_RUMBA32.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_STEVAL.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_STM32F1R.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_STM3R_MINI.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_THE_BORG.h
delete mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32/pins_VAKE403D.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f0/pins_MALYAN_M200_V2.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f0/pins_MALYAN_M300.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h
rename firmware/marlin2.0 for Ender3/Marlin/src/pins/{stm32 => stm32f1}/pins_BTT_SKR_MINI_E3_V1_0.h (77%)
rename firmware/marlin2.0 for Ender3/Marlin/src/pins/{stm32 => stm32f1}/pins_BTT_SKR_MINI_E3_V1_2.h (56%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_CHITU3D.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h
rename firmware/marlin2.0 for Ender3/Marlin/src/pins/{stm32 => stm32f1}/pins_FYSETC_CHEETAH_V12.h (67%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h
rename firmware/marlin2.0 for Ender3/Marlin/src/pins/{stm32 => stm32f1}/pins_GTM32_MINI_A30.h (51%)
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_MALYAN_M200.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_MORPHEUS.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_STM32F1R.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_ARMED.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_BEAST.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_1.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_V1_2.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_GENERIC_STM32F4.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_LERDGE_K.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_LERDGE_S.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_LERDGE_X.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_RUMBA32_AUS3D.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_RUMBA32_MKS.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f4/pins_VAKE403D.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h
create mode 100644 firmware/marlin2.0 for Ender3/Marlin/src/pins/stm32f7/pins_THE_BORG.h
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/bin/.gitattributes
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/bin/backup_ramps
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/bin/build_marlin
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/bin/build_marlin_fail
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/bin/build_marlin_pio
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/bin/build_marlin_teensy35
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/bin/bump_date
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/bin/env_backup
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/bin/env_clean
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/bin/env_restore
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/bin/format_code
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/bin/uncrust
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/bin/update_defaults
rename firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/boards/{MKS_ROBIN2.json => BigTree_GTR_v1.json} (73%)
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/boards/CHITU_F103.json
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/boards/LERDGE.json
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/boards/MEEB_3DP.json
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/boards/STEVAL_STM32F401VE.json
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/ldscripts/STM32F103RC_MEEB_3DP.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/ldscripts/creality.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/ldscripts/fysetc_stm32f103rc.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/ldscripts/lerdge.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/scripts/STEVAL__F401XX.py
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/scripts/common-dependencies.h
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/scripts/common-dependencies.py
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/scripts/creality.py
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/scripts/download_mks_assets.py
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/scripts/lerdge.py
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/scripts/mks_robin_nano35.py
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/scripts/random-bin.py
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/scripts/stm32_bootloader.py
rename firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/{MKS_ROBIN2 => BIGTREE_GTR_V1}/PeripheralPins.c (71%)
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/PinNamesVar.h
rename firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/{MKS_ROBIN2 => BIGTREE_GTR_V1}/hal_conf_extra.h (100%)
rename firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/{MKS_ROBIN2 => BIGTREE_GTR_V1}/ldscript.ld (97%)
rename firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/{MKS_ROBIN2 => BIGTREE_GTR_V1}/variant.cpp (100%)
rename firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/{MKS_ROBIN2 => BIGTREE_GTR_V1}/variant.h (90%)
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/CHITU_F103/board.cpp
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/CHITU_F103/board/board.h
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/CHITU_F103/ld/common.inc
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/CHITU_F103/ld/extra_libs.inc
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103z_dfu.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103zc.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103zd.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103ze.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/CHITU_F103/ld/vector_symbols.inc
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/CHITU_F103/pins_arduino.h
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/CHITU_F103/variant.h
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/boards.cpp
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/boards_setup.cpp
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/start_c.c
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/syscalls.c
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/LERDGE/PeripheralPins.c
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/LERDGE/PinNamesVar.h
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/LERDGE/variant.cpp
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/LERDGE/variant.h
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/board.cpp
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/board/board.h
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/bootloader.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/common.inc
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/extra_libs.inc
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/flash.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/jtag.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-flash.inc
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-jtag.inc
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-ram.inc
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/ram.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rb.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rb_bootloader.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rc.ld
rename firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/{ldscripts/fysetc_aio_ii.ld => variants/MEEB_3DP/ld/stm32f103rc_bootloader.ld} (89%)
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103re.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/vector_symbols.inc
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/pins_arduino.h
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/variant.h
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/boards.cpp
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/boards_setup.cpp
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/start_c.c
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/syscalls.c
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/MKS_ROBIN2/PinNamesVar.h
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/STEVAL_F401VE/PeripheralPins.c
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/STEVAL_F401VE/PinNamesVar.h
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/STEVAL_F401VE/hal_conf_custom.h
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/STEVAL_F401VE/ldscript.ld
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.cpp
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.h
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/extras/header.h
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/extras/uncrustify.cfg
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/scripts/config-labels.py
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/scripts/pinsformat.js
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/tests/BIGTREE_SKR_PRO-tests
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/tests/SAMD51_grandcentral_m4-tests
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/tests/esp32-tests
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/tests/megaatmega1280-tests
delete mode 100644 firmware/marlin2.0 for Ender3/buildroot/share/tests/rambo-tests
rename firmware/marlin2.0 for Ender3/buildroot/share/{atom => vscode}/auto_build.py (99%)
rename firmware/marlin2.0 for Ender3/buildroot/share/{atom => vscode}/avrdude.conf (100%)
rename firmware/marlin2.0 for Ender3/buildroot/share/{atom => vscode}/avrdude_5.10_linux (100%)
rename firmware/marlin2.0 for Ender3/buildroot/share/{atom => vscode}/avrdude_5.10_macOS (100%)
rename firmware/marlin2.0 for Ender3/buildroot/share/{atom => vscode}/avrdude_linux.conf (100%)
rename firmware/marlin2.0 for Ender3/buildroot/share/{atom => vscode}/avrdude_macOS.conf (100%)
rename firmware/marlin2.0 for Ender3/buildroot/share/{atom => vscode}/create_custom_upload_command_CDC.py (94%)
rename firmware/marlin2.0 for Ender3/buildroot/share/{atom => vscode}/create_custom_upload_command_DFU.py (100%)
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/.gitattributes
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/ARMED-tests (56%)
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/BIGTREE_BTT002-tests
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/BIGTREE_GTR_V1_0-tests
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/BIGTREE_SKR_PRO-tests
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/DUE-tests (80%)
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/FLYF407ZG-tests
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/FYSETC_F6_13-tests (75%)
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/FYSETC_S6-tests
rename firmware/marlin2.0 for Ender3/buildroot/{share/tests/BIGTREE_BTT002-tests => tests/LERDGEX-tests} (51%)
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/LPC1768-tests (86%)
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/LPC1769-tests (92%)
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/SAMD51_grandcentral_m4-tests
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/STM32F070RB_malyan-tests
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/STM32F103CB_malyan-tests (79%)
rename firmware/marlin2.0 for Ender3/buildroot/{share/tests/STM32F103RC_bigtree-tests => tests/STM32F103RC_btt-tests} (59%)
rename firmware/marlin2.0 for Ender3/buildroot/{share/tests/STM32F103RC_bigtree_USB-tests => tests/STM32F103RC_btt_USB-tests} (86%)
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/STM32F103RC_fysetc-tests (76%)
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/STM32F103RC_meeb-tests
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/STM32F103RE-tests (100%)
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/STM32F103RET6_creality-tests
rename firmware/marlin2.0 for Ender3/buildroot/{share/tests/STM32F103RE_bigtree_USB-tests => tests/STM32F103RE_btt-tests} (57%)
rename firmware/marlin2.0 for Ender3/buildroot/{share/tests/STM32F103RE_bigtree-tests => tests/STM32F103RE_btt_USB-tests} (87%)
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/STM32F103VE_longer-tests (100%)
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/STM32F4-tests (100%)
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/STM32F401VE_STEVAL-tests
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/STM32F407VE_black-tests (94%)
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/STM32F7-tests (100%)
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/at90usb1286_cdc-tests (100%)
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/at90usb1286_dfu-tests (100%)
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/esp32-tests
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/jgaurora_a5s_a1-tests (100%)
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/linux_native-tests (100%)
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/malyan_M300-tests
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/mega1280-tests
rename firmware/marlin2.0 for Ender3/buildroot/{share/tests/megaatmega2560-tests => tests/mega2560-tests} (70%)
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/mks_robin-tests (100%)
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/mks_robin_lite-tests (52%)
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/mks_robin_mini-tests (100%)
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/mks_robin_nano-tests (100%)
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/mks_robin_pro-tests
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/rambo-tests
create mode 100644 firmware/marlin2.0 for Ender3/buildroot/tests/rumba32-tests
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/run_tests (78%)
rename firmware/marlin2.0 for Ender3/buildroot/{share/tests/sanguino_atmega1284p-tests => tests/sanguino1284p-tests} (100%)
rename firmware/marlin2.0 for Ender3/buildroot/{share/tests/sanguino_atmega644p-tests => tests/sanguino644p-tests} (100%)
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/teensy31-tests (98%)
rename firmware/marlin2.0 for Ender3/buildroot/{share => }/tests/teensy35-tests (85%)
create mode 100644 firmware/marlin2.0 for Ender3/config/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/default/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/default/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/3DFabXYZ/Migbot/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/3DFabXYZ/Migbot/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/3DFabXYZ/Migbot/Readme.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/ADIMLab/Gantry v1/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/ADIMLab/Gantry v1/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/ADIMLab/Gantry v1/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/ADIMLab/Gantry v2/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/ADIMLab/Gantry v2/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/ADIMLab/Gantry v2/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/AlephObjects/TAZ4/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/AlephObjects/TAZ4/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Alfawise/U20-bltouch/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Alfawise/U20-bltouch/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Alfawise/U20-bltouch/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Alfawise/U20/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Alfawise/U20/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Alfawise/U20/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/AliExpress/CL-260/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/AliExpress/CL-260/README.txt
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/AliExpress/UM2pExt/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/AliExpress/UM2pExt/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/A2/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/A2/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/A2plus/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/A2plus/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/A6/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/A6/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/A6/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/A8/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/A8/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/A8/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/A8plus/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/A8plus/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/A8plus/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/E16/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/E16/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/E16/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Anet/E16/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/AnimationExample/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/AnyCubic/i3/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/AnyCubic/i3/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/ArmEd/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/ArmEd/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Azteeg/X5GT/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BIBO/TouchX/cyclops/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BIBO/TouchX/default/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BIBO/TouchX/default/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BQ/Hephestos/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BQ/Hephestos/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BQ/Hephestos_2/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BQ/Hephestos_2/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BQ/Hephestos_2/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BQ/Hephestos_2/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BQ/WITBOX/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BQ/WITBOX/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Cartesio/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Cartesio/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Cartesio/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-10/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-10/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-10/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-10/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-10S/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-10S/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-10S/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-10S/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-10_5S/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-10_5S/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-10_5S/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-10mini/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-10mini/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-10mini/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-10mini/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-20 Pro/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-20 Pro/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-20 Pro/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-20/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-20/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-8/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/CR-8/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-2/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-2/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-2/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-2/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-2/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-3/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-3/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-3/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-3/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-4/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-4/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-5 Pro/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-5 Pro/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-5 Pro/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-5 Pro/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-5/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-5/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-5/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Creality/Ender-5/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Dagoma/Disco Ultimate/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/EVNOVO (Artillery)/Sidewinder X1/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/EXP3D/Imprimante multifonction/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/EXP3D/Imprimante multifonction/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Einstart-S/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Einstart-S/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Einstart-S/readme.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FYSETC/AIO_II/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FYSETC/AIO_II/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FYSETC/Cheetah 1.2/base/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FYSETC/Cheetah/BLTouch/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FYSETC/Cheetah/base/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FYSETC/Cheetah/base/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FYSETC/F6_13/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FYSETC/F6_13/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FYSETC/S6/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FYSETC/S6/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Felix/DUAL/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Felix/DUAL/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Felix/DUAL/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Felix/Single/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Felix/Single/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Felix/Single/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FlashForge/CreatorPro/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FlashForge/CreatorPro/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FlashForge/CreatorPro/CuraSettings.txt
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FolgerTech/i3-2020/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/FolgerTech/i3-2020/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Formbot/Raptor/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Formbot/Raptor/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Formbot/Raptor/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Formbot/Raptor/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Formbot/T_Rex_2+/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Formbot/T_Rex_2+/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Formbot/T_Rex_2+/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Formbot/T_Rex_2+/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Formbot/T_Rex_3/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Formbot/T_Rex_3/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Formbot/T_Rex_3/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Formbot/T_Rex_3/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A10/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A10/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A10D/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A10D/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A10M/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A10M/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A10T/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A10T/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A20/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A20/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A20M/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A20M/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A20T/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A20T/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A30/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/A30/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/E180/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/E180/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/GT2560/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/MeCreator2/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/MeCreator2/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/PI3A PRO/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/PI3A PRO/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/Prusa i3 Pro B/bltouch/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/Prusa i3 Pro B/noprobe/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/HMS434/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/HMS434/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Infitary/i3-M508/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Infitary/i3-M508/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/JGAurora/A1/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/JGAurora/A1/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/JGAurora/A5/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/JGAurora/A5/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/JGAurora/A5/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/JGAurora/A5S/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/JGAurora/A5S/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/MakerParts/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/MakerParts/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/MakerParts/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Malyan/M150/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Malyan/M150/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Malyan/M150/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Malyan/M150/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Malyan/M200/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Malyan/M200/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Malyan/M200/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Micromake/C1/basic/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Micromake/C1/basic/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Micromake/C1/enhanced/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Micromake/C1/enhanced/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Micromake/C1/enhanced/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Mks/Robin/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Mks/Robin/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Mks/Robin_Lite3/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Mks/Robin_Lite3/ReadMe.txt
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Mks/Robin_Pro/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Mks/Robin_Pro/ReadMe.txt
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Mks/Sbase/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Mks/Sbase/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Mks/Sbase/README.txt
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Modix/Big60/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Modix/Big60/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Modix/Big60/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Modix/Big60/_Statusscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Printrbot/PrintrboardG2/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/RapideLite/RL200/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/RapideLite/RL200/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Renkforce/RF100/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Renkforce/RF100/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Renkforce/RF100XL/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Renkforce/RF100XL/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Renkforce/RF100v2/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Renkforce/RF100v2/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/RepRapPro/Huxley/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/RepRapWorld/Megatronics/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/RigidBot/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/RigidBot/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/SCARA/MP_SCARA/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/SCARA/MP_SCARA/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/SCARA/Morgan/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/SCARA/Morgan/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/STM32/Black_STM32F407VET6/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/STM32/STM32F103RE/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/STM32/STM32F4/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/STM32/stm32f103ret6/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Sanguinololu/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Sanguinololu/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tevo/Michelangelo/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tevo/Michelangelo/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tevo/Michelangelo/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tevo/Nereus/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tevo/Nereus/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tevo/Nereus/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tevo/Tarantula Pro/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tevo/Tarantula Pro/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tevo/Tarantula Pro/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tevo/Tornado/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/TheBorg/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/TheBorg/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/TinyBoy2/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/TinyBoy2/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tronxy/X1/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tronxy/X3A/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tronxy/X3A/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tronxy/X5S-2E/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tronxy/X5S-2E/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tronxy/X5S/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Tronxy/XY100/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/UltiMachine/Archim1/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/UltiMachine/Archim1/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/UltiMachine/Archim2/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/UltiMachine/Archim2/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/VORONDesign/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/VORONDesign/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/VORONDesign/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Velleman/K8200/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Velleman/K8200/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Velleman/K8200/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Velleman/K8400/Dual-head/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Velleman/K8400/Dual-head/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Velleman/K8400/Dual-head/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Velleman/K8400/Single-head/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Velleman/K8400/Single-head/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Velleman/K8400/Single-head/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/WASP/PowerWASP/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/WASP/PowerWASP/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/WASP/PowerWASP/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Wanhao/Duplicator 6/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Wanhao/Duplicator 6/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Wanhao/Duplicator i3 2.1/Chippy_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Wanhao/Duplicator i3 2.1/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Wanhao/Duplicator i3 2.1/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Wanhao/Duplicator i3 2.1/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Wanhao/Duplicator i3 2.1/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Wanhao/Duplicator i3 Mini/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/Wanhao/Duplicator i3 Mini/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/adafruit/ST7565/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Anycubic/Kossel/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Anycubic/Kossel/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Anycubic/Kossel/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Anycubic/Kossel/images/Version1Probe.jpg
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Anycubic/Kossel/images/Version2Probe.jpg
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Dreammaker/Overlord/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Dreammaker/Overlord/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Dreammaker/Overlord_Pro/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/FLSUN/QQ-S/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/FLSUN/QQ-S/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/FLSUN/auto_calibrate/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/FLSUN/kossel/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/FLSUN/kossel/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/FLSUN/kossel_mini/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Geeetech/Rostock 301/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Hatchbox_Alpha/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/MKS/SBASE/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/MKS/SBASE/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/MKS/SBASE/RRD Full Graphic Smart Controller.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Tevo Little Monster/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/Tevo Little Monster/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/generic/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/generic/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/kossel_clear/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/kossel_clear/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/kossel_mini/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/kossel_mini/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/kossel_pro/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/kossel_pro/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/kossel_xl/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/kossel_xl/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/delta/kossel_xl/README.md
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/gCreate/gMax1.5+/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/gCreate/gMax1.5+/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/gCreate/gMax1.5+/_Bootscreen.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/makibox/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/makibox/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/tvrrug/Round2/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/tvrrug/Round2/Configuration_adv.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/wt150/Configuration.h
delete mode 100644 firmware/marlin2.0 for Ender3/config/examples/wt150/Configuration_adv.h
create mode 100644 firmware/marlin2.0.6 bin/README.md
create mode 100644 firmware/marlin2.0.6 bin/Robin_e3_TMC2209.bin
diff --git a/firmware/firmware bin for Ender3(TMC2209)/README.md b/firmware/firmware bin for Ender3(TMC2209)/README.md
index a89455df..4dfe84e8 100644
--- a/firmware/firmware bin for Ender3(TMC2209)/README.md
+++ b/firmware/firmware bin for Ender3(TMC2209)/README.md
@@ -5,6 +5,7 @@ This bin file works with MKS motherboard and can be used directly on ender3 mach
- Copy Robin_e3.bin file to TF card
- Insert TF to MKS Robin E3 or MKS Robin E3D board
- Reset board or repower on
+- The marlin version is 2.0.1
## Parameter
- Robin_e3.bin firmware, the parameters are the same as the original ender3 machine
diff --git a/firmware/firmware bin for Ender3(TMC2209+Neopixel)/README.md b/firmware/firmware bin for Ender3(TMC2209+Neopixel)/README.md
index 240cdcf2..d1dbfddb 100644
--- a/firmware/firmware bin for Ender3(TMC2209+Neopixel)/README.md
+++ b/firmware/firmware bin for Ender3(TMC2209+Neopixel)/README.md
@@ -5,6 +5,7 @@ This bin file works with MKS motherboard and can be used directly on ender3 mach
- Copy Robin_e3.bin file to TF card
- Insert TF to MKS Robin E3 or MKS Robin E3D board
- Reset board or repower on
+- The marlin version is 2.0.1
## Parameter
- Robin_e3.bin firmware, the parameters are the same as the original ender3 machine
diff --git a/firmware/firmware bin for Ender3(TMC2209+Neopixel+MKS PWC)/README.md b/firmware/firmware bin for Ender3(TMC2209+Neopixel+MKS PWC)/README.md
index 49c90e94..e04fe021 100644
--- a/firmware/firmware bin for Ender3(TMC2209+Neopixel+MKS PWC)/README.md
+++ b/firmware/firmware bin for Ender3(TMC2209+Neopixel+MKS PWC)/README.md
@@ -5,6 +5,7 @@ This bin file works with MKS motherboard and can be used directly on ender3 mach
- Copy Robin_e3.bin file to TF card
- Insert TF to MKS Robin E3 or MKS Robin E3D board
- Reset board or repower on
+- The marlin version is 2.0.1
## Parameter
- Robin_e3.bin firmware, the parameters are the same as the original ender3 machine
diff --git a/firmware/marlin2.0 for Ender3/.editorconfig b/firmware/marlin2.0 for Ender3/.editorconfig
new file mode 100644
index 00000000..a0fa3eff
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/.editorconfig
@@ -0,0 +1,19 @@
+# editorconfig.org
+root = true
+
+[{*.patch,syntax_test_*}]
+trim_trailing_whitespace = false
+
+[{*.c,*.cpp,*.h}]
+charset = utf-8
+
+[{*.c,*.cpp,*.h,Makefile}]
+trim_trailing_whitespace = true
+insert_final_newline = true
+end_of_line = lf
+indent_style = space
+indent_size = 2
+
+[{*.py,*.conf,*.sublime-project}]
+indent_style = tab
+indent_size = 4
diff --git a/firmware/marlin2.0 for Ender3/.gitignore b/firmware/marlin2.0 for Ender3/.gitignore
index 5728e1f0..c163d339 100644
--- a/firmware/marlin2.0 for Ender3/.gitignore
+++ b/firmware/marlin2.0 for Ender3/.gitignore
@@ -1,6 +1,6 @@
#
# Marlin 3D Printer Firmware
-# Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+# Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
#
# Based on Sprinter and grbl.
# Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
# 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 .
+# along with this program. If not, see .
#
# Our automatic versioning scheme generates the following file
@@ -146,6 +146,9 @@ Marlin/*/*/readme.txt
Marlin/*/*/*/readme.txt
Marlin/*/*/*/*/readme.txt
+# Secure Credentials
+Configuration_Secure.h
+
#Visual Studio
*.sln
*.vcxproj
diff --git a/firmware/marlin2.0 for Ender3/LICENSE b/firmware/marlin2.0 for Ender3/LICENSE
index 7d917cf3..4ad6d9b1 100644
--- a/firmware/marlin2.0 for Ender3/LICENSE
+++ b/firmware/marlin2.0 for Ender3/LICENSE
@@ -3,7 +3,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
- Copyright (c) 2007 Free Software Foundation, Inc.
+ Copyright (c) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -647,7 +647,7 @@ the "copyright" line and a pointer to where the full notice is found.
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 .
+ along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
@@ -666,12 +666,12 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
-.
+.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
-.
+.
diff --git a/firmware/marlin2.0 for Ender3/Marlin/Configuration.h b/firmware/marlin2.0 for Ender3/Marlin/Configuration.h
index 96d198ef..2021c2b0 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/Configuration.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/Configuration.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -36,7 +36,7 @@
* Advanced settings can be found in Configuration_adv.h
*
*/
-#define CONFIGURATION_H_VERSION 020000
+#define CONFIGURATION_H_VERSION 020006
//===========================================================================
//============================= Getting Started =============================
@@ -45,13 +45,13 @@
/**
* Here are some standard links for getting your machine calibrated:
*
- * http://reprap.org/wiki/Calibration
- * http://youtu.be/wAL9d7FgInk
+ * https://reprap.org/wiki/Calibration
+ * https://youtu.be/wAL9d7FgInk
* http://calculator.josefprusa.cz
- * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
- * http://www.thingiverse.com/thing:5573
+ * https://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
+ * https://www.thingiverse.com/thing:5573
* https://sites.google.com/site/repraplogphase/calibration-of-your-reprap
- * http://www.thingiverse.com/thing:298812
+ * https://www.thingiverse.com/thing:298812
*/
//===========================================================================
@@ -99,6 +99,7 @@
/**
* Select the serial port on the board to use for communication with the host.
* This allows the connection of wireless adapters (for instance) to non-default port pins.
+ * Serial port -1 is the USB emulated serial port, if available.
* Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader.
*
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
@@ -107,9 +108,6 @@
/**
* Select a secondary serial port on the board to use for communication with the host.
- * This allows the connection of wireless adapters (for instance) to non-default port pins.
- * Serial port -1 is the USB emulated serial port, if available.
- *
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
*/
#define SERIAL_PORT_2 1
@@ -137,13 +135,13 @@
//#define CUSTOM_MACHINE_NAME "3D Printer"
// Printer's unique ID, used by some programs to differentiate between machines.
-// Choose your own or use a service like http://www.uuidgenerator.net/version4
+// Choose your own or use a service like https://www.uuidgenerator.net/version4
//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
// @section extruder
// This defines the number of extruders
-// :[1, 2, 3, 4, 5, 6]
+// :[0, 1, 2, 3, 4, 5, 6, 7, 8]
#define EXTRUDERS 1
// Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc.
@@ -152,6 +150,13 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
+// Save and restore temperature and fan speed on tool-change.
+// Set standby for the unselected tool with M104/106/109 T...
+#if ENABLED(SINGLENOZZLE)
+ //#define SINGLENOZZLE_STANDBY_TEMP
+ //#define SINGLENOZZLE_STANDBY_FAN
+#endif
+
/**
* Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants.
*
@@ -360,12 +365,15 @@
* -1 : thermocouple with AD595
* 0 : not used
* 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
- * 331 : (3.3V scaled thermistor 1 table)
+ * 331 : (3.3V scaled thermistor 1 table for MEGA)
+ * 332 : (3.3V scaled thermistor 1 table for DUE)
* 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
+ * 202 : 200k thermistor - Copymaster 3D
* 3 : Mendel-parts thermistor (4.7k pullup)
* 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
- * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup)
+ * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan, J-Head, and E3D) (4.7k pullup)
* 501 : 100K Zonestar (Tronxy X3A) Thermistor
+ * 502 : 100K Zonestar Thermistor used by hot bed in Zonestar Prusa P802M
* 512 : 100k RPW-Ultra hotend thermistor (4.7k pullup)
* 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
* 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
@@ -373,12 +381,15 @@
* 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
* 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
* 10 : 100k RS thermistor 198-961 (4.7k pullup)
- * 11 : 100k beta 3950 1% thermistor (4.7k pullup)
+ * 11 : 100k beta 3950 1% thermistor (Used in Keenovo AC silicone mats and most Wanhao i3 machines) (4.7k pullup)
* 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
* 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
* 15 : 100k thermistor calibration for JGAurora A5 hotend
* 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327
- * 20 : Pt100 with circuit in the Ultimainboard V2.x
+ * 20 : Pt100 with circuit in the Ultimainboard V2.x with 5v excitation (AVR)
+ * 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v excitation (STM32 \ LPC176x....)
+ * 22 : 100k (hotend) with 4.7k pullup to 3.3V and 220R to analog input (as in GTM32 Pro vB)
+ * 23 : 100k (bed) with 4.7k pullup to 3.3v and 220R to analog input (as in GTM32 Pro vB)
* 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x
* 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
* 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup
@@ -394,7 +405,7 @@
* 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
* 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
*
- * 1047 : Pt1000 with 4k7 pullup
+ * 1047 : Pt1000 with 4k7 pullup (E3D)
* 1010 : Pt1000 with 1k pullup (non standard)
* 147 : Pt100 with 4k7 pullup
* 110 : Pt100 with 1k pullup (non standard)
@@ -411,7 +422,10 @@
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_4 0
#define TEMP_SENSOR_5 0
+#define TEMP_SENSOR_6 0
+#define TEMP_SENSOR_7 0
#define TEMP_SENSOR_BED 1
+#define TEMP_SENSOR_PROBE 0
#define TEMP_SENSOR_CHAMBER 0
// Dummy thermistor constant temperature readings, for use with 998 and 999
@@ -439,6 +453,8 @@
#define HEATER_3_MINTEMP 5
#define HEATER_4_MINTEMP 5
#define HEATER_5_MINTEMP 5
+#define HEATER_6_MINTEMP 5
+#define HEATER_7_MINTEMP 5
#define BED_MINTEMP 5
// Above this temperature the heater will be switched off.
@@ -450,28 +466,26 @@
#define HEATER_3_MAXTEMP 275
#define HEATER_4_MAXTEMP 275
#define HEATER_5_MAXTEMP 275
+#define HEATER_6_MAXTEMP 275
+#define HEATER_7_MAXTEMP 275
#define BED_MAXTEMP 150
//===========================================================================
//============================= PID Settings ================================
//===========================================================================
-// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning
+// PID Tuning Guide here: https://reprap.org/wiki/PID_Tuning
// Comment the following line to disable PID and enable bang-bang.
#define PIDTEMP
#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current
#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
#define PID_K1 0.95 // Smoothing factor within any PID loop
+
#if ENABLED(PIDTEMP)
//#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM)
//#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM)
- //#define PID_DEBUG // Sends debug data to the serial port.
- //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
- //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
//#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
// Set/get with gcode: M301 E[extruder number, 0-2]
- #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
- // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
@@ -540,6 +554,14 @@
// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
#endif // PIDTEMPBED
+#if EITHER(PIDTEMP, PIDTEMPBED)
+ //#define PID_DEBUG // Sends debug data to the serial port. Use 'M303 D' to toggle activation.
+ //#define PID_OPENLOOP // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
+ //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
+ #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
+ // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
+#endif
+
// @section extruder
/**
@@ -654,12 +676,13 @@
*
* A4988 is assumed for unspecified drivers.
*
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
+ * TB6560, TB6600, TMC2100,
* TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
* TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
* TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE,
* TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
*/
#define X_DRIVER_TYPE TMC2209
#define Y_DRIVER_TYPE TMC2209
@@ -668,12 +691,15 @@
//#define Y2_DRIVER_TYPE A4988
//#define Z2_DRIVER_TYPE A4988
//#define Z3_DRIVER_TYPE A4988
+//#define Z4_DRIVER_TYPE A4988
#define E0_DRIVER_TYPE TMC2209
//#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988
//#define E3_DRIVER_TYPE A4988
//#define E4_DRIVER_TYPE A4988
//#define E5_DRIVER_TYPE A4988
+//#define E6_DRIVER_TYPE A4988
+//#define E7_DRIVER_TYPE A4988
// Enable this feature if all enabled endstop pins are interrupt-capable.
// This will remove the need to poll the interrupt pins, saving many CPU cycles.
@@ -685,7 +711,7 @@
* Enable if your probe or endstops falsely trigger due to noise.
*
* - Higher values may affect repeatability or accuracy of some bed probes.
- * - To fix noise install a 100nF ceramic capacitor inline with the switch.
+ * - To fix noise install a 100nF ceramic capacitor in parallel with the switch.
* - This feature is not required for common micro-switches mounted on PCBs
* based on the Makerbot design, which already have the 100nF capacitor.
*
@@ -693,6 +719,9 @@
*/
//#define ENDSTOP_NOISE_THRESHOLD 2
+// Check for stuck or disconnected endstops during homing moves.
+//#define DETECT_BROKEN_ENDSTOP
+
//=============================================================================
//============================== Movement Settings ============================
//=============================================================================
@@ -771,6 +800,8 @@
#define DEFAULT_YJERK 10.0
#define DEFAULT_ZJERK 0.4
+ //#define TRAVEL_EXTRA_XYJERK 0.0 // Additional jerk allowance for all travel moves
+
//#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2
#if ENABLED(LIMITED_JERK_EDITING)
#define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits
@@ -784,10 +815,12 @@
*
* See:
* https://reprap.org/forum/read.php?1,739819
- * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html
+ * https://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html
*/
#if DISABLED(CLASSIC_JERK)
#define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge
+ #define JD_HANDLE_SMALL_SEGMENTS // Use curvature estimation instead of just the junction angle
+ // for small segments (< 1mm) with large junction angles (> 135°).
#endif
/**
@@ -806,15 +839,18 @@
// @section probes
//
-// See http://marlinfw.org/docs/configuration/probes.html
+// See https://marlinfw.org/docs/configuration/probes.html
//
/**
- * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
- *
- * Enable this option for a probe connected to the Z Min endstop pin.
+ * Enable this option for a probe connected to the Z-MIN pin.
+ * The probe replaces the Z-MIN endstop and is used for Z homing.
+ * (Automatically enables USE_PROBE_FOR_Z_HOMING.)
*/
-//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
+#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
+
+// Force the use of the probe for Z-axis homing
+//#define USE_PROBE_FOR_Z_HOMING
/**
* Z_MIN_PROBE_PIN
@@ -872,6 +908,11 @@
*/
//#define BLTOUCH
+/**
+ * Pressure sensor with a BLTouch-like interface
+ */
+//#define CREALITY_TOUCH
+
/**
* Touch-MI Probe by hotends.fr
*
@@ -903,6 +944,21 @@
#define Z_PROBE_RETRACT_X X_MAX_POS
#endif
+// Duet Smart Effector (for delta printers) - https://bit.ly/2ul5U7J
+// When the pin is defined you can use M672 to set/reset the probe sensivity.
+//#define DUET_SMART_EFFECTOR
+#if ENABLED(DUET_SMART_EFFECTOR)
+ #define SMART_EFFECTOR_MOD_PIN -1 // Connect a GPIO pin to the Smart Effector MOD pin
+#endif
+
+/**
+ * Use StallGuard2 to probe the bed with the nozzle.
+ * Requires stallGuard-capable Trinamic stepper drivers.
+ * CAUTION: This can damage machines with Z lead screws.
+ * Take extreme care when setting up this feature.
+ */
+//#define SENSORLESS_PROBING
+
//
// For Z_PROBE_ALLEN_KEY see the Delta example configurations.
//
@@ -929,8 +985,9 @@
*/
#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
-// Certain types of probes need to stay away from edges
-#define MIN_PROBE_EDGE 10
+// Most probes should stay away from the edges of the bed, but
+// with NOZZLE_AS_PROBE this can be negative for a wider probing area.
+#define PROBING_MARGIN 10
// X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000
@@ -1039,15 +1096,19 @@
#define INVERT_E3_DIR false
#define INVERT_E4_DIR false
#define INVERT_E5_DIR false
+#define INVERT_E6_DIR false
+#define INVERT_E7_DIR false
// @section homing
-//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
+//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off.
-//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off.
+//#define Z_HOMING_HEIGHT 4 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
+ // Be sure to have this much clearance over your Z_MAX_POS to prevent grinding.
-//#define Z_HOMING_HEIGHT 4 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
- // Be sure you have this distance over your Z_MAX_POS in case.
+//#define Z_AFTER_HOMING 10 // (mm) Height to move to after homing Z
// Direction of endstops when homing; 1=MAX, -1=MIN
// :[-1,1]
@@ -1104,12 +1165,11 @@
*
* RAMPS-based boards use SERVO3_PIN for the first runout sensor.
* For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc.
- * By default the firmware assumes HIGH=FILAMENT PRESENT.
*/
//#define FILAMENT_RUNOUT_SENSOR
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
- #define FIL_RUNOUT_INVERTING false // Set to true to invert the logic of the sensor.
+ #define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present.
#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
//#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.
@@ -1209,6 +1269,7 @@
#define MESH_TEST_HOTEND_TEMP 205 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool.
#define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool.
#define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool.
+ #define G26_RETRACT_MULTIPLIER 1.0 // G26 Q (retraction) used by default between mesh test elements.
#endif
#endif
@@ -1288,10 +1349,10 @@
//#define LEVEL_BED_CORNERS
#if ENABLED(LEVEL_BED_CORNERS)
- #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling
- #define LEVEL_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners
- #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points
- //#define LEVEL_CENTER_TOO // Move to the center after the last corner
+ #define LEVEL_CORNERS_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets
+ #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points
+ #define LEVEL_CORNERS_Z_HOP 4.0 // (mm) Z height of nozzle between leveling points
+ //#define LEVEL_CENTER_TOO // Move to the center after the last corner
#endif
/**
@@ -1300,7 +1361,6 @@
*/
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"
-
// @section homing
// The center of the bed is at (X=0, Y=0)
@@ -1318,14 +1378,14 @@
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
-// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing.
// - Prevent Z homing when the Z probe is outside bed area.
//
//#define Z_SAFE_HOMING
#if ENABLED(Z_SAFE_HOMING)
- #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28).
- #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28).
+ #define Z_SAFE_HOMING_X_POINT X_CENTER // X point for Z homing
+ #define Z_SAFE_HOMING_Y_POINT Y_CENTER // Y point for Z homing
#endif
// Homing speeds (mm/m)
@@ -1410,6 +1470,7 @@
#define EEPROM_SETTINGS // Persistent storage with M500 and M501
//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release!
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM.
+#define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load
#if ENABLED(EEPROM_SETTINGS)
#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors.
#endif
@@ -1424,11 +1485,6 @@
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating
-//
-// M100 Free Memory Watcher
-//
-//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage
-
//
// G20/G21 Inch mode support
//
@@ -1468,8 +1524,11 @@
#if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z_raise }
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
+ //#define NOZZLE_PARK_X_ONLY // X move only is required to park
+ //#define NOZZLE_PARK_Y_ONLY // Y move only is required to park
+ #define NOZZLE_PARK_Z_RAISE_MIN 2 // (mm) Always raise Z by at least this distance
#define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis)
- #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers)
+ #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers)
#endif
/**
@@ -1519,9 +1578,10 @@
// Default number of triangles
#define NOZZLE_CLEAN_TRIANGLES 3
- // Specify positions as { X, Y, Z }
- #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) }
- #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) }
+ // Specify positions for each tool as { { X, Y, Z }, { X, Y, Z } }
+ // Dual hotend system may use { { -20, (Y_BED_SIZE / 2), (Z_MIN_POS + 1) }, { 420, (Y_BED_SIZE / 2), (Z_MIN_POS + 1) }}
+ #define NOZZLE_CLEAN_START_POINT { { 30, 30, (Z_MIN_POS + 1) } }
+ #define NOZZLE_CLEAN_END_POINT { { 100, 60, (Z_MIN_POS + 1) } }
// Circular pattern radius
#define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5
@@ -1535,6 +1595,10 @@
// Enable for a purge/clean station that's always at the gantry height (thus no Z move)
//#define NOZZLE_CLEAN_NO_Z
+
+ // Explicit wipe G-code script applies to a G12 with no arguments.
+ //#define WIPE_SEQUENCE_COMMANDS "G1 X-17 Y25 Z10 F4000\nG1 Z1\nM114\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 Z15\nM400\nG0 X-10.0 Y-9.0"
+
#endif
/**
@@ -1579,10 +1643,10 @@
*
* Select the language to display on the LCD. These languages are available:
*
- * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana,
- * ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test
+ * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, hu, it,
+ * jp_kana, ko_KR, nl, pl, pt, pt_br, ro ru, sk, tr, uk, vi, zh_CN, zh_TW, test
*
- * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' }
+ * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'hu':'Hungarian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ro':'Romanian', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' }
*/
#define LCD_LANGUAGE en
@@ -1604,7 +1668,7 @@
* - Click the controller to view the LCD menu
* - The LCD will display Japanese, Western, or Cyrillic text
*
- * See http://marlinfw.org/docs/development/lcd_language.html
+ * See https://marlinfw.org/docs/development/lcd_language.html
*
* :['JAPANESE', 'WESTERN', 'CYRILLIC']
*/
@@ -1731,7 +1795,7 @@
//
// RepRapDiscount Smart Controller.
-// http://reprap.org/wiki/RepRapDiscount_Smart_Controller
+// https://reprap.org/wiki/RepRapDiscount_Smart_Controller
//
// Note: Usually sold with a white PCB.
//
@@ -1755,13 +1819,13 @@
//
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
-// http://reprap.org/wiki/PanelOne
+// https://reprap.org/wiki/PanelOne
//
//#define PANEL_ONE
//
// GADGETS3D G3D LCD/SD Controller
-// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel
+// https://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel
//
// Note: Usually sold with a blue PCB.
//
@@ -1848,7 +1912,7 @@
//
// 2-wire Non-latching LCD SR from https://goo.gl/aJJ4sH
-// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD
+// LCD configuration: https://reprap.org/wiki/SAV_3D_LCD
//
//#define SAV_3DLCD
@@ -1870,10 +1934,12 @@
// IMPORTANT: The U8glib library is required for Graphical Display!
// https://github.com/olikraus/U8glib_Arduino
//
+// NOTE: If the LCD is unresponsive you may need to reverse the plugs.
+//
//
// RepRapDiscount FULL GRAPHIC Smart Controller
-// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
+// https://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
//
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
@@ -1886,20 +1952,20 @@
//
// Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD
-// http://panucatt.com
+// https://www.panucatt.com
//
//#define VIKI2
//#define miniVIKI
//
// MakerLab Mini Panel with graphic
-// controller and SD support - http://reprap.org/wiki/Mini_panel
+// controller and SD support - https://reprap.org/wiki/Mini_panel
//
//#define MINIPANEL
//
// MaKr3d Makr-Panel with graphic controller and SD support.
-// http://reprap.org/wiki/MaKr3d_MaKrPanel
+// https://reprap.org/wiki/MaKr3d_MaKrPanel
//
//#define MAKRPANEL
@@ -1938,14 +2004,21 @@
//
//#define MKS_MINI_12864
+//
+// MKS LCD12864A/B with graphic controller and SD support. Follows MKS_MINI_12864 pinout.
+// https://www.aliexpress.com/item/33018110072.html
+//
+//#define MKS_LCD12864
+
//
// FYSETC variant of the MINI12864 graphic controller with SD support
// https://wiki.fysetc.com/Mini12864_Panel/
//
-//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default
-//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on)
-//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight
-//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight
+//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default
+//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on)
+//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight
+//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight
+//#define FYSETC_GENERIC_12864_1_1 // Larger display with basic ON/OFF backlight.
//
// Factory display for Creality CR-10
@@ -1956,6 +2029,11 @@
//
//#define CR10_STOCKDISPLAY
+//
+// Ender-2 OEM display, a variant of the MKS_MINI_12864
+//
+//#define ENDER2_STOCKDISPLAY
+
//
// ANET and Tronxy Graphical Controller
//
@@ -1973,7 +2051,7 @@
//
// Silvergate GLCD controller
-// http://github.com/android444/Silvergate
+// https://github.com/android444/Silvergate
//
//#define SILVER_GATE_GLCD_CONTROLLER
@@ -2002,7 +2080,7 @@
//
// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER
-// http://reprap.org/wiki/MKS_12864OLED
+// https://reprap.org/wiki/MKS_12864OLED
//
// Tiny, but very sharp OLED display
//
@@ -2019,17 +2097,26 @@
//
//#define OVERLORD_OLED
+//
+// FYSETC OLED 2.42" 128 × 64 FULL GRAPHICS CONTROLLER with WS2812 RGB
+// Where to find : https://www.aliexpress.com/item/4000345255731.html
+//#define FYSETC_242_OLED_12864 // Uses the SSD1309 controller
+
//=============================================================================
//========================== Extensible UI Displays ===========================
//=============================================================================
//
-// DGUS Touch Display with DWIN OS
+// DGUS Touch Display with DWIN OS. (Choose one.)
+// ORIGIN : https://www.aliexpress.com/item/32993409517.html
+// FYSETC : https://www.aliexpress.com/item/32961471929.html
//
-//#define DGUS_LCD
+//#define DGUS_LCD_UI_ORIGIN
+//#define DGUS_LCD_UI_FYSETC
+//#define DGUS_LCD_UI_HIPRECY
//
-// Touch-screen LCD for Malyan M200 printers
+// Touch-screen LCD for Malyan M200/M300 printers
//
//#define MALYAN_LCD
@@ -2045,19 +2132,45 @@
//
//#define EXTENSIBLE_UI
+#if ENABLED(EXTENSIBLE_UI)
+ //#define EXTUI_LOCAL_BEEPER // Enables use of local Beeper pin with external display
+#endif
+
//=============================================================================
//=============================== Graphical TFTs ==============================
//=============================================================================
//
// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.)
+// Upscaled 128x64 Marlin UI
//
//#define FSMC_GRAPHICAL_TFT
+//
+// TFT LVGL UI
+//
+// Using default MKS icons and fonts from: https://git.io/JJvzK
+// Just copy the 'assets' folder from the build directory to the
+// root of your SD card, together with the compiled firmware.
+//
+//#define TFT_LVGL_UI_FSMC // Robin nano v1.2 uses FSMC
+//#define TFT_LVGL_UI_SPI // Robin nano v2.0 uses SPI
+
+//
+// Anycubic Mega TFT (AI3M)
+//
+//#define ANYCUBIC_TFT_MODEL
+//#define ANYCUBIC_TFT_DEBUG
+
//=============================================================================
//============================ Other Controllers ============================
//=============================================================================
+//
+// Ender-3 v2 OEM display. A DWIN display with Rotary Encoder.
+//
+//#define DWIN_CREALITY_LCD
+
//
// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8
//
@@ -2074,7 +2187,7 @@
//
// RepRapWorld REPRAPWORLD_KEYPAD v1.1
-// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
+// https://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
//
//#define REPRAPWORLD_KEYPAD
//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press
@@ -2111,7 +2224,7 @@
// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis)
//#define TEMP_STAT_LEDS
-// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure
+// SkeinForge sends the wrong arc G-codes when using Arc Point as fillet procedure
//#define SF_ARC_FIX
// Support for the BariCUDA Paste Extruder
@@ -2124,7 +2237,6 @@
//#define PCA9632
// Support for PCA9533 PWM LED driver
-// https://github.com/mikeshub/SailfishRGB_LED
//#define PCA9533
/**
@@ -2160,7 +2272,7 @@
#endif
// Support for Adafruit Neopixel LED driver
-#define NEOPIXEL_LED
+//#define NEOPIXEL_LED
#if ENABLED(NEOPIXEL_LED)
#define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
#define NEOPIXEL_PIN PA2//4 // LED driving pin
diff --git a/firmware/marlin2.0 for Ender3/Marlin/Configuration_adv.h b/firmware/marlin2.0 for Ender3/Marlin/Configuration_adv.h
index 98429f0a..c21abd11 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/Configuration_adv.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/Configuration_adv.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -31,14 +31,27 @@
* Basic settings can be found in Configuration.h
*
*/
-#define CONFIGURATION_ADV_H_VERSION 020000
+#define CONFIGURATION_ADV_H_VERSION 020006
// @section temperature
//===========================================================================
-//=============================Thermal Settings ============================
+//============================= Thermal Settings ============================
//===========================================================================
+/**
+ * Thermocouple sensors are quite sensitive to noise. Any noise induced in
+ * the sensor wires, such as by stepper motor wires run in parallel to them,
+ * may result in the thermocouple sensor reporting spurious errors. This
+ * value is the number of errors which can occur in a row before the error
+ * is reported. This allows us to ignore intermittent error conditions while
+ * still detecting an actual failure, which should result in a continuous
+ * stream of errors from the sensor.
+ *
+ * Set this value to 0 to fail on the first error to occur.
+ */
+#define THERMOCOUPLE_MAX_ERRORS 15
+
//
// Custom Thermistor 1000 parameters
//
@@ -78,6 +91,18 @@
#define HOTEND5_BETA 3950 // Beta value
#endif
+#if TEMP_SENSOR_6 == 1000
+ #define HOTEND6_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
+ #define HOTEND6_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
+ #define HOTEND6_BETA 3950 // Beta value
+#endif
+
+#if TEMP_SENSOR_7 == 1000
+ #define HOTEND7_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
+ #define HOTEND7_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
+ #define HOTEND7_BETA 3950 // Beta value
+#endif
+
#if TEMP_SENSOR_BED == 1000
#define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
@@ -165,28 +190,28 @@
* Thermal Protection parameters for the bed are just as above for hotends.
*/
#if ENABLED(THERMAL_PROTECTION_BED)
- #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
- #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
+ #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
+ #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
/**
* As described above, except for the bed (M140/M190/M303).
*/
- #define WATCH_BED_TEMP_PERIOD 60 // Seconds
- #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
+ #define WATCH_BED_TEMP_PERIOD 60 // Seconds
+ #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
#endif
/**
* Thermal Protection parameters for the heated chamber.
*/
#if ENABLED(THERMAL_PROTECTION_CHAMBER)
- #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds
+ #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius
/**
* Heated chamber watch settings (M141/M191).
*/
- #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds
- #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius
+ #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds
+ #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius
#endif
#if ENABLED(PIDTEMP)
@@ -194,7 +219,7 @@
// A well-chosen Kc value should add just enough power to melt the increased material volume.
//#define PID_EXTRUSION_SCALING
#if ENABLED(PID_EXTRUSION_SCALING)
- #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
+ #define DEFAULT_Kc (100) // heating power = Kc * e_speed
#define LPQ_MAX_LEN 50
#endif
@@ -250,23 +275,30 @@
#endif
/**
- * Automatic Temperature:
- * The hotend target temperature is calculated by all the buffered lines of gcode.
- * The maximum buffered steps/sec of the extruder motor is called "se".
- * Start autotemp mode with M109 S B F
- * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
- * mintemp and maxtemp. Turn this off by executing M109 without F*
- * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
- * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
+ * Automatic Temperature Mode
+ *
+ * Dynamically adjust the hotend target temperature based on planned E moves.
+ *
+ * (Contrast with PID_EXTRUSION_SCALING, which tracks E movement and adjusts PID
+ * behavior using an additional kC value.)
+ *
+ * Autotemp is calculated by (mintemp + factor * mm_per_sec), capped to maxtemp.
+ *
+ * Enable Autotemp Mode with M104/M109 F S B.
+ * Disable by sending M104/M109 with no F parameter (or F0 with AUTOTEMP_PROPORTIONAL).
*/
#define AUTOTEMP
#if ENABLED(AUTOTEMP)
- #define AUTOTEMP_OLDWEIGHT 0.98
+ #define AUTOTEMP_OLDWEIGHT 0.98
+ // Turn on AUTOTEMP on M104/M109 by default using proportions set here
+ //#define AUTOTEMP_PROPORTIONAL
+ #if ENABLED(AUTOTEMP_PROPORTIONAL)
+ #define AUTOTEMP_MIN_P 0 // (°C) Added to the target temperature
+ #define AUTOTEMP_MAX_P 5 // (°C) Added to the target temperature
+ #define AUTOTEMP_FACTOR_P 1 // Apply this F parameter by default (overridden by M104/M109 F)
+ #endif
#endif
-// Show extra position information with 'M114 D'
-//#define M114_DETAIL
-
// Show Temperature ADC value
// Enable for M105 to include ADC values read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
@@ -311,6 +343,18 @@
#define EXTRUDER_RUNOUT_EXTRUDE 5 // (mm)
#endif
+/**
+ * Hotend Idle Timeout
+ * Prevent filament in the nozzle from charring and causing a critical jam.
+ */
+//#define HOTEND_IDLE_TIMEOUT
+#if ENABLED(HOTEND_IDLE_TIMEOUT)
+ #define HOTEND_IDLE_TIMEOUT_SEC (5*60) // (seconds) Time without extruder movement to trigger protection
+ #define HOTEND_IDLE_MIN_TRIGGER 180 // (°C) Minimum temperature to enable hotend protection
+ #define HOTEND_IDLE_NOZZLE_TARGET 0 // (°C) Safe temperature for the nozzle after timeout
+ #define HOTEND_IDLE_BED_TARGET 0 // (°C) Safe temperature for the bed after timeout
+#endif
+
// @section temperature
// Calibration for AD595 / AD8495 sensor to adjust temperature measurements.
@@ -324,15 +368,22 @@
* Controller Fan
* To cool down the stepper drivers and MOSFETs.
*
- * The fan will turn on automatically whenever any stepper is enabled
- * and turn off after a set period after all steppers are turned off.
+ * The fan turns on automatically whenever any driver is enabled and turns
+ * off (or reduces to idle speed) shortly after drivers are turned off.
*/
//#define USE_CONTROLLER_FAN
#if ENABLED(USE_CONTROLLER_FAN)
- //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan
- #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled
- #define CONTROLLERFAN_SPEED 255 // 255 == full speed
- //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled
+ //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan
+ //#define CONTROLLER_FAN_USE_Z_ONLY // With this option only the Z axis is considered
+ //#define CONTROLLER_FAN_IGNORE_Z // Ignore Z stepper. Useful when stepper timeout is disabled.
+ #define CONTROLLERFAN_SPEED_MIN 0 // (0-255) Minimum speed. (If set below this value the fan is turned off.)
+ #define CONTROLLERFAN_SPEED_ACTIVE 255 // (0-255) Active speed, used when any motor is enabled
+ #define CONTROLLERFAN_SPEED_IDLE 0 // (0-255) Idle speed, used when motors are disabled
+ #define CONTROLLERFAN_IDLE_TIME 60 // (seconds) Extra time to keep the fan running after disabling motors
+ //#define CONTROLLER_FAN_EDITABLE // Enable M710 configurable settings
+ #if ENABLED(CONTROLLER_FAN_EDITABLE)
+ #define CONTROLLER_FAN_MENU // Enable the Controller Fan submenu
+ #endif
#endif
// When first starting the main fan, run it at full speed for the
@@ -368,7 +419,7 @@
* FAST_PWM_FAN_FREQUENCY [undefined by default]
* Set this to your desired frequency.
* If left undefined this defaults to F = F_CPU/(2*255*1)
- * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers
+ * i.e., F = 31.4kHz on 16MHz microcontrollers or F = 39.2kHz on 20MHz microcontrollers.
* These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required
* NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior.
*
@@ -405,6 +456,8 @@
#define E3_AUTO_FAN_PIN -1
#define E4_AUTO_FAN_PIN -1
#define E5_AUTO_FAN_PIN -1
+#define E6_AUTO_FAN_PIN -1
+#define E7_AUTO_FAN_PIN -1
#define CHAMBER_AUTO_FAN_PIN -1
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
@@ -479,7 +532,7 @@
//#define X_DUAL_ENDSTOPS
#if ENABLED(X_DUAL_ENDSTOPS)
#define X2_USE_ENDSTOP _XMAX_
- #define X_DUAL_ENDSTOPS_ADJUSTMENT 0
+ #define X2_ENDSTOP_ADJUSTMENT 0
#endif
#endif
@@ -489,27 +542,28 @@
//#define Y_DUAL_ENDSTOPS
#if ENABLED(Y_DUAL_ENDSTOPS)
#define Y2_USE_ENDSTOP _YMAX_
- #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0
- #endif
-#endif
-
-//#define Z_DUAL_STEPPER_DRIVERS
-#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
- //#define Z_DUAL_ENDSTOPS
- #if ENABLED(Z_DUAL_ENDSTOPS)
- #define Z2_USE_ENDSTOP _XMAX_
- #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0
+ #define Y2_ENDSTOP_ADJUSTMENT 0
#endif
#endif
-//#define Z_TRIPLE_STEPPER_DRIVERS
-#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
- //#define Z_TRIPLE_ENDSTOPS
- #if ENABLED(Z_TRIPLE_ENDSTOPS)
- #define Z2_USE_ENDSTOP _XMAX_
- #define Z3_USE_ENDSTOP _YMAX_
- #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0
- #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0
+//
+// For Z set the number of stepper drivers
+//
+#define NUM_Z_STEPPER_DRIVERS 1 // (1-4) Z options change based on how many
+
+#if NUM_Z_STEPPER_DRIVERS > 1
+ //#define Z_MULTI_ENDSTOPS
+ #if ENABLED(Z_MULTI_ENDSTOPS)
+ #define Z2_USE_ENDSTOP _XMAX_
+ #define Z2_ENDSTOP_ADJUSTMENT 0
+ #if NUM_Z_STEPPER_DRIVERS >= 3
+ #define Z3_USE_ENDSTOP _YMAX_
+ #define Z3_ENDSTOP_ADJUSTMENT 0
+ #endif
+ #if NUM_Z_STEPPER_DRIVERS >= 4
+ #define Z4_USE_ENDSTOP _ZMAX_
+ #define Z4_ENDSTOP_ADJUSTMENT 0
+ #endif
#endif
#endif
@@ -559,8 +613,7 @@
// Default x offset in duplication mode (typically set to half print bed width)
#define DEFAULT_DUPLICATION_X_OFFSET 100
-
-#endif // DUAL_X_CARRIAGE
+#endif
// Activate a solenoid on the active extruder with M380. Disable all with M381.
// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid.
@@ -568,19 +621,24 @@
// @section homing
-// Homing hits each endstop, retracts by these distances, then does a slower bump.
-#define X_HOME_BUMP_MM 5
-#define Y_HOME_BUMP_MM 5
-#define Z_HOME_BUMP_MM 2
-#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)
-//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially
-//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing
+/**
+ * Homing Procedure
+ * Homing (G28) does an indefinite move towards the endstops to establish
+ * the position of the toolhead relative to the workspace.
+ */
+
+//#define SENSORLESS_BACKOFF_MM { 2, 2 } // (mm) Backoff from endstops before sensorless homing
-// When G28 is called, this option will make Y home before X
-//#define HOME_Y_BEFORE_X
+#define HOMING_BUMP_MM { 5, 5, 2 } // (mm) Backoff from endstops after first bump
+#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)
-// Enable this if X or Y can't home without homing the other axis first.
-//#define CODEPENDENT_XY_HOMING
+//#define HOMING_BACKOFF_POST_MM { 2, 2, 2 } // (mm) Backoff from endstops after homing
+
+//#define QUICK_HOME // If G28 contains XY do a diagonal move first
+//#define HOME_Y_BEFORE_X // If G28 contains XY home Y before X
+//#define CODEPENDENT_XY_HOMING // If X/Y can't home without homing Y/X first
+
+// @section bltouch
#if ENABLED(BLTOUCH)
/**
@@ -588,8 +646,8 @@
* Do not activate settings that the probe might not understand. Clones might misunderstand
* advanced commands.
*
- * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then
- * check the wiring of the BROWN, RED and ORANGE wires.
+ * Note: If the probe is not deploying, do a "Reset" and "Self-Test" and then check the
+ * wiring of the BROWN, RED and ORANGE wires.
*
* Note: If the trigger signal of your probe is not being recognized, it has been very often
* because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable"
@@ -649,17 +707,45 @@
#endif // BLTOUCH
+// @section extras
+
/**
* Z Steppers Auto-Alignment
* Add the G34 command to align multiple Z steppers using a bed probe.
*/
//#define Z_STEPPER_AUTO_ALIGN
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
- // Define probe X and Y positions for Z1, Z2 [, Z3]
- #define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } }
+ // Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]]
+ // If not defined, probe limits will be used.
+ // Override with 'M422 S X Y'
+ //#define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } }
+
+ /**
+ * Orientation for the automatically-calculated probe positions.
+ * Override Z stepper align points with 'M422 S X Y'
+ *
+ * 2 Steppers: (0) (1)
+ * | | 2 |
+ * | 1 2 | |
+ * | | 1 |
+ *
+ * 3 Steppers: (0) (1) (2) (3)
+ * | 3 | 1 | 2 1 | 2 |
+ * | | 3 | | 3 |
+ * | 1 2 | 2 | 3 | 1 |
+ *
+ * 4 Steppers: (0) (1) (2) (3)
+ * | 4 3 | 1 4 | 2 1 | 3 2 |
+ * | | | | |
+ * | 1 2 | 2 3 | 3 4 | 4 1 |
+ *
+ */
+ #ifndef Z_STEPPER_ALIGN_XY
+ //#define Z_STEPPERS_ORIENTATION 0
+ #endif
// Provide Z stepper positions for more rapid convergence in bed alignment.
- // Currently requires triple stepper drivers.
+ // Requires triple stepper drivers (i.e., set NUM_Z_STEPPER_DRIVERS to 3)
//#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
// Define Stepper XY positions for Z1, Z2, Z3 corresponding to
@@ -667,23 +753,47 @@
// Define one position per Z stepper in stepper driver order.
#define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } }
#else
- // Amplification factor. Used to scale the correction step up or down.
- // In case the stepper (spindle) position is further out than the test point.
- // Use a value > 1. NOTE: This may cause instability
- #define Z_STEPPER_ALIGN_AMP 1.0
+ // Amplification factor. Used to scale the correction step up or down in case
+ // the stepper (spindle) position is farther out than the test point.
+ #define Z_STEPPER_ALIGN_AMP 1.0 // Use a value > 1.0 NOTE: This may cause instability!
#endif
- // Set number of iterations to align
- #define Z_STEPPER_ALIGN_ITERATIONS 3
+ // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm
+ #define G34_MAX_GRADE 5 // (%) Maximum incline that G34 will handle
+ #define Z_STEPPER_ALIGN_ITERATIONS 5 // Number of iterations to apply during alignment
+ #define Z_STEPPER_ALIGN_ACC 0.02 // Stop iterating early if the accuracy is better than this
+ #define RESTORE_LEVELING_AFTER_G34 // Restore leveling after G34 is done?
+ // After G34, re-home Z (G28 Z) or just calculate it from the last probe heights?
+ // Re-homing might be more precise in reproducing the actual 'G28 Z' homing height, especially on an uneven bed.
+ #define HOME_AFTER_G34
+#endif
+
+//
+// Add the G35 command to read bed corners to help adjust screws.
+//
+//#define ASSISTED_TRAMMING
+#if ENABLED(ASSISTED_TRAMMING)
+
+ // Define positions for probing points, use the hotend as reference not the sensor.
+ #define TRAMMING_POINT_XY { { 20, 20 }, { 200, 20 }, { 200, 200 }, { 20, 200 } }
+
+ // Define positions names for probing points.
+ #define TRAMMING_POINT_NAME_1 "Front-Left"
+ #define TRAMMING_POINT_NAME_2 "Front-Right"
+ #define TRAMMING_POINT_NAME_3 "Back-Right"
+ #define TRAMMING_POINT_NAME_4 "Back-Left"
// Enable to restore leveling setup after operation
- #define RESTORE_LEVELING_AFTER_G34
+ #define RESTORE_LEVELING_AFTER_G35
- // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm
- #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle
+ /**
+ * Screw thread:
+ * M3: 30 = Clockwise, 31 = Counter-Clockwise
+ * M4: 40 = Clockwise, 41 = Counter-Clockwise
+ * M5: 50 = Clockwise, 51 = Counter-Clockwise
+ */
+ #define TRAMMING_SCREW_THREAD 30
- // Stop criterion. If the accuracy is better than this stop iterating early
- #define Z_STEPPER_ALIGN_ACC 0.02
#endif
// @section motion
@@ -714,15 +824,25 @@
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// Minimum time that a segment needs to take if the buffer is emptied
-#define DEFAULT_MINSEGMENTTIME 20000 // (ms)
+#define DEFAULT_MINSEGMENTTIME 20000 // (µs)
-// If defined the movements slow down when the look ahead buffer is only half full
+// Slow down the machine if the look ahead buffer is (by default) half full.
+// Increase the slowdown divisor for larger buffer sizes.
#define SLOWDOWN
+#if ENABLED(SLOWDOWN)
+ #define SLOWDOWN_DIVISOR 2
+#endif
-// Frequency limit
-// See nophead's blog for more info
-// Not working O
-//#define XY_FREQUENCY_LIMIT 15
+/**
+ * XY Frequency limit
+ * Reduce resonance by limiting the frequency of small zigzag infill moves.
+ * See https://hydraraptor.blogspot.com/2010/12/frequency-limit.html
+ * Use M201 F G to change limits at runtime.
+ */
+//#define XY_FREQUENCY_LIMIT 10 // (Hz) Maximum frequency of small zigzag infill moves. Set with M201 F.
+#ifdef XY_FREQUENCY_LIMIT
+ #define XY_FREQUENCY_MIN_PERCENT 5 // (percent) Minimum FR percentage to apply. Set with M201 G.
+#endif
// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
// of the buffer and all stops. This should not be much greater than zero and should only be changed
@@ -778,6 +898,9 @@
//#define CALIBRATION_GCODE
#if ENABLED(CALIBRATION_GCODE)
+ //#define CALIBRATION_SCRIPT_PRE "M117 Starting Auto-Calibration\nT0\nG28\nG12\nM117 Calibrating..."
+ //#define CALIBRATION_SCRIPT_POST "M500\nM117 Calibration data saved"
+
#define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm
#define CALIBRATION_FEEDRATE_SLOW 60 // mm/m
@@ -806,10 +929,10 @@
// probing on a screwhead or hollow washer, probe near the edges.
//#define CALIBRATION_MEASURE_AT_TOP_EDGES
- // Define pin which is read during calibration
+ // Define the pin to read during calibration
#ifndef CALIBRATION_PIN
- #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop
- #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin
+ //#define CALIBRATION_PIN -1 // Define here to override the default pin
+ #define CALIBRATION_PIN_INVERTING false // Set to true to invert the custom pin
//#define CALIBRATION_PIN_PULLDOWN
#define CALIBRATION_PIN_PULLUP
#endif
@@ -834,7 +957,7 @@
//#define MICROSTEP16 LOW,LOW,HIGH
//#define MICROSTEP32 HIGH,LOW,HIGH
-// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
+// Microstep settings (Requires a board with pins named X_MS1, X_MS2, etc.)
#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16]
/**
@@ -861,9 +984,20 @@
//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
-// Use an I2C based DIGIPOT (e.g., Azteeg X3 Pro)
-//#define DIGIPOT_I2C
-#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)
+/**
+ * I2C-based DIGIPOTs (e.g., Azteeg X3 Pro)
+ */
+//#define DIGIPOT_MCP4018 // Requires https://github.com/stawel/SlowSoftI2CMaster
+//#define DIGIPOT_MCP4451
+#if EITHER(DIGIPOT_MCP4018, DIGIPOT_MCP4451)
+ #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT:4 AZTEEG_X3_PRO:8 MKS_SBASE:5 MIGHTYBOARD_REVE:5
+
+ // Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS.
+ // These correspond to the physical drivers, so be mindful if the order is changed.
+ #define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO
+
+ //#define DIGIPOT_USE_RAW_VALUES // Use DIGIPOT_MOTOR_CURRENT raw wiper values (instead of A4988 motor currents)
+
/**
* Common slave addresses:
*
@@ -874,16 +1008,10 @@
* AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451
* MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018
*/
- #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT
- #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT
+ //#define DIGIPOT_I2C_ADDRESS_A 0x2C // Unshifted slave address for first DIGIPOT
+ //#define DIGIPOT_I2C_ADDRESS_B 0x2D // Unshifted slave address for second DIGIPOT
#endif
-//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster
-#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5
-// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS.
-// These correspond to the physical drivers, so be mindful if the order is changed.
-#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO
-
//===========================================================================
//=============================Additional Features===========================
//===========================================================================
@@ -958,7 +1086,11 @@
// Show the E position (filament used) during printing
//#define LCD_SHOW_E_TOTAL
-#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS
+#if ENABLED(SHOW_BOOTSCREEN)
+ #define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)
+#endif
+
+#if HAS_GRAPHICAL_LCD && EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
//#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits
//#define SHOW_REMAINING_TIME // Display estimated time to completion
#if ENABLED(SHOW_REMAINING_TIME)
@@ -967,7 +1099,7 @@
#endif
#endif
-#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS
+#if HAS_CHARACTER_LCD && EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
//#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing
#if ENABLED(LCD_PROGRESS_BAR)
#define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar
@@ -980,15 +1112,16 @@
#if ENABLED(SDSUPPORT)
- // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
- // around this by connecting a push button or single throw switch to the pin defined
- // as SD_DETECT_PIN in your board's pins definitions.
- // This setting should be disabled unless you are using a push button, pulling the pin to ground.
- // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER).
- #define SD_DETECT_INVERTED
+ // The standard SD detect circuit reads LOW when media is inserted and HIGH when empty.
+ // Enable this option and set to HIGH if your SD cards are incorrectly detected.
+ //#define SD_DETECT_STATE HIGH
+
+ //#define SDCARD_READONLY // Read-only SD card (to save over 2K of flash)
- #define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished
- #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the Z enabled so your bed stays in place.
+ #define SD_PROCEDURE_DEPTH 1 // Increase if you need more nested M32 calls
+
+ #define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished
+ #define SD_FINISHED_RELEASECOMMAND "M84" // Use "M84XYE" to keep Z enabled so your bed stays in place
// Reverse SD sort to show "more recent" files first, according to the card's FAT.
// Since the FAT gets out of order with usage, SDCARD_SORT_ALPHA is recommended.
@@ -1000,6 +1133,10 @@
#define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27")
+ #if ENABLED(PRINTER_EVENT_LEDS)
+ #define PE_LEDS_COMPLETED_TIME (30*60) // (seconds) Time to keep the LED "done" color before restoring normal illumination
+ #endif
+
/**
* Continue after Power-Loss (Creality3D)
*
@@ -1010,17 +1147,18 @@
*/
#define POWER_LOSS_RECOVERY
#if ENABLED(POWER_LOSS_RECOVERY)
+ #define PLR_ENABLED_DEFAULT true // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss
//#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS)
//#define POWER_LOSS_PIN PB10// Pin to detect power loss
- //#define POWER_LOSS_STATE LOW// State of pin indicating power loss
+ //#define POWER_LOSS_STATE HIGH// State of pin indicating power loss
//#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate
//#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power.
// Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card,
// especially with "vase mode" printing. Set too high and vases cannot be continued.
- //#define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data
+ #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data
#endif
/**
@@ -1052,7 +1190,7 @@
#if ENABLED(SDCARD_SORT_ALPHA)
#define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each.
#define FOLDER_SORTING -1 // -1=above 0=none 1=below
- #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code.
+ #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 G-code.
#define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting.
#define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
#define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option.
@@ -1140,18 +1278,16 @@
// Add an optimized binary file transfer mode, initiated with 'M28 B1'
//#define BINARY_FILE_TRANSFER
- #if HAS_SDCARD_CONNECTION
- /**
- * Set this option to one of the following (or the board's defaults apply):
- *
- * LCD - Use the SD drive in the external LCD controller.
- * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.)
- * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file).
- *
- * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ]
- */
- //#define SDCARD_CONNECTION LCD
- #endif
+ /**
+ * Set this option to one of the following (or the board's defaults apply):
+ *
+ * LCD - Use the SD drive in the external LCD controller.
+ * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.)
+ * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file).
+ *
+ * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ]
+ */
+ //#define SDCARD_CONNECTION LCD
#endif // SDSUPPORT
@@ -1177,7 +1313,8 @@
// Show SD percentage next to the progress bar
//#define DOGM_SD_PERCENT
- // Enable to save many cycles by drawing a hollow frame on the Info Screen
+ // Save many cycles by drawing a hollow frame or no frame on the Info Screen
+ //#define XYZ_NO_FRAME
#define XYZ_HOLLOW_FRAME
// Enable to save many cycles by drawing a hollow frame on Menu Screens
@@ -1191,10 +1328,6 @@
// Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
//#define USE_SMALL_INFOFONT
- // Enable this option and reduce the value to optimize screen updates.
- // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
- //#define DOGM_SPI_DELAY_US 5
-
// Swap the CW/CCW indicators in the graphics overlay
//#define OVERLAY_GFX_REVERSE
@@ -1211,6 +1344,10 @@
* This will prevent position updates from being displayed.
*/
#if ENABLED(U8GLIB_ST7920)
+ // Enable this option and reduce the value to optimize screen updates.
+ // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
+ //#define DOGM_SPI_DELAY_US 5
+
//#define LIGHTWEIGHT_UI
#if ENABLED(LIGHTWEIGHT_UI)
#define STATUS_EXPIRE_SECONDS 20
@@ -1228,6 +1365,7 @@
#define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating
#define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating
#define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating
+ //#define STATUS_CUTTER_ANIM // Use a second bitmap to indicate spindle / laser active
//#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap
//#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap
//#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames
@@ -1243,6 +1381,43 @@
#endif // HAS_GRAPHICAL_LCD
+//
+// Additional options for DGUS / DWIN displays
+//
+#if HAS_DGUS_LCD
+ #define DGUS_SERIAL_PORT 3
+ #define DGUS_BAUDRATE 115200
+
+ #define DGUS_RX_BUFFER_SIZE 128
+ #define DGUS_TX_BUFFER_SIZE 48
+ //#define DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS // Fix Rx overrun situation (Currently only for AVR)
+
+ #define DGUS_UPDATE_INTERVAL_MS 500 // (ms) Interval between automatic screen updates
+
+ #if EITHER(DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY)
+ #define DGUS_PRINT_FILENAME // Display the filename during printing
+ #define DGUS_PREHEAT_UI // Display a preheat screen during heatup
+
+ #if ENABLED(DGUS_LCD_UI_FYSETC)
+ //#define DGUS_UI_MOVE_DIS_OPTION // Disabled by default for UI_FYSETC
+ #else
+ #define DGUS_UI_MOVE_DIS_OPTION // Enabled by default for UI_HIPRECY
+ #endif
+
+ #define DGUS_FILAMENT_LOADUNLOAD
+ #if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
+ #define DGUS_FILAMENT_PURGE_LENGTH 10
+ #define DGUS_FILAMENT_LOAD_LENGTH_PER_TIME 0.5 // (mm) Adjust in proportion to DGUS_UPDATE_INTERVAL_MS
+ #endif
+
+ #define DGUS_UI_WAITING // Show a "waiting" screen between some screens
+ #if ENABLED(DGUS_UI_WAITING)
+ #define DGUS_UI_WAITING_STATUS 10
+ #define DGUS_UI_WAITING_STATUS_PERIOD 8 // Increase to slower waiting status looping
+ #endif
+ #endif
+#endif // HAS_DGUS_LCD
+
//
// Touch UI for the FTDI Embedded Video Engine (EVE)
//
@@ -1253,6 +1428,7 @@
//#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272)
//#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480)
//#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI
+ //#define LCD_FYSETC_TFT81050 // FYSETC with 5" (800x480)
// Correct the resolution if not using the stock TFT panel.
//#define TOUCH_UI_320x240
@@ -1260,12 +1436,15 @@
//#define TOUCH_UI_800x480
// Mappings for boards with a standard RepRapDiscount Display connector
- //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping
- //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping
- //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping
+ //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping
+ //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping
+ //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping
+ //#define S6_TFT_PINMAP // FYSETC S6 pin mapping
+ //#define F6_TFT_PINMAP // FYSETC F6 pin mapping
+
//#define OTHER_PIN_LAYOUT // Define pins manually below
#if ENABLED(OTHER_PIN_LAYOUT)
- // The pins for CS and MOD_RESET (PD) must be chosen.
+ // Pins for CS and MOD_RESET (PD) must be chosen
#define CLCD_MOD_RESET 9
#define CLCD_SPI_CS 10
@@ -1341,6 +1520,13 @@
//#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan
#endif
+//
+// ADC Button Debounce
+//
+#if HAS_ADC_BUTTONS
+ #define ADC_BUTTON_DEBOUNCE_DELAY 16 // Increase if buttons bounce or repeat too fast
+#endif
+
// @section safety
/**
@@ -1368,11 +1554,13 @@
*/
//#define BABYSTEPPING
#if ENABLED(BABYSTEPPING)
+ //#define INTEGRATED_BABYSTEPPING // EXPERIMENTAL integration of babystepping into the Stepper ISR
//#define BABYSTEP_WITHOUT_HOMING
//#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA!
#define BABYSTEP_INVERT_Z false // Change if Z babysteps should go the other way
- #define BABYSTEP_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion.
- #define BABYSTEP_MULTIPLICATOR_XY 1
+ //#define BABYSTEP_MILLIMETER_UNITS // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps
+ #define BABYSTEP_MULTIPLICATOR_Z 1 // (steps or mm) Steps or millimeter distance for each Z babystep
+ #define BABYSTEP_MULTIPLICATOR_XY 1 // (steps or mm) Steps or millimeter distance for each XY babystep
//#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
#if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING)
@@ -1409,14 +1597,14 @@
* If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk)
* print acceleration will be reduced during the affected moves to keep within the limit.
*
- * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
- * Mention @Sebastianv650 on GitHub to alert the author of any issues.
+ * See https://marlinfw.org/docs/features/lin_advance.html for full instructions.
*/
//#define LIN_ADVANCE
#if ENABLED(LIN_ADVANCE)
//#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants
#define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed
//#define LA_DEBUG // If enabled, this will generate debug information output over USB.
+ //#define EXPERIMENTAL_SCURVE // Enable this option to permit S-Curve Acceleration
#endif
// @section leveling
@@ -1435,10 +1623,13 @@
#endif
/**
- * Override MIN_PROBE_EDGE for each side of the build plate
+ * Probing Margins
+ *
+ * Override PROBING_MARGIN for each side of the build plate
* Useful to get probe points to exact positions on targets or
* to allow leveling to avoid plate clamps on only specific
- * sides of the bed.
+ * sides of the bed. With NOZZLE_AS_PROBE negative values are
+ * allowed, to permit probing outside the bed.
*
* If you are replacing the prior *_PROBE_BED_POSITION options,
* LEFT and FRONT values in most cases will map directly over
@@ -1451,10 +1642,10 @@
* the probe to be unable to reach any points.
*/
#if PROBE_SELECTED && !IS_KINEMATIC
- #define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE
- #define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE
- #define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE
- #define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE
+ #define PROBING_MARGIN_LEFT PROBING_MARGIN
+ #define PROBING_MARGIN_RIGHT PROBING_MARGIN
+ #define PROBING_MARGIN_FRONT PROBING_MARGIN
+ #define PROBING_MARGIN_BACK PROBING_MARGIN
#endif
#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
@@ -1483,23 +1674,96 @@
#endif
+/**
+ * Thermal Probe Compensation
+ * Probe measurements are adjusted to compensate for temperature distortion.
+ * Use G76 to calibrate this feature. Use M871 to set values manually.
+ * For a more detailed explanation of the process see G76_M871.cpp.
+ */
+#if HAS_BED_PROBE && TEMP_SENSOR_PROBE && TEMP_SENSOR_BED
+ // Enable thermal first layer compensation using bed and probe temperatures
+ #define PROBE_TEMP_COMPENSATION
+
+ // Add additional compensation depending on hotend temperature
+ // Note: this values cannot be calibrated and have to be set manually
+ #if ENABLED(PROBE_TEMP_COMPENSATION)
+ // Park position to wait for probe cooldown
+ #define PTC_PARK_POS { 0, 0, 100 }
+
+ // Probe position to probe and wait for probe to reach target temperature
+ #define PTC_PROBE_POS { 90, 100 }
+
+ // Enable additional compensation using hotend temperature
+ // Note: this values cannot be calibrated automatically but have to be set manually
+ //#define USE_TEMP_EXT_COMPENSATION
+
+ // Probe temperature calibration generates a table of values starting at PTC_SAMPLE_START
+ // (e.g. 30), in steps of PTC_SAMPLE_RES (e.g. 5) with PTC_SAMPLE_COUNT (e.g. 10) samples.
+
+ //#define PTC_SAMPLE_START 30.0f
+ //#define PTC_SAMPLE_RES 5.0f
+ //#define PTC_SAMPLE_COUNT 10U
+
+ // Bed temperature calibration builds a similar table.
+
+ //#define BTC_SAMPLE_START 60.0f
+ //#define BTC_SAMPLE_RES 5.0f
+ //#define BTC_SAMPLE_COUNT 10U
+
+ // The temperature the probe should be at while taking measurements during bed temperature
+ // calibration.
+ //#define BTC_PROBE_TEMP 30.0f
+
+ // Height above Z=0.0f to raise the nozzle. Lowering this can help the probe to heat faster.
+ // Note: the Z=0.0f offset is determined by the probe offset which can be set using M851.
+ //#define PTC_PROBE_HEATING_OFFSET 0.5f
+
+ // Height to raise the Z-probe between heating and taking the next measurement. Some probes
+ // may fail to untrigger if they have been triggered for a long time, which can be solved by
+ // increasing the height the probe is raised to.
+ //#define PTC_PROBE_RAISE 15U
+
+ // If the probe is outside of the defined range, use linear extrapolation using the closest
+ // point and the PTC_LINEAR_EXTRAPOLATION'th next point. E.g. if set to 4 it will use data[0]
+ // and data[4] to perform linear extrapolation for values below PTC_SAMPLE_START.
+ //#define PTC_LINEAR_EXTRAPOLATION 4
+ #endif
+#endif
+
// @section extras
+//
+// G60/G61 Position Save and Return
+//
+//#define SAVED_POSITIONS 1 // Each saved position slot costs 12 bytes
+
//
// G2/G3 Arc Support
//
-#define ARC_SUPPORT // Disable this feature to save ~3226 bytes
+#define ARC_SUPPORT // Disable this feature to save ~3226 bytes
#if ENABLED(ARC_SUPPORT)
- #define MM_PER_ARC_SEGMENT 1 // Length of each arc segment
- #define MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle
- #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections
- //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles
- //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes
+ #define MM_PER_ARC_SEGMENT 1 // (mm) Length (or minimum length) of each arc segment
+ //#define ARC_SEGMENTS_PER_R 1 // Max segment length, MM_PER = Min
+ #define MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle
+ //#define ARC_SEGMENTS_PER_SEC 50 // Use feedrate to choose segment length (with MM_PER_ARC_SEGMENT as the minimum)
+ #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections
+ //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles
+ //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes
#endif
// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes.
//#define BEZIER_CURVE_SUPPORT
+/**
+ * Direct Stepping
+ *
+ * Comparable to the method used by Klipper, G6 direct stepping significantly
+ * reduces motion calculations, increases top printing speeds, and results in
+ * less step aliasing by calculating all motions in advance.
+ * Preparing your G-code: https://github.com/colinrgodsey/step-daemon
+ */
+//#define DIRECT_STEPPING
+
/**
* G38 Probe Target
*
@@ -1568,14 +1832,16 @@
//================================= Buffers =================================
//===========================================================================
-// @section hidden
+// @section motion
-// The number of linear motions that can be in the plan at any give time.
-// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering.
-#if ENABLED(SDSUPPORT)
- #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
+// The number of linear moves that can be in the planner at once.
+// The value of BLOCK_BUFFER_SIZE must be a power of 2 (e.g. 8, 16, 32)
+#if BOTH(SDSUPPORT, DIRECT_STEPPING)
+ #define BLOCK_BUFFER_SIZE 8
+#elif ENABLED(SDSUPPORT)
+ #define BLOCK_BUFFER_SIZE 16
#else
- #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
+ #define BLOCK_BUFFER_SIZE 16
#endif
// @section serial
@@ -1618,10 +1884,14 @@
//#define SERIAL_STATS_DROPPED_RX
#endif
-// Enable an emergency-command parser to intercept certain commands as they
-// enter the serial receive buffer, so they cannot be blocked.
-// Currently handles M108, M112, M410
-// Does not work on boards using AT90USB (USBCON) processors!
+/**
+ * Emergency Command Parser
+ *
+ * Add a low-level parser to intercept certain commands as they
+ * enter the serial receive buffer, so they cannot be blocked.
+ * Currently handles M108, M112, M410, M876
+ * NOTE: Not yet implemented for all platforms.
+ */
//#define EMERGENCY_PARSER
// Bad Serial-connections can miss a received command by sending an 'ok'
@@ -1637,6 +1907,9 @@
// This option inserts short delays between lines of serial output.
#define SERIAL_OVERRUN_PROTECTION
+// For serial echo, the number of digits after the decimal point
+//#define SERIAL_FLOAT_PRECISION 4
+
// @section extras
/**
@@ -1689,16 +1962,55 @@
*/
#if EXTRUDERS > 1
// Z raise distance for tool-change, as needed for some extruders
- #define TOOLCHANGE_ZRAISE 2 // (mm)
- //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change
+ #define TOOLCHANGE_ZRAISE 2 // (mm)
+ //#define TOOLCHANGE_ZRAISE_BEFORE_RETRACT // Apply raise before swap retraction (if enabled)
+ //#define TOOLCHANGE_NO_RETURN // Never return to previous position on tool-change
+ #if ENABLED(TOOLCHANGE_NO_RETURN)
+ //#define EVENT_GCODE_AFTER_TOOLCHANGE "G12X" // Extra G-code to run after tool-change
+ #endif
- // Retract and prime filament on tool-change
+ /**
+ * Retract and prime filament on tool-change to reduce
+ * ooze and stringing and to get cleaner transitions.
+ */
//#define TOOLCHANGE_FILAMENT_SWAP
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
- #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm)
- #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm)
- #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m)
- #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m)
+ // Load / Unload
+ #define TOOLCHANGE_FS_LENGTH 12 // (mm) Load / Unload length
+ #define TOOLCHANGE_FS_EXTRA_RESUME_LENGTH 0 // (mm) Extra length for better restart, fine tune by LCD/Gcode)
+ #define TOOLCHANGE_FS_RETRACT_SPEED (50*60) // (mm/m) (Unloading)
+ #define TOOLCHANGE_FS_UNRETRACT_SPEED (25*60) // (mm/m) (On SINGLENOZZLE or Bowden loading must be slowed down)
+
+ // Longer prime to clean out a SINGLENOZZLE
+ #define TOOLCHANGE_FS_EXTRA_PRIME 0 // (mm) Extra priming length
+ #define TOOLCHANGE_FS_PRIME_SPEED (4.6*60) // (mm/m) Extra priming feedrate
+ #define TOOLCHANGE_FS_WIPE_RETRACT 0 // (mm/m) Retract before cooling for less stringing, better wipe, etc.
+
+ // Cool after prime to reduce stringing
+ #define TOOLCHANGE_FS_FAN -1 // Fan index or -1 to skip
+ #define TOOLCHANGE_FS_FAN_SPEED 255 // 0-255
+ #define TOOLCHANGE_FS_FAN_TIME 10 // (seconds)
+
+ // Swap uninitialized extruder with TOOLCHANGE_FS_PRIME_SPEED for all lengths (recover + prime)
+ // (May break filament if not retracted beforehand.)
+ //#define TOOLCHANGE_FS_INIT_BEFORE_SWAP
+
+ // Prime on the first T0 (If other, TOOLCHANGE_FS_INIT_BEFORE_SWAP applied)
+ // Enable it (M217 V[0/1]) before printing, to avoid unwanted priming on host connect
+ //#define TOOLCHANGE_FS_PRIME_FIRST_USED
+
+ /**
+ * Tool Change Migration
+ * This feature provides G-code and LCD options to switch tools mid-print.
+ * All applicable tool properties are migrated so the print can continue.
+ * Tools must be closely matching and other restrictions may apply.
+ * Useful to:
+ * - Change filament color without interruption
+ * - Switch spools automatically on filament runout
+ * - Switch to a different nozzle on an extruder jam
+ */
+ #define TOOLCHANGE_MIGRATION_FEATURE
+
#endif
/**
@@ -1709,8 +2021,10 @@
#if ENABLED(TOOLCHANGE_PARK)
#define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 }
#define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m)
+ //#define TOOLCHANGE_PARK_X_ONLY // X axis only move
+ //#define TOOLCHANGE_PARK_Y_ONLY // Y axis only move
#endif
-#endif
+#endif // EXTRUDERS > 1
/**
* Advanced Pause
@@ -1754,13 +2068,14 @@
#define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length.
#define FILAMENT_UNLOAD_PURGE_DELAY 5000 // (ms) Delay for the filament to cool after retract.
#define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged.
+ #define FILAMENT_UNLOAD_PURGE_FEEDRATE 25 // (mm/s) feedrate to purge before unload
#define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety.
#define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed.
#define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change.
//#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change.
- //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change
+ //#define HOME_BEFORE_FILAMENT_CHANGE // If needed, home before parking for filament change
//#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu.
//#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302)
@@ -1818,6 +2133,12 @@
#define Z3_MICROSTEPS 16
#endif
+ #if AXIS_DRIVER_TYPE_Z4(TMC26X)
+ #define Z4_MAX_CURRENT 1000
+ #define Z4_SENSE_RESISTOR 91
+ #define Z4_MICROSTEPS 16
+ #endif
+
#if AXIS_DRIVER_TYPE_E0(TMC26X)
#define E0_MAX_CURRENT 1000
#define E0_SENSE_RESISTOR 91
@@ -1854,6 +2175,18 @@
#define E5_MICROSTEPS 16
#endif
+ #if AXIS_DRIVER_TYPE_E6(TMC26X)
+ #define E6_MAX_CURRENT 1000
+ #define E6_SENSE_RESISTOR 91
+ #define E6_MICROSTEPS 16
+ #endif
+
+ #if AXIS_DRIVER_TYPE_E7(TMC26X)
+ #define E7_MAX_CURRENT 1000
+ #define E7_SENSE_RESISTOR 91
+ #define E7_MICROSTEPS 16
+ #endif
+
#endif // TMC26X
// @section tmc_smart
@@ -1874,7 +2207,7 @@
* TMCStepper library is required to use TMC stepper drivers.
* https://github.com/teemuatlut/TMCStepper
*/
-#if HAS_TRINAMIC
+#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
@@ -1935,6 +2268,14 @@
#define Z3_CHAIN_POS -1
#endif
+ #if AXIS_IS_TMC(Z4)
+ #define Z4_CURRENT 800
+ #define Z4_CURRENT_HOME Z4_CURRENT
+ #define Z4_MICROSTEPS 16
+ #define Z4_RSENSE 0.11
+ #define Z4_CHAIN_POS -1
+ #endif
+
#if AXIS_IS_TMC(E0)
#define E0_CURRENT 650
#define E0_MICROSTEPS 16
@@ -1977,6 +2318,20 @@
#define E5_CHAIN_POS -1
#endif
+ #if AXIS_IS_TMC(E6)
+ #define E6_CURRENT 800
+ #define E6_MICROSTEPS 16
+ #define E6_RSENSE 0.11
+ #define E6_CHAIN_POS -1
+ #endif
+
+ #if AXIS_IS_TMC(E7)
+ #define E7_CURRENT 800
+ #define E7_MICROSTEPS 16
+ #define E7_RSENSE 0.11
+ #define E7_CHAIN_POS -1
+ #endif
+
/**
* Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here.
* The default pins can be found in your board's pins file.
@@ -1994,6 +2349,8 @@
//#define E3_CS_PIN -1
//#define E4_CS_PIN -1
//#define E5_CS_PIN -1
+ //#define E6_CS_PIN -1
+ //#define E7_CS_PIN -1
/**
* Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160).
@@ -2024,12 +2381,15 @@
#define Y2_SLAVE_ADDRESS 0
#define Z2_SLAVE_ADDRESS 0
#define Z3_SLAVE_ADDRESS 0
+ #define Z4_SLAVE_ADDRESS 0
#define E0_SLAVE_ADDRESS 0
#define E1_SLAVE_ADDRESS 0
#define E2_SLAVE_ADDRESS 0
#define E3_SLAVE_ADDRESS 0
#define E4_SLAVE_ADDRESS 0
#define E5_SLAVE_ADDRESS 0
+ #define E6_SLAVE_ADDRESS 0
+ #define E7_SLAVE_ADDRESS 0
/**
* Software enable
@@ -2046,7 +2406,7 @@
*/
#define STEALTHCHOP_XY
#define STEALTHCHOP_Z
- //#define STEALTHCHOP_E
+ #define STEALTHCHOP_E
/**
* Optimize spreadCycle chopper parameters by using predefined parameter sets
@@ -2056,6 +2416,7 @@
* CHOPPER_DEFAULT_19V
* CHOPPER_DEFAULT_24V
* CHOPPER_DEFAULT_36V
+ * CHOPPER_09STEP_24V // 0.9 degree steppers (24V)
* CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V)
* CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9
*
@@ -2065,11 +2426,11 @@
#define CHOPPER_TIMING CHOPPER_DEFAULT_24V
/**
- * Monitor Trinamic drivers for error conditions,
- * like overtemperature and short to ground.
- * In the case of overtemperature Marlin can decrease the driver current until error condition clears.
+ * Monitor Trinamic drivers
+ * for error conditions like overtemperature and short to ground.
+ * To manage over-temp Marlin can decrease the driver current until the error condition clears.
* Other detected conditions can be used to stop the current print.
- * Relevant g-codes:
+ * Relevant G-codes:
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given.
* M911 - Report stepper driver overtemperature pre-warn condition.
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
@@ -2099,12 +2460,15 @@
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define Z3_HYBRID_THRESHOLD 3
+ #define Z4_HYBRID_THRESHOLD 3
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
#define E3_HYBRID_THRESHOLD 30
#define E4_HYBRID_THRESHOLD 30
#define E5_HYBRID_THRESHOLD 30
+ #define E6_HYBRID_THRESHOLD 30
+ #define E7_HYBRID_THRESHOLD 30
/**
* Use StallGuard2 to home / probe X, Y, Z.
@@ -2120,7 +2484,7 @@
* HIGHEST 255 -64 (Too sensitive => False positive)
* LOWEST 0 63 (Too insensitive => No trigger)
*
- * It is recommended to set [XYZ]_HOME_BUMP_MM to 0.
+ * It is recommended to set HOMING_BUMP_MM to { 0, 0, 0 }.
*
* SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only ***
* Poll the driver through SPI to determine load when homing.
@@ -2129,26 +2493,34 @@
* IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when
* homing and adds a guard period for endstop triggering.
*/
- #define SENSORLESS_HOMING // StallGuard capable drivers only
-
- /**
- * Use StallGuard2 to probe the bed with the nozzle.
- *
- * CAUTION: This could cause damage to machines that use a lead screw or threaded rod
- * to move the Z axis. Take extreme care when attempting to enable this feature.
- */
- //#define SENSORLESS_PROBING // StallGuard capable drivers only
+ #define SENSORLESS_HOMING // StallGuard capable drivers only
#if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING)
// TMC2209: 0...255. TMC2130: -64...63
- #define X_STALL_SENSITIVITY 125
- //#define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY
- #define Y_STALL_SENSITIVITY 125
- //#define Z_STALL_SENSITIVITY 125
+ #define X_STALL_SENSITIVITY 125
+ #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY
+ #define Y_STALL_SENSITIVITY 125
+ #define Y2_STALL_SENSITIVITY Y_STALL_SENSITIVITY
+ //#define Z_STALL_SENSITIVITY 8
+ //#define Z2_STALL_SENSITIVITY Z_STALL_SENSITIVITY
+ //#define Z3_STALL_SENSITIVITY Z_STALL_SENSITIVITY
+ //#define Z4_STALL_SENSITIVITY Z_STALL_SENSITIVITY
//#define SPI_ENDSTOPS // TMC2130 only
//#define IMPROVE_HOMING_RELIABILITY
#endif
+ /**
+ * TMC Homing stepper phase.
+ *
+ * Improve homing repeatability by homing to stepper coil's nearest absolute
+ * phase position. Trinamic drivers use a stepper phase table with 1024 values
+ * spanning 4 full steps with 256 positions each (ergo, 1024 positions).
+ * Full step positions (128, 384, 640, 896) have the highest holding torque.
+ *
+ * Values from 0..1023, -1 to disable homing phase for that axis.
+ */
+ //#define TMC_HOME_PHASE { 896, 896, 896 }
+
/**
* Beta feature!
* Create a 50/50 square wave step pulse optimal for stepper drivers.
@@ -2174,14 +2546,14 @@
*/
#define TMC_ADV() { }
-#endif // HAS_TRINAMIC
+#endif // HAS_TRINAMIC_CONFIG
-// @section L6470
+// @section L64XX
/**
- * L6470 Stepper Driver options
+ * L64XX Stepper Driver options
*
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
+ * Arduino-L6470 library (0.8.0 or higher) is required.
* https://github.com/ameyer/Arduino-L6470
*
* Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2189,126 +2561,172 @@
* L6470_CHAIN_MISO_PIN
* L6470_CHAIN_MOSI_PIN
* L6470_CHAIN_SS_PIN
- * L6470_RESET_CHAIN_PIN (optional)
+ * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset
*/
-#if HAS_DRIVER(L6470)
- //#define L6470_CHITCHAT // Display additional status info
+#if HAS_L64XX
- #if AXIS_DRIVER_TYPE_X(L6470)
- #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
- #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
- #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down)
- #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper
- #define X_CHAIN_POS -1 // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
- #endif
+ //#define L6470_CHITCHAT // Display additional status info
- #if AXIS_DRIVER_TYPE_X2(L6470)
+ #if AXIS_IS_L64XX(X)
+ #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
+ #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current
+ // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
+ // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
+ #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down)
+ // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down
+ // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
+ // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
+ #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474
+ #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
+ #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest
+ #endif
+
+ #if AXIS_IS_L64XX(X2)
#define X2_MICROSTEPS 128
#define X2_OVERCURRENT 2000
#define X2_STALLCURRENT 1500
#define X2_MAX_VOLTAGE 127
#define X2_CHAIN_POS -1
+ #define X2_SLEW_RATE 1
#endif
- #if AXIS_DRIVER_TYPE_Y(L6470)
+ #if AXIS_IS_L64XX(Y)
#define Y_MICROSTEPS 128
#define Y_OVERCURRENT 2000
#define Y_STALLCURRENT 1500
#define Y_MAX_VOLTAGE 127
#define Y_CHAIN_POS -1
+ #define Y_SLEW_RATE 1
#endif
- #if AXIS_DRIVER_TYPE_Y2(L6470)
+ #if AXIS_IS_L64XX(Y2)
#define Y2_MICROSTEPS 128
#define Y2_OVERCURRENT 2000
#define Y2_STALLCURRENT 1500
#define Y2_MAX_VOLTAGE 127
#define Y2_CHAIN_POS -1
+ #define Y2_SLEW_RATE 1
#endif
- #if AXIS_DRIVER_TYPE_Z(L6470)
+ #if AXIS_IS_L64XX(Z)
#define Z_MICROSTEPS 128
#define Z_OVERCURRENT 2000
#define Z_STALLCURRENT 1500
#define Z_MAX_VOLTAGE 127
#define Z_CHAIN_POS -1
+ #define Z_SLEW_RATE 1
#endif
- #if AXIS_DRIVER_TYPE_Z2(L6470)
+ #if AXIS_IS_L64XX(Z2)
#define Z2_MICROSTEPS 128
#define Z2_OVERCURRENT 2000
#define Z2_STALLCURRENT 1500
#define Z2_MAX_VOLTAGE 127
#define Z2_CHAIN_POS -1
+ #define Z2_SLEW_RATE 1
#endif
- #if AXIS_DRIVER_TYPE_Z3(L6470)
+ #if AXIS_IS_L64XX(Z3)
#define Z3_MICROSTEPS 128
#define Z3_OVERCURRENT 2000
#define Z3_STALLCURRENT 1500
#define Z3_MAX_VOLTAGE 127
#define Z3_CHAIN_POS -1
+ #define Z3_SLEW_RATE 1
+ #endif
+
+ #if AXIS_IS_L64XX(Z4)
+ #define Z4_MICROSTEPS 128
+ #define Z4_OVERCURRENT 2000
+ #define Z4_STALLCURRENT 1500
+ #define Z4_MAX_VOLTAGE 127
+ #define Z4_CHAIN_POS -1
+ #define Z4_SLEW_RATE 1
#endif
- #if AXIS_DRIVER_TYPE_E0(L6470)
+ #if AXIS_IS_L64XX(E0)
#define E0_MICROSTEPS 128
#define E0_OVERCURRENT 2000
#define E0_STALLCURRENT 1500
#define E0_MAX_VOLTAGE 127
#define E0_CHAIN_POS -1
+ #define E0_SLEW_RATE 1
#endif
- #if AXIS_DRIVER_TYPE_E1(L6470)
+ #if AXIS_IS_L64XX(E1)
#define E1_MICROSTEPS 128
#define E1_OVERCURRENT 2000
#define E1_STALLCURRENT 1500
#define E1_MAX_VOLTAGE 127
#define E1_CHAIN_POS -1
+ #define E1_SLEW_RATE 1
#endif
- #if AXIS_DRIVER_TYPE_E2(L6470)
+ #if AXIS_IS_L64XX(E2)
#define E2_MICROSTEPS 128
#define E2_OVERCURRENT 2000
#define E2_STALLCURRENT 1500
#define E2_MAX_VOLTAGE 127
#define E2_CHAIN_POS -1
+ #define E2_SLEW_RATE 1
#endif
- #if AXIS_DRIVER_TYPE_E3(L6470)
+ #if AXIS_IS_L64XX(E3)
#define E3_MICROSTEPS 128
#define E3_OVERCURRENT 2000
#define E3_STALLCURRENT 1500
#define E3_MAX_VOLTAGE 127
#define E3_CHAIN_POS -1
+ #define E3_SLEW_RATE 1
#endif
- #if AXIS_DRIVER_TYPE_E4(L6470)
+ #if AXIS_IS_L64XX(E4)
#define E4_MICROSTEPS 128
#define E4_OVERCURRENT 2000
#define E4_STALLCURRENT 1500
#define E4_MAX_VOLTAGE 127
#define E4_CHAIN_POS -1
+ #define E4_SLEW_RATE 1
#endif
- #if AXIS_DRIVER_TYPE_E5(L6470)
+ #if AXIS_IS_L64XX(E5)
#define E5_MICROSTEPS 128
#define E5_OVERCURRENT 2000
#define E5_STALLCURRENT 1500
#define E5_MAX_VOLTAGE 127
#define E5_CHAIN_POS -1
+ #define E5_SLEW_RATE 1
+ #endif
+
+ #if AXIS_IS_L64XX(E6)
+ #define E6_MICROSTEPS 128
+ #define E6_OVERCURRENT 2000
+ #define E6_STALLCURRENT 1500
+ #define E6_MAX_VOLTAGE 127
+ #define E6_CHAIN_POS -1
+ #define E6_SLEW_RATE 1
+ #endif
+
+ #if AXIS_IS_L64XX(E7)
+ #define E7_MICROSTEPS 128
+ #define E7_OVERCURRENT 2000
+ #define E7_STALLCURRENT 1500
+ #define E7_MAX_VOLTAGE 127
+ #define E7_CHAIN_POS -1
+ #define E7_SLEW_RATE 1
#endif
/**
* Monitor L6470 drivers for error conditions like over temperature and over current.
* In the case of over temperature Marlin can decrease the drive until the error condition clears.
* Other detected conditions can be used to stop the current print.
- * Relevant g-codes:
+ * Relevant G-codes:
* M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given.
* I not present or I0 or I1 - X, Y, Z or E0
* I2 - X2, Y2, Z2 or E1
* I3 - Z3 or E3
- * I4 - E4
+ * I4 - Z4 or E4
* I5 - E5
* M916 - Increase drive level until get thermal warning
* M917 - Find minimum current thresholds
@@ -2322,7 +2740,15 @@
//#define L6470_STOP_ON_ERROR
#endif
-#endif // L6470
+#endif // HAS_L64XX
+
+// @section i2cbus
+
+//
+// I2C Master ID for LPC176x LCD and Digital Current control
+// Does not apply to other peripherals based on the Wire library.
+//
+//#define I2C_MASTER_ID 1 // Set a value from 0 to 2
/**
* TWI/I2C BUS
@@ -2352,10 +2778,10 @@
* echo:i2c-reply: from:99 bytes:5 data:hello
*/
-// @section i2cbus
-
//#define EXPERIMENTAL_I2CBUS
-#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave
+#if ENABLED(EXPERIMENTAL_I2CBUS)
+ #define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave
+#endif
// @section extras
@@ -2372,11 +2798,11 @@
//#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S)
// Canon RC-1 or homebrew digital camera trigger
- // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
+ // Data from: https://www.doc-diy.net/photo/rc-1_hacked/
//#define PHOTOGRAPH_PIN 23
// Canon Hack Development Kit
- // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
+ // https://captain-slow.dk/2014/03/09/3d-printing-timelapses/
//#define CHDK_PIN 4
// Optional second move with delay to trigger the camera shutter
@@ -2384,6 +2810,20 @@
// Duration to hold the switch or keep CHDK_PIN high
//#define PHOTO_SWITCH_MS 50 // (ms) (M240 D)
+
+ /**
+ * PHOTO_PULSES_US may need adjustment depending on board and camera model.
+ * Pin must be running at 48.4kHz.
+ * Be sure to use a PHOTOGRAPH_PIN which can rise and fall quick enough.
+ * (e.g., MKS SBase temp sensor pin was too slow, so used P1.23 on J8.)
+ *
+ * Example pulse data for Nikon: https://bit.ly/2FKD0Aq
+ * IR Wiring: https://git.io/JvJf7
+ */
+ //#define PHOTO_PULSES_US { 2000, 27850, 400, 1580, 400, 3580, 400 } // (µs) Durations for each 48.4kHz oscillation
+ #ifdef PHOTO_PULSES_US
+ #define PHOTO_PULSE_DELAY_US 13 // (µs) Approximate duration of each HIGH and LOW pulse in the oscillation
+ #endif
#endif
/**
@@ -2399,39 +2839,138 @@
* You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V
* hardware PWM pin for the speed control and a pin for the rotation direction.
*
- * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details.
+ * See https://marlinfw.org/docs/configuration/laser_spindle.html for more config details.
*/
//#define SPINDLE_FEATURE
//#define LASER_FEATURE
#if EITHER(SPINDLE_FEATURE, LASER_FEATURE)
#define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH
#define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power
- #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower
- #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power
- #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop
+ #define SPINDLE_LASER_PWM_INVERT false // Set to "true" if the speed/power goes up when you want it to go slower
+
+ #define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR and LPC)
+
+ /**
+ * Speed / Power can be set ('M3 S') and displayed in terms of:
+ * - PWM255 (S0 - S255)
+ * - PERCENT (S0 - S100)
+ * - RPM (S0 - S50000) Best for use with a spindle
+ */
+ #define CUTTER_POWER_UNIT PWM255
+
+ /**
+ * Relative Cutter Power
+ * Normally, 'M3 O' sets
+ * OCR power is relative to the range SPEED_POWER_MIN...SPEED_POWER_MAX.
+ * so input powers of 0...255 correspond to SPEED_POWER_MIN...SPEED_POWER_MAX
+ * instead of normal range (0 to SPEED_POWER_MAX).
+ * Best used with (e.g.) SuperPID router controller: S0 = 5,000 RPM and S255 = 30,000 RPM
+ */
+ //#define CUTTER_POWER_RELATIVE // Set speed proportional to [SPEED_POWER_MIN...SPEED_POWER_MAX]
#if ENABLED(SPINDLE_FEATURE)
//#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction
#define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction
#define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed
+ #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power
+ #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop
+
/**
- * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power
+ * M3/M4 Power Equation
*
- * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT
- * where PWM duty cycle varies from 0 to 255
+ * Each tool uses different value ranges for speed / power control.
+ * These parameters are used to convert between tool power units and PWM.
*
- * set the following for your controller (ALL MUST BE SET)
+ * Speed/Power = (PWMDC / 255 * 100 - SPEED_POWER_INTERCEPT) / SPEED_POWER_SLOPE
+ * PWMDC = (spdpwr - SPEED_POWER_MIN) / (SPEED_POWER_MAX - SPEED_POWER_MIN) / SPEED_POWER_SLOPE
*/
- #define SPEED_POWER_SLOPE 118.4
- #define SPEED_POWER_INTERCEPT 0
- #define SPEED_POWER_MIN 5000
- #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM
+ #define SPEED_POWER_INTERCEPT 0 // (%) 0-100 i.e., Minimum power percentage
+ #define SPEED_POWER_MIN 5000 // (RPM)
+ #define SPEED_POWER_MAX 30000 // (RPM) SuperPID router controller 0 - 30,000 RPM
+ #define SPEED_POWER_STARTUP 25000 // (RPM) M3/M4 speed/power default (with no arguments)
+
#else
- #define SPEED_POWER_SLOPE 0.3922
- #define SPEED_POWER_INTERCEPT 0
- #define SPEED_POWER_MIN 10
- #define SPEED_POWER_MAX 100 // 0-100%
+
+ #define SPEED_POWER_INTERCEPT 0 // (%) 0-100 i.e., Minimum power percentage
+ #define SPEED_POWER_MIN 0 // (%) 0-100
+ #define SPEED_POWER_MAX 100 // (%) 0-100
+ #define SPEED_POWER_STARTUP 80 // (%) M3/M4 speed/power default (with no arguments)
+
+ /**
+ * Enable inline laser power to be handled in the planner / stepper routines.
+ * Inline power is specified by the I (inline) flag in an M3 command (e.g., M3 S20 I)
+ * or by the 'S' parameter in G0/G1/G2/G3 moves (see LASER_MOVE_POWER).
+ *
+ * This allows the laser to keep in perfect sync with the planner and removes
+ * the powerup/down delay since lasers require negligible time.
+ */
+ #define LASER_POWER_INLINE
+
+ #if ENABLED(LASER_POWER_INLINE)
+ /**
+ * Scale the laser's power in proportion to the movement rate.
+ *
+ * - Sets the entry power proportional to the entry speed over the nominal speed.
+ * - Ramps the power up every N steps to approximate the speed trapezoid.
+ * - Due to the limited power resolution this is only approximate.
+ */
+ #define LASER_POWER_INLINE_TRAPEZOID
+
+ /**
+ * Continuously calculate the current power (nominal_power * current_rate / nominal_rate).
+ * Required for accurate power with non-trapezoidal acceleration (e.g., S_CURVE_ACCELERATION).
+ * This is a costly calculation so this option is discouraged on 8-bit AVR boards.
+ *
+ * LASER_POWER_INLINE_TRAPEZOID_CONT_PER defines how many step cycles there are between power updates. If your
+ * board isn't able to generate steps fast enough (and you are using LASER_POWER_INLINE_TRAPEZOID_CONT), increase this.
+ * Note that when this is zero it means it occurs every cycle; 1 means a delay wait one cycle then run, etc.
+ */
+ //#define LASER_POWER_INLINE_TRAPEZOID_CONT
+
+ /**
+ * Stepper iterations between power updates. Increase this value if the board
+ * can't keep up with the processing demands of LASER_POWER_INLINE_TRAPEZOID_CONT.
+ * Disable (or set to 0) to recalculate power on every stepper iteration.
+ */
+ //#define LASER_POWER_INLINE_TRAPEZOID_CONT_PER 10
+
+ /**
+ * Include laser power in G0/G1/G2/G3/G5 commands with the 'S' parameter
+ */
+ //#define LASER_MOVE_POWER
+
+ #if ENABLED(LASER_MOVE_POWER)
+ // Turn off the laser on G0 moves with no power parameter.
+ // If a power parameter is provided, use that instead.
+ //#define LASER_MOVE_G0_OFF
+
+ // Turn off the laser on G28 homing.
+ //#define LASER_MOVE_G28_OFF
+ #endif
+
+ /**
+ * Inline flag inverted
+ *
+ * WARNING: M5 will NOT turn off the laser unless another move
+ * is done (so G-code files must end with 'M5 I').
+ */
+ //#define LASER_POWER_INLINE_INVERT
+
+ /**
+ * Continuously apply inline power. ('M3 S3' == 'G1 S3' == 'M3 S3 I')
+ *
+ * The laser might do some weird things, so only enable this
+ * feature if you understand the implications.
+ */
+ //#define LASER_POWER_INLINE_CONTINUOUS
+
+ #else
+
+ #define SPINDLE_LASER_POWERUP_DELAY 50 // (ms) Delay to allow the spindle/laser to come up to speed/power
+ #define SPINDLE_LASER_POWERDOWN_DELAY 50 // (ms) Delay to allow the spindle to stop
+
+ #endif
#endif
#endif
@@ -2483,6 +3022,24 @@
//#define FILAMENT_LCD_DISPLAY
#endif
+/**
+ * Power Monitor
+ * Monitor voltage (V) and/or current (A), and -when possible- power (W)
+ *
+ * Read and configure with M430
+ *
+ * The current sensor feeds DC voltage (relative to the measured current) to an analog pin
+ * The voltage sensor feeds DC voltage (relative to the measured voltage) to an analog pin
+ */
+//#define POWER_MONITOR_CURRENT // Monitor the system current
+//#define POWER_MONITOR_VOLTAGE // Monitor the system voltage
+#if EITHER(POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE)
+ #define POWER_MONITOR_VOLTS_PER_AMP 0.05000 // Input voltage to the MCU analog pin per amp - DO NOT apply more than ADC_VREF!
+ #define POWER_MONITOR_CURRENT_OFFSET -1 // Offset value for current sensors with linear function output
+ #define POWER_MONITOR_VOLTS_PER_VOLT 0.11786 // Input voltage to the MCU analog pin per volt - DO NOT apply more than ADC_VREF!
+ #define POWER_MONITOR_FIXED_VOLTAGE 13.6 // Voltage for a current sensor with no voltage sensor (for power display)
+#endif
+
/**
* CNC Coordinate Systems
*
@@ -2500,6 +3057,9 @@
* Include capabilities in M115 output
*/
#define EXTENDED_CAPABILITIES_REPORT
+#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
+ //#define M115_GEOMETRY_REPORT
+#endif
/**
* Expected Printer Check
@@ -2519,9 +3079,21 @@
* Activate to make volumetric extrusion the default method,
* with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter.
*
- * M200 D0 to disable, M200 Dn to set a new diameter.
+ * M200 D0 to disable, M200 Dn to set a new diameter (and enable volumetric).
+ * M200 S0/S1 to disable/enable volumetric extrusion.
*/
//#define VOLUMETRIC_DEFAULT_ON
+
+ //#define VOLUMETRIC_EXTRUDER_LIMIT
+ #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT)
+ /**
+ * Default volumetric extrusion limit in cubic mm per second (mm^3/sec).
+ * This factory setting applies to all extruders.
+ * Use 'M200 [T] L' to override and 'M502' to reset.
+ * A non-zero value activates Volume-based Extrusion Limiting.
+ */
+ #define DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT 0.00 // (mm^3/sec)
+ #endif
#endif
/**
@@ -2533,6 +3105,13 @@
*/
//#define NO_WORKSPACE_OFFSETS
+// Extra options for the M114 "Current Position" report
+//#define M114_DETAIL // Use 'M114` for details to check planner calculations
+//#define M114_REALTIME // Real current position based on forward kinematics
+//#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed.
+
+//#define REPORT_FAN_CHANGE // Report the new fan speed when changed by M106 (and others)
+
/**
* Set the number of proportional font spaces required to fill up a typical character space.
* This can help to better align the output of commands like `G29 O` Mesh Output.
@@ -2547,6 +3126,14 @@
*/
#define FASTER_GCODE_PARSER
+#if ENABLED(FASTER_GCODE_PARSER)
+ //#define GCODE_QUOTED_STRINGS // Support for quoted string parameters
+#endif
+
+//#define GCODE_CASE_INSENSITIVE // Accept G-code sent to the firmware in lowercase
+
+//#define REPETIER_GCODE_M360 // Add commands originally from Repetier FW
+
/**
* CNC G-code options
* Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc.
@@ -2637,11 +3224,11 @@
* I2C position encoders for closed loop control.
* Developed by Chris Barr at Aus3D.
*
- * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
+ * Wiki: https://wiki.aus3d.com.au/Magnetic_Encoder
* Github: https://github.com/Aus3D/MagneticEncoder
*
- * Supplier: http://aus3d.com.au/magnetic-encoder-module
- * Alternative Supplier: http://reliabuild3d.com/
+ * Supplier: https://aus3d.com.au/magnetic-encoder-module
+ * Alternative Supplier: https://reliabuild3d.com/
*
* Reliabuild encoders have been modified to improve reliability.
*/
@@ -2723,7 +3310,11 @@
#define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2
#define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2
- // Use M119 to find reasonable values after connecting your hardware:
+ //#define INVERT_JOY_X // Enable if X direction is reversed
+ //#define INVERT_JOY_Y // Enable if Y direction is reversed
+ //#define INVERT_JOY_Z // Enable if Z direction is reversed
+
+ // Use M119 with JOYSTICK_DEBUG to find reasonable values after connecting:
#define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max
#define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 }
#define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 }
@@ -2742,7 +3333,7 @@
#define MAX7219_LOAD_PIN 44
//#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix
- #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral)
+ #define MAX7219_INIT_TEST 2 // Test pattern at startup: 0=none, 1=sweep, 2=spiral
#define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain.
#define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°)
// connector at: right=0 bottom=-90 top=90 left=180
@@ -2778,12 +3369,23 @@
/**
* WiFi Support (Espressif ESP32 WiFi)
*/
-//#define WIFISUPPORT
-#if ENABLED(WIFISUPPORT)
- #define WIFI_SSID "Wifi SSID"
- #define WIFI_PWD "Wifi Password"
- //#define WEBSUPPORT // Start a webserver with auto-discovery
- //#define OTASUPPORT // Support over-the-air firmware updates
+//#define WIFISUPPORT // Marlin embedded WiFi managenent
+//#define ESP3D_WIFISUPPORT // ESP3D Library WiFi management (https://github.com/luc-github/ESP3DLib)
+
+#if EITHER(WIFISUPPORT, ESP3D_WIFISUPPORT)
+ //#define WEBSUPPORT // Start a webserver (which may include auto-discovery)
+ //#define OTASUPPORT // Support over-the-air firmware updates
+ //#define WIFI_CUSTOM_COMMAND // Accept feature config commands (e.g., WiFi ESP3D) from the host
+
+ /**
+ * To set a default WiFi SSID / Password, create a file called Configuration_Secure.h with
+ * the following defines, customized for your network. This specific file is excluded via
+ * .gitignore to prevent it from accidentally leaking to the public.
+ *
+ * #define WIFI_SSID "WiFi SSID"
+ * #define WIFI_PWD "WiFi Password"
+ */
+ //#include "Configuration_Secure.h" // External file with WiFi SSID / Password
#endif
/**
@@ -2814,7 +3416,7 @@
// This is for Prusa MK3-style extruders. Customize for your hardware.
#define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0
#define MMU2_LOAD_TO_NOZZLE_SEQUENCE \
- { 7.2, 562 }, \
+ { 7.2, 1145 }, \
{ 14.4, 871 }, \
{ 36.0, 1393 }, \
{ 14.4, 871 }, \
@@ -2832,6 +3434,45 @@
{ 10.0, 700 }, \
{ -10.0, 400 }, \
{ -50.0, 2000 }
+ #endif
+
+ /**
+ * MMU Extruder Sensor
+ *
+ * Support for a Prusa (or other) IR Sensor to detect filament near the extruder
+ * and make loading more reliable. Suitable for an extruder equipped with a filament
+ * sensor less than 38mm from the gears.
+ *
+ * During loading the extruder will stop when the sensor is triggered, then do a last
+ * move up to the gears. If no filament is detected, the MMU2 can make some more attempts.
+ * If all attempts fail, a filament runout will be triggered.
+ */
+ //#define MMU_EXTRUDER_SENSOR
+ #if ENABLED(MMU_EXTRUDER_SENSOR)
+ #define MMU_LOADING_ATTEMPTS_NR 5 //max. number of attempts to load filament if first load fail
+ #endif
+
+ /**
+ * Using a sensor like the MMU2S
+ * This mode requires a MK3S extruder with a sensor at the extruder idler, like the MMU2S.
+ * See https://help.prusa3d.com/en/guide/3b-mk3s-mk2-5s-extruder-upgrade_41560, step 11
+ */
+ //#define PRUSA_MMU2_S_MODE
+ #if ENABLED(PRUSA_MMU2_S_MODE)
+ #define MMU2_C0_RETRY 5 // Number of retries (total time = timeout*retries)
+
+ #define MMU2_CAN_LOAD_FEEDRATE 800 // (mm/m)
+ #define MMU2_CAN_LOAD_SEQUENCE \
+ { 0.1, MMU2_CAN_LOAD_FEEDRATE }, \
+ { 60.0, MMU2_CAN_LOAD_FEEDRATE }, \
+ { -52.0, MMU2_CAN_LOAD_FEEDRATE }
+
+ #define MMU2_CAN_LOAD_RETRACT 6.0 // (mm) Keep under the distance between Load Sequence values
+ #define MMU2_CAN_LOAD_DEVIATION 0.8 // (mm) Acceptable deviation
+
+ #define MMU2_CAN_LOAD_INCREMENT 0.2 // (mm) To reuse within MMU2 module
+ #define MMU2_CAN_LOAD_INCREMENT_SEQUENCE \
+ { -MMU2_CAN_LOAD_INCREMENT, MMU2_CAN_LOAD_FEEDRATE }
#endif
@@ -2855,9 +3496,14 @@
// @section develop
-/**
- * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins
- */
+//
+// M100 Free Memory Watcher to debug memory usage
+//
+//#define M100_FREE_MEMORY_WATCHER
+
+//
+// M43 - display pin status, toggle pins, watch pins, watch endstops & toggle LED, test servo probe
+//
//#define PINS_DEBUGGING
// Enable Marlin dev mode which adds some special commands
diff --git a/firmware/marlin2.0 for Ender3/Marlin/Makefile b/firmware/marlin2.0 for Ender3/Marlin/Makefile
index 1a9bb220..95135ab5 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/Makefile
+++ b/firmware/marlin2.0 for Ender3/Marlin/Makefile
@@ -14,7 +14,7 @@
# Detailed instructions for using the makefile:
#
# 1. Modify the line containing "ARDUINO_INSTALL_DIR" to point to the directory that
-# contains the Arduino installation (for example, under Mac OS X, this
+# contains the Arduino installation (for example, under macOS, this
# might be /Applications/Arduino.app/Contents/Resources/Java).
#
# 2. Modify the line containing "UPLOAD_PORT" to refer to the filename
@@ -98,7 +98,7 @@ NEOPIXEL ?= 0
############
# Try to automatically determine whether RELOC_WORKAROUND is needed based
# on GCC versions:
-# http://www.avrfreaks.net/comment/1789106#comment-1789106
+# https://www.avrfreaks.net/comment/1789106#comment-1789106
CC_MAJ:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC__ | cut -f3 -d\ )
CC_MIN:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_MINOR__ | cut -f3 -d\ )
@@ -170,98 +170,110 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1100)
else ifeq ($(HARDWARE_MOTHERBOARD),1101)
# Velleman K8400 Controller (derived from 3Drag Controller)
else ifeq ($(HARDWARE_MOTHERBOARD),1102)
-# 2PrintBeta BAM&DICE with STK drivers
+# Velleman K8600 Controller (derived from 3Drag Controller)
else ifeq ($(HARDWARE_MOTHERBOARD),1103)
-# 2PrintBeta BAM&DICE Due with STK drivers
+# 2PrintBeta BAM&DICE with STK drivers
else ifeq ($(HARDWARE_MOTHERBOARD),1104)
-# MKS BASE v1.0
+# 2PrintBeta BAM&DICE Due with STK drivers
else ifeq ($(HARDWARE_MOTHERBOARD),1105)
-# MKS v1.4 with A4982 stepper drivers
+# MKS BASE v1.0
else ifeq ($(HARDWARE_MOTHERBOARD),1106)
-# MKS v1.5 with Allegro A4982 stepper drivers
+# MKS v1.4 with A4982 stepper drivers
else ifeq ($(HARDWARE_MOTHERBOARD),1107)
-# MKS BASE 1.0 with Heroic HR4982 stepper drivers
+# MKS v1.5 with Allegro A4982 stepper drivers
else ifeq ($(HARDWARE_MOTHERBOARD),1108)
-# MKS GEN v1.3 or 1.4
+# MKS v1.6 with Allegro A4982 stepper drivers
else ifeq ($(HARDWARE_MOTHERBOARD),1109)
-# MKS GEN L
+# MKS BASE 1.0 with Heroic HR4982 stepper drivers
else ifeq ($(HARDWARE_MOTHERBOARD),1110)
-# zrib V2.0 control board (Chinese knock off RAMPS replica)
+# MKS GEN v1.3 or 1.4
else ifeq ($(HARDWARE_MOTHERBOARD),1111)
-# BigTreeTech or BIQU KFB2.0
+# MKS GEN L
else ifeq ($(HARDWARE_MOTHERBOARD),1112)
-# Felix 2.0+ Electronics Board (RAMPS like)
+# zrib V2.0 control board (Chinese knock off RAMPS replica)
else ifeq ($(HARDWARE_MOTHERBOARD),1113)
-# Invent-A-Part RigidBoard
+# BigTreeTech or BIQU KFB2.0
else ifeq ($(HARDWARE_MOTHERBOARD),1114)
-# Invent-A-Part RigidBoard V2
+# Felix 2.0+ Electronics Board (RAMPS like)
else ifeq ($(HARDWARE_MOTHERBOARD),1115)
-# Sainsmart 2-in-1 board
+# Invent-A-Part RigidBoard
else ifeq ($(HARDWARE_MOTHERBOARD),1116)
-# Ultimaker
+# Invent-A-Part RigidBoard V2
else ifeq ($(HARDWARE_MOTHERBOARD),1117)
-# Ultimaker (Older electronics. Pre 1.5.4. This is rare)
+# Sainsmart 2-in-1 board
else ifeq ($(HARDWARE_MOTHERBOARD),1118)
+# Ultimaker
+else ifeq ($(HARDWARE_MOTHERBOARD),1119)
+# Ultimaker (Older electronics. Pre 1.5.4. This is rare)
+else ifeq ($(HARDWARE_MOTHERBOARD),1120)
MCU ?= atmega1280
# Azteeg X3
-else ifeq ($(HARDWARE_MOTHERBOARD),1119)
-# Azteeg X3 Pro
-else ifeq ($(HARDWARE_MOTHERBOARD),1120)
-# Ultimainboard 2.x (Uses TEMP_SENSOR 20)
else ifeq ($(HARDWARE_MOTHERBOARD),1121)
-# Rumba
+# Azteeg X3 Pro
else ifeq ($(HARDWARE_MOTHERBOARD),1122)
-# Raise3D Rumba
+# Ultimainboard 2.x (Uses TEMP_SENSOR 20)
else ifeq ($(HARDWARE_MOTHERBOARD),1123)
-# Rapide Lite RL200 Rumba
+# Rumba
else ifeq ($(HARDWARE_MOTHERBOARD),1124)
-# Formbot T-Rex 2 Plus
+# Raise3D Rumba
else ifeq ($(HARDWARE_MOTHERBOARD),1125)
-# Formbot T-Rex 3
+# Rapide Lite RL200 Rumba
else ifeq ($(HARDWARE_MOTHERBOARD),1126)
-# Formbot Raptor
+# Formbot T-Rex 2 Plus
else ifeq ($(HARDWARE_MOTHERBOARD),1127)
-# Formbot Raptor 2
+# Formbot T-Rex 3
else ifeq ($(HARDWARE_MOTHERBOARD),1128)
-# bq ZUM Mega 3D
+# Formbot Raptor
else ifeq ($(HARDWARE_MOTHERBOARD),1129)
-# MakeBoard Mini v2.1.2 is a control board sold by MicroMake
+# Formbot Raptor 2
else ifeq ($(HARDWARE_MOTHERBOARD),1130)
-# TriGorilla Anycubic version 1.3 based on RAMPS EFB
+# bq ZUM Mega 3D
else ifeq ($(HARDWARE_MOTHERBOARD),1131)
-# TriGorilla Anycubic version 1.4 based on RAMPS EFB
+# MakeBoard Mini v2.1.2 is a control board sold by MicroMake
else ifeq ($(HARDWARE_MOTHERBOARD),1132)
-# TriGorilla Anycubic version 1.4 Rev 1.1
+# TriGorilla Anycubic version 1.3 based on RAMPS EFB
else ifeq ($(HARDWARE_MOTHERBOARD),1133)
-# Creality: Ender-4, CR-8
+# TriGorilla Anycubic version 1.4 based on RAMPS EFB
else ifeq ($(HARDWARE_MOTHERBOARD),1134)
-# Creality: CR10S, CR20, CR-X
+# TriGorilla Anycubic version 1.4 Rev 1.1
else ifeq ($(HARDWARE_MOTHERBOARD),1135)
-# Dagoma F5
+# Creality: Ender-4, CR-8
else ifeq ($(HARDWARE_MOTHERBOARD),1136)
-# FYSETC F6
+# Creality: CR10S, CR20, CR-X
else ifeq ($(HARDWARE_MOTHERBOARD),1137)
-# Duplicator i3 Plus
+# Dagoma F5
else ifeq ($(HARDWARE_MOTHERBOARD),1138)
-# VORON
+# FYSETC F6 1.3
else ifeq ($(HARDWARE_MOTHERBOARD),1139)
-# TRONXY V3 1.0
+# FYSETC F6 1.5
else ifeq ($(HARDWARE_MOTHERBOARD),1140)
-# Z-Bolt X Series
+# Duplicator i3 Plus
else ifeq ($(HARDWARE_MOTHERBOARD),1141)
-# TT OSCAR
+# VORON
else ifeq ($(HARDWARE_MOTHERBOARD),1142)
-# Overlord/Overlord Pro
+# TRONXY V3 1.0
else ifeq ($(HARDWARE_MOTHERBOARD),1143)
-# ADIMLab Gantry v1
+# Z-Bolt X Series
else ifeq ($(HARDWARE_MOTHERBOARD),1144)
-# ADIMLab Gantry v2
+# TT OSCAR
else ifeq ($(HARDWARE_MOTHERBOARD),1145)
-# BIQU Tango V1
+# Overlord/Overlord Pro
else ifeq ($(HARDWARE_MOTHERBOARD),1146)
-# MKS GEN L V2
+# ADIMLab Gantry v1
else ifeq ($(HARDWARE_MOTHERBOARD),1147)
+# ADIMLab Gantry v2
+else ifeq ($(HARDWARE_MOTHERBOARD),1148)
+# BIQU Tango V1
+else ifeq ($(HARDWARE_MOTHERBOARD),1149)
+# MKS GEN L V2
+else ifeq ($(HARDWARE_MOTHERBOARD),1150)
+# Copymaster 3D
+else ifeq ($(HARDWARE_MOTHERBOARD),1151)
+# Ortur 4
+else ifeq ($(HARDWARE_MOTHERBOARD),1152)
+# Tenlog D3 Hero
+else ifeq ($(HARDWARE_MOTHERBOARD),1153)
#
# RAMBo and derivatives
@@ -354,34 +366,38 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1501)
else ifeq ($(HARDWARE_MOTHERBOARD),1502)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega644p
-# Melzi with ATmega1284 (MaKr3d version)
+# Melzi V2.0
else ifeq ($(HARDWARE_MOTHERBOARD),1503)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
-# Melzi Creality3D board (for CR-10 etc)
+# Melzi with ATmega1284 (MaKr3d version)
else ifeq ($(HARDWARE_MOTHERBOARD),1504)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
-# Melzi Malyan M150 board
+# Melzi Creality3D board (for CR-10 etc)
else ifeq ($(HARDWARE_MOTHERBOARD),1505)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
-# Tronxy X5S
+# Melzi Malyan M150 board
else ifeq ($(HARDWARE_MOTHERBOARD),1506)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
-# STB V1.1
+# Tronxy X5S
else ifeq ($(HARDWARE_MOTHERBOARD),1507)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
-# Azteeg X1
+# STB V1.1
else ifeq ($(HARDWARE_MOTHERBOARD),1508)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
-# Anet 1.0 (Melzi clone)
+# Azteeg X1
else ifeq ($(HARDWARE_MOTHERBOARD),1509)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
+# Anet 1.0 (Melzi clone)
+else ifeq ($(HARDWARE_MOTHERBOARD),1510)
+ HARDWARE_VARIANT ?= Sanguino
+ MCU ?= atmega1284p
#
# Other ATmega644P, ATmega644, ATmega1284P
@@ -679,7 +695,7 @@ ifeq ($(HARDWARE_VARIANT), Teensy)
else ifeq ($(HARDWARE_VARIANT), archim)
CDEFS += -DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__ -DUSB_VID=0x27b1 -DUSB_PID=0x0001 -DUSBCON '-DUSB_MANUFACTURER="UltiMachine"' '-DUSB_PRODUCT="Archim"'
- LIB_CXXSRC += variant.cpp IPAddress.cpp Reset.cpp RingBuffer.cpp Stream.cpp UARTClass.cpp USARTClass.cpp abi.cpp new.cpp watchdog.cpp CDC.cpp PluggableUSB.cpp USBCore.cpp
+ LIB_CXXSRC += variant.cpp IPAddress.cpp Reset.cpp RingBuffer.cpp Stream.cpp UARTClass.cpp USARTClass.cpp abi.cpp new.cpp watchdog.cpp CDC.cpp PluggableUSB.cpp USBCore.cpp
LIB_SRC += cortex_handlers.c iar_calls_sam3.c syscalls_sam3.c dtostrf.c itoa.c
ifeq ($(U8GLIB), 1)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/Marlin.ino b/firmware/marlin2.0 for Ender3/Marlin/Marlin.ino
index ae5bca1d..57c82544 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/Marlin.ino
+++ b/firmware/marlin2.0 for Ender3/Marlin/Marlin.ino
@@ -1,9 +1,8 @@
-/*
-================================================================================
+/*==============================================================================
Marlin Firmware
- (c) 2011-2019 MarlinFirmware
+ (c) 2011-2020 MarlinFirmware
Portions of Marlin are (c) by their respective authors.
All code complies with GPLv2 and/or GPLv3
@@ -12,30 +11,33 @@
Greetings! Thank you for choosing Marlin 2 as your 3D printer firmware.
To configure Marlin you must edit Configuration.h and Configuration_adv.h
-located in the root 'Marlin' folder. Check the config/examples folder to see if
-there's a more suitable starting-point for your specific hardware.
+located in the root 'Marlin' folder. Check our Configurations repository to
+see if there's a more suitable starting-point for your specific hardware.
Before diving in, we recommend the following essential links:
Marlin Firmware Official Website
- - http://marlinfw.org/
+ - https://marlinfw.org/
The official Marlin Firmware website contains the most up-to-date
documentation. Contributions are always welcome!
Configuration
+ - https://github.com/MarlinFirmware/Configurations
+ Example configurations for several printer models.
+
- https://www.youtube.com/watch?v=3gwWVFtdg-4
A good 20-minute overview of Marlin configuration by Tom Sanladerer.
(Applies to Marlin 1.0.x, so Jerk and Acceleration should be halved.)
Also... https://www.google.com/search?tbs=vid%3A1&q=configure+marlin
- - http://marlinfw.org/docs/configuration/configuration.html
+ - https://marlinfw.org/docs/configuration/configuration.html
Marlin's configuration options are explained in more detail here.
Getting Help
- - http://forums.reprap.org/list.php?415
+ - https://reprap.org/forum/list.php?415
The Marlin Discussion Forum is a great place to get help from other Marlin
users who may have experienced similar issues to your own.
@@ -45,9 +47,11 @@ Getting Help
Contributing
- - http://marlinfw.org/docs/development/contributing.html
+ - https://marlinfw.org/docs/development/contributing.html
If you'd like to contribute to Marlin, read this first!
- - http://marlinfw.org/docs/development/coding_standards.html
+ - https://marlinfw.org/docs/development/coding_standards.html
Before submitting code get to know the Coding Standards.
-*/
+
+
+------------------------------------------------------------------------------*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/Version.h b/firmware/marlin2.0 for Ender3/Marlin/Version.h
index a4c08b97..37112317 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/Version.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/Version.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -28,20 +28,20 @@
/**
* Marlin release version identifier
*/
-//#define SHORT_BUILD_VERSION "2.0.x"
+//#define SHORT_BUILD_VERSION "2.0.6"
/**
* Verbose version identifier which should contain a reference to the location
* from where the binary was downloaded or the source code was compiled.
*/
-//#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)"
+//#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION
/**
* The STRING_DISTRIBUTION_DATE represents when the binary file was built,
* here we define this default string as the date where the latest release
* version was tagged.
*/
-//#define STRING_DISTRIBUTION_DATE "2019-07-10"
+//#define STRING_DISTRIBUTION_DATE "2020-07-09"
/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
@@ -65,12 +65,12 @@
* The WEBSITE_URL is the location where users can get more information such as
* documentation about a specific Marlin release.
*/
-//#define WEBSITE_URL "http://marlinfw.org"
+//#define WEBSITE_URL "https://marlinfw.org"
/**
* Set the vendor info the serial USB interface, if changable
* Currently only supported by DUE platform
*/
-//#define USB_DEVICE_VENDOR_ID 0x0000
-//#define USB_DEVICE_PRODUCT_ID 0x0000
-//#define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL
+//#define USB_DEVICE_VENDOR_ID 0x0000
+//#define USB_DEVICE_PRODUCT_ID 0x0000
+//#define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/HAL.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/HAL.cpp
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/HAL.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/HAL.cpp
index 4a10f73d..58d57c8e 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/HAL.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/HAL.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __AVR__
#include "../../inc/MarlinConfig.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/HAL.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/HAL.h
new file mode 100644
index 00000000..b0e0674c
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/HAL.h
@@ -0,0 +1,202 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+#pragma once
+
+#include "../shared/Marduino.h"
+#include "../shared/HAL_SPI.h"
+#include "fastio.h"
+#include "watchdog.h"
+#include "math.h"
+
+#ifdef USBCON
+ #include
+#else
+ #define HardwareSerial_h // Hack to prevent HardwareSerial.h header inclusion
+ #include "MarlinSerial.h"
+#endif
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifndef pgm_read_ptr
+ // Compatibility for avr-libc 1.8.0-4.1 included with Ubuntu for
+ // Windows Subsystem for Linux on Windows 10 as of 10/18/2019
+ #define pgm_read_ptr_far(address_long) (void*)__ELPM_word((uint32_t)(address_long))
+ #define pgm_read_ptr_near(address_short) (void*)__LPM_word((uint16_t)(address_short))
+ #define pgm_read_ptr(address_short) pgm_read_ptr_near(address_short)
+#endif
+
+// ------------------------
+// Defines
+// ------------------------
+
+// AVR PROGMEM extension for sprintf_P
+#define S_FMT "%S"
+
+// AVR PROGMEM extension for string define
+#define PGMSTR(NAM,STR) const char NAM[] PROGMEM = STR
+
+#ifndef CRITICAL_SECTION_START
+ #define CRITICAL_SECTION_START() unsigned char _sreg = SREG; cli()
+ #define CRITICAL_SECTION_END() SREG = _sreg
+#endif
+#define ISRS_ENABLED() TEST(SREG, SREG_I)
+#define ENABLE_ISRS() sei()
+#define DISABLE_ISRS() cli()
+
+// ------------------------
+// Types
+// ------------------------
+
+typedef int8_t pin_t;
+
+#define SHARED_SERVOS HAS_SERVOS
+#define HAL_SERVO_LIB Servo
+
+// ------------------------
+// Public Variables
+// ------------------------
+
+//extern uint8_t MCUSR;
+
+// Serial ports
+#ifdef USBCON
+ #if ENABLED(BLUETOOTH)
+ #define MYSERIAL0 bluetoothSerial
+ #else
+ #define MYSERIAL0 Serial
+ #endif
+ #define NUM_SERIAL 1
+#else
+ #if !WITHIN(SERIAL_PORT, -1, 3)
+ #error "SERIAL_PORT must be from -1 to 3. Please update your configuration."
+ #endif
+
+ #define MYSERIAL0 customizedSerial1
+
+ #ifdef SERIAL_PORT_2
+ #if !WITHIN(SERIAL_PORT_2, -1, 3)
+ #error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
+ #elif SERIAL_PORT_2 == SERIAL_PORT
+ #error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
+ #endif
+ #define MYSERIAL1 customizedSerial2
+ #define NUM_SERIAL 2
+ #else
+ #define NUM_SERIAL 1
+ #endif
+#endif
+
+#ifdef DGUS_SERIAL_PORT
+ #if !WITHIN(DGUS_SERIAL_PORT, -1, 3)
+ #error "DGUS_SERIAL_PORT must be from -1 to 3. Please update your configuration."
+ #elif DGUS_SERIAL_PORT == SERIAL_PORT
+ #error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
+ #elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
+ #error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
+ #endif
+ #define DGUS_SERIAL internalDgusSerial
+
+ #define DGUS_SERIAL_GET_TX_BUFFER_FREE DGUS_SERIAL.get_tx_buffer_free
+#endif
+
+// ------------------------
+// Public functions
+// ------------------------
+
+void HAL_init();
+
+//void cli();
+
+//void _delay_ms(const int delay);
+
+inline void HAL_clear_reset_source() { MCUSR = 0; }
+inline uint8_t HAL_get_reset_source() { return MCUSR; }
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-function"
+extern "C" {
+ int freeMemory();
+}
+#pragma GCC diagnostic pop
+
+// ADC
+#ifdef DIDR2
+ #define HAL_ANALOG_SELECT(ind) do{ if (ind < 8) SBI(DIDR0, ind); else SBI(DIDR2, ind & 0x07); }while(0)
+#else
+ #define HAL_ANALOG_SELECT(ind) SBI(DIDR0, ind);
+#endif
+
+inline void HAL_adc_init() {
+ ADCSRA = _BV(ADEN) | _BV(ADSC) | _BV(ADIF) | 0x07;
+ DIDR0 = 0;
+ #ifdef DIDR2
+ DIDR2 = 0;
+ #endif
+}
+
+#define SET_ADMUX_ADCSRA(ch) ADMUX = _BV(REFS0) | (ch & 0x07); SBI(ADCSRA, ADSC)
+#ifdef MUX5
+ #define HAL_START_ADC(ch) if (ch > 7) ADCSRB = _BV(MUX5); else ADCSRB = 0; SET_ADMUX_ADCSRA(ch)
+#else
+ #define HAL_START_ADC(ch) ADCSRB = 0; SET_ADMUX_ADCSRA(ch)
+#endif
+
+#define HAL_ADC_VREF 5.0
+#define HAL_ADC_RESOLUTION 10
+#define HAL_READ_ADC() ADC
+#define HAL_ADC_READY() !TEST(ADCSRA, ADSC)
+
+#define GET_PIN_MAP_PIN(index) index
+#define GET_PIN_MAP_INDEX(pin) pin
+#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
+
+#define HAL_SENSITIVE_PINS 0, 1
+
+#ifdef __AVR_AT90USB1286__
+ #define JTAG_DISABLE() do{ MCUCR = 0x80; MCUCR = 0x80; }while(0)
+#endif
+
+// AVR compatibility
+#define strtof strtod
+
+#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment
+
+/**
+ * set_pwm_frequency
+ * Sets the frequency of the timer corresponding to the provided pin
+ * as close as possible to the provided desired frequency. Internally
+ * calculates the required waveform generation mode, prescaler and
+ * resolution values required and sets the timer registers accordingly.
+ * NOTE that the frequency is applied to all pins on the timer (Ex OC3A, OC3B and OC3B)
+ * NOTE that there are limitations, particularly if using TIMER2. (see Configuration_adv.h -> FAST FAN PWM Settings)
+ */
+void set_pwm_frequency(const pin_t pin, int f_desired);
+
+/**
+ * set_pwm_duty
+ * Sets the PWM duty cycle of the provided pin to the provided value
+ * Optionally allows inverting the duty cycle [default = false]
+ * Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255]
+ */
+void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/HAL_SPI.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/HAL_SPI.cpp
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/HAL_SPI.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/HAL_SPI.cpp
index 7a0f7246..31e58974 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/HAL_SPI.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/HAL_SPI.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -197,7 +197,7 @@ void spiBegin() {
// output pin high - like sending 0xFF
WRITE(MOSI_PIN, HIGH);
- for (uint8_t i = 0; i < 8; i++) {
+ LOOP_L_N(i, 8) {
WRITE(SCK_PIN, HIGH);
nop; // adjust so SCK is nice
@@ -224,7 +224,7 @@ void spiBegin() {
void spiSend(uint8_t data) {
// no interrupts during byte send - about 8µs
cli();
- for (uint8_t i = 0; i < 8; i++) {
+ LOOP_L_N(i, 8) {
WRITE(SCK_PIN, LOW);
WRITE(MOSI_PIN, data & 0x80);
data <<= 1;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/MarlinSerial.cpp
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/MarlinSerial.cpp
index 3502aa6b..f41ef201 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/MarlinSerial.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -41,7 +41,11 @@
#if !defined(USBCON) && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H))
#include "MarlinSerial.h"
- #include "../../Marlin.h"
+ #include "../../MarlinCore.h"
+
+ #if ENABLED(DIRECT_STEPPING)
+ #include "../../feature/direct_stepping.h"
+ #endif
template typename MarlinSerial::ring_buffer_r MarlinSerial::rx_buffer = { 0, 0, { 0 } };
template typename MarlinSerial::ring_buffer_t MarlinSerial::tx_buffer = { 0 };
@@ -55,7 +59,7 @@
// A SW memory barrier, to ensure GCC does not overoptimize loops
#define sw_barrier() asm volatile("": : :"memory");
- #include "../../feature/emergency_parser.h"
+ #include "../../feature/e_parser.h"
// "Atomically" read the RX head index value without disabling interrupts:
// This MUST be called with RX interrupts enabled, and CAN'T be called
@@ -131,6 +135,18 @@
static EmergencyParser::State emergency_state; // = EP_RESET
+ // This must read the R_UCSRA register before reading the received byte to detect error causes
+ if (Cfg::DROPPED_RX && B_DOR && !++rx_dropped_bytes) --rx_dropped_bytes;
+ if (Cfg::RX_OVERRUNS && B_DOR && !++rx_buffer_overruns) --rx_buffer_overruns;
+ if (Cfg::RX_FRAMING_ERRORS && B_FE && !++rx_framing_errors) --rx_framing_errors;
+
+ // Read the character from the USART
+ uint8_t c = R_UDR;
+
+ #if ENABLED(DIRECT_STEPPING)
+ if (page_manager.maybe_store_rxd_char(c)) return;
+ #endif
+
// Get the tail - Nothing can alter its value while this ISR is executing, but there's
// a chance that this ISR interrupted the main process while it was updating the index.
// The backup mechanism ensures the correct value is always returned.
@@ -142,14 +158,6 @@
// Get the next element
ring_buffer_pos_t i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1);
- // This must read the R_UCSRA register before reading the received byte to detect error causes
- if (Cfg::DROPPED_RX && B_DOR && !++rx_dropped_bytes) --rx_dropped_bytes;
- if (Cfg::RX_OVERRUNS && B_DOR && !++rx_buffer_overruns) --rx_buffer_overruns;
- if (Cfg::RX_FRAMING_ERRORS && B_FE && !++rx_framing_errors) --rx_framing_errors;
-
- // Read the character from the USART
- uint8_t c = R_UDR;
-
if (Cfg::EMERGENCYPARSER) emergency_parser.update(emergency_state, c);
// If the character is to be stored at the index just before the tail
@@ -682,7 +690,7 @@
// Round correctly so that print(1.999, 2) prints as "2.00"
double rounding = 0.5;
- for (uint8_t i = 0; i < digits; ++i) rounding *= 0.1;
+ LOOP_L_N(i, digits) rounding *= 0.1;
number += rounding;
// Extract the integer part of the number and print it
@@ -757,6 +765,33 @@
#endif
+#ifdef DGUS_SERIAL_PORT
+
+ template
+ typename MarlinSerial::ring_buffer_pos_t MarlinSerial::get_tx_buffer_free() {
+ const ring_buffer_pos_t t = tx_buffer.tail, // next byte to send.
+ h = tx_buffer.head; // next pos for queue.
+ int ret = t - h - 1;
+ if (ret < 0) ret += Cfg::TX_SIZE + 1;
+ return ret;
+ }
+
+ ISR(SERIAL_REGNAME(USART,DGUS_SERIAL_PORT,_RX_vect)) {
+ MarlinSerial>::store_rxd_char();
+ }
+
+ ISR(SERIAL_REGNAME(USART,DGUS_SERIAL_PORT,_UDRE_vect)) {
+ MarlinSerial>::_tx_udr_empty_irq();
+ }
+
+ // Preinstantiate
+ template class MarlinSerial>;
+
+ // Instantiate
+ MarlinSerial> internalDgusSerial;
+
+#endif
+
// For AT90USB targets use the UART for BT interfacing
#if defined(USBCON) && ENABLED(BLUETOOTH)
HardwareSerial bluetoothSerial;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/MarlinSerial.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/MarlinSerial.h
similarity index 87%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/MarlinSerial.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/MarlinSerial.h
index 7560d880..1182d86a 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/MarlinSerial.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/MarlinSerial.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -31,10 +31,10 @@
* Templatized 01 October 2018 by Eduardo José Tagle to allow multiple instances
*/
-#include "../shared/MarlinSerial.h"
-
#include
+#include "../../inc/MarlinConfigPre.h"
+
#ifndef SERIAL_PORT
#define SERIAL_PORT 0
#endif
@@ -217,6 +217,9 @@
static ring_buffer_pos_t available();
static void write(const uint8_t c);
static void flushTX();
+ #ifdef DGUS_SERIAL_PORT
+ static ring_buffer_pos_t get_tx_buffer_free();
+ #endif
FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; }
FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; }
@@ -258,12 +261,12 @@
static constexpr int PORT = serial;
static constexpr unsigned int RX_SIZE = RX_BUFFER_SIZE;
static constexpr unsigned int TX_SIZE = TX_BUFFER_SIZE;
- static constexpr bool XONOFF = bSERIAL_XON_XOFF;
- static constexpr bool EMERGENCYPARSER = bEMERGENCY_PARSER;
- static constexpr bool DROPPED_RX = bSERIAL_STATS_DROPPED_RX;
- static constexpr bool RX_OVERRUNS = bSERIAL_STATS_RX_BUFFER_OVERRUNS;
- static constexpr bool RX_FRAMING_ERRORS = bSERIAL_STATS_RX_FRAMING_ERRORS;
- static constexpr bool MAX_RX_QUEUED = bSERIAL_STATS_MAX_RX_QUEUED;
+ static constexpr bool XONOFF = ENABLED(SERIAL_XON_XOFF);
+ static constexpr bool EMERGENCYPARSER = ENABLED(EMERGENCY_PARSER);
+ static constexpr bool DROPPED_RX = ENABLED(SERIAL_STATS_DROPPED_RX);
+ static constexpr bool RX_OVERRUNS = ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS);
+ static constexpr bool RX_FRAMING_ERRORS = ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS);
+ static constexpr bool MAX_RX_QUEUED = ENABLED(SERIAL_STATS_MAX_RX_QUEUED);
};
extern MarlinSerial> customizedSerial1;
@@ -292,6 +295,23 @@
extern MarlinSerial> internalSerial;
#endif
+#ifdef DGUS_SERIAL_PORT
+ template
+ struct MarlinInternalSerialCfg {
+ static constexpr int PORT = serial;
+ static constexpr unsigned int RX_SIZE = DGUS_RX_BUFFER_SIZE;
+ static constexpr unsigned int TX_SIZE = DGUS_TX_BUFFER_SIZE;
+ static constexpr bool XONOFF = false;
+ static constexpr bool EMERGENCYPARSER = false;
+ static constexpr bool DROPPED_RX = false;
+ static constexpr bool RX_OVERRUNS = BOTH(HAS_DGUS_LCD, DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS);
+ static constexpr bool RX_FRAMING_ERRORS = false;
+ static constexpr bool MAX_RX_QUEUED = false;
+ };
+
+ extern MarlinSerial> internalDgusSerial;
+#endif
+
// Use the UART for Bluetooth in AT90USB configurations
#if defined(USBCON) && ENABLED(BLUETOOTH)
extern HardwareSerial bluetoothSerial;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/Servo.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/Servo.cpp
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/Servo.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/Servo.cpp
index 33818edb..66ed993c 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/Servo.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/Servo.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -59,7 +59,6 @@
#include
-#include "../shared/Marduino.h"
#include "../shared/servo.h"
#include "../shared/servo_private.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/ServoTimers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/ServoTimers.h
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/ServoTimers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/ServoTimers.h
index 4991caef..564714df 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/ServoTimers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/ServoTimers.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/eeprom.cpp
similarity index 76%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/eeprom.cpp
index 116a8288..c7906985 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/eeprom.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#ifdef __AVR__
@@ -25,9 +25,18 @@
#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
-#include "../shared/persistent_store_api.h"
+/**
+ * PersistentStore for Arduino-style EEPROM interface
+ * with implementations supplied by the framework.
+ */
-bool PersistentStore::access_start() { return true; }
+#include "../shared/eeprom_api.h"
+
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE size_t(E2END + 1)
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
@@ -39,14 +48,14 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
if (v != eeprom_read_byte(p)) {
eeprom_write_byte(p, v);
if (eeprom_read_byte(p) != v) {
- SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
+ SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
return true;
}
}
crc16(crc, &v, 1);
pos++;
value++;
- };
+ }
return false;
}
@@ -61,7 +70,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false; // always assume success for AVR's
}
-size_t PersistentStore::capacity() { return E2END + 1; }
-
#endif // EEPROM_SETTINGS || SD_FIRMWARE_UPDATE
#endif // __AVR__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/endstop_interrupts.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/endstop_interrupts.h
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/endstop_interrupts.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/endstop_interrupts.h
index 77fa5816..ae9a605a 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/endstop_interrupts.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/endstop_interrupts.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -232,6 +232,22 @@ void setup_endstop_interrupts() {
pciSetup(Z3_MIN_PIN);
#endif
#endif
+ #if HAS_Z4_MAX
+ #if (digitalPinToInterrupt(Z4_MAX_PIN) != NOT_AN_INTERRUPT)
+ _ATTACH(Z4_MAX_PIN);
+ #else
+ static_assert(digitalPinHasPCICR(Z4_MAX_PIN), "Z4_MAX_PIN is not interrupt-capable");
+ pciSetup(Z4_MAX_PIN);
+ #endif
+ #endif
+ #if HAS_Z4_MIN
+ #if (digitalPinToInterrupt(Z4_MIN_PIN) != NOT_AN_INTERRUPT)
+ _ATTACH(Z4_MIN_PIN);
+ #else
+ static_assert(digitalPinHasPCICR(Z4_MIN_PIN), "Z4_MIN_PIN is not interrupt-capable");
+ pciSetup(Z4_MIN_PIN);
+ #endif
+ #endif
#if HAS_Z_MIN_PROBE_PIN
#if (digitalPinToInterrupt(Z_MIN_PROBE_PIN) != NOT_AN_INTERRUPT)
_ATTACH(Z_MIN_PROBE_PIN);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fast_pwm.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fast_pwm.cpp
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fast_pwm.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fast_pwm.cpp
index 4884ede6..29866bcc 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fast_pwm.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fast_pwm.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,14 +16,14 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#ifdef __AVR__
#include "../../inc/MarlinConfigPre.h"
-#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_PWM
+#if NEEDS_HARDWARE_PWM // Specific meta-flag for features that mandate PWM
#include "HAL.h"
@@ -167,7 +167,7 @@ void set_pwm_frequency(const pin_t pin, int f_desired) {
uint16_t prescaler[] = { 0, 1, 8, /*TIMER2 ONLY*/32, 64, /*TIMER2 ONLY*/128, 256, 1024 };
// loop over prescaler values
- for (uint8_t i = 1; i < 8; i++) {
+ LOOP_S_L_N(i, 1, 8) {
uint16_t res_temp_fast = 255, res_temp_phase_correct = 255;
if (timer.n == 2) {
// No resolution calculation for TIMER2 unless enabled USE_OCR2A_AS_TOP
@@ -274,9 +274,9 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255
else
top = *timer.ICRn; // top = ICRn
- _SET_OCRnQ(timer.OCRnQ, timer.q, v * float(top / v_size)); // Scale 8/16-bit v to top value
+ _SET_OCRnQ(timer.OCRnQ, timer.q, v * float(top) / float(v_size)); // Scale 8/16-bit v to top value
}
}
-#endif // FAST_PWM_FAN || SPINDLE_LASER_PWM
+#endif // NEEDS_HARDWARE_PWM
#endif // __AVR__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio.cpp
similarity index 65%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio.cpp
index f0f7688f..b51d7f97 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -234,5 +234,55 @@ uint8_t extDigitalRead(const int8_t pin) {
}
}
+#if 0
+/**
+ * Set Timer 5 PWM frequency in Hz, from 3.8Hz up to ~16MHz
+ * with a minimum resolution of 100 steps.
+ *
+ * DC values -1.0 to 1.0. Negative duty cycle inverts the pulse.
+ */
+uint16_t set_pwm_frequency_hz(const float &hz, const float dca, const float dcb, const float dcc) {
+ float count = 0;
+ if (hz > 0 && (dca || dcb || dcc)) {
+ count = float(F_CPU) / hz; // 1x prescaler, TOP for 16MHz base freq.
+ uint16_t prescaler; // Range of 30.5Hz (65535) 64.5KHz (>31)
+
+ if (count >= 255. * 256.) { prescaler = 1024; SET_CS(5, PRESCALER_1024); }
+ else if (count >= 255. * 64.) { prescaler = 256; SET_CS(5, PRESCALER_256); }
+ else if (count >= 255. * 8.) { prescaler = 64; SET_CS(5, PRESCALER_64); }
+ else if (count >= 255.) { prescaler = 8; SET_CS(5, PRESCALER_8); }
+ else { prescaler = 1; SET_CS(5, PRESCALER_1); }
+
+ count /= float(prescaler);
+ const float pwm_top = round(count); // Get the rounded count
+
+ ICR5 = (uint16_t)pwm_top - 1; // Subtract 1 for TOP
+ OCR5A = pwm_top * ABS(dca); // Update and scale DCs
+ OCR5B = pwm_top * ABS(dcb);
+ OCR5C = pwm_top * ABS(dcc);
+ _SET_COM(5, A, dca ? (dca < 0 ? COM_SET_CLEAR : COM_CLEAR_SET) : COM_NORMAL); // Set compare modes
+ _SET_COM(5, B, dcb ? (dcb < 0 ? COM_SET_CLEAR : COM_CLEAR_SET) : COM_NORMAL);
+ _SET_COM(5, C, dcc ? (dcc < 0 ? COM_SET_CLEAR : COM_CLEAR_SET) : COM_NORMAL);
+
+ SET_WGM(5, FAST_PWM_ICRn); // Fast PWM with ICR5 as TOP
+
+ //SERIAL_ECHOLNPGM("Timer 5 Settings:");
+ //SERIAL_ECHOLNPAIR(" Prescaler=", prescaler);
+ //SERIAL_ECHOLNPAIR(" TOP=", ICR5);
+ //SERIAL_ECHOLNPAIR(" OCR5A=", OCR5A);
+ //SERIAL_ECHOLNPAIR(" OCR5B=", OCR5B);
+ //SERIAL_ECHOLNPAIR(" OCR5C=", OCR5C);
+ }
+ else {
+ // Restore the default for Timer 5
+ SET_WGM(5, PWM_PC_8); // PWM 8-bit (Phase Correct)
+ SET_COMS(5, NORMAL, NORMAL, NORMAL); // Do nothing
+ SET_CS(5, PRESCALER_64); // 16MHz / 64 = 250KHz
+ OCR5A = OCR5B = OCR5C = 0;
+ }
+ return round(count);
+}
+#endif
+
#endif // FASTIO_EXT_START
#endif // __AVR__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio.h
similarity index 88%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio.h
index 501a7cdf..bd6935aa 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -57,7 +57,7 @@
*
* Now you can simply SET_OUTPUT(PIN); WRITE(PIN, HIGH); WRITE(PIN, LOW);
*
- * Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
+ * Why double up on these macros? see https://gcc.gnu.org/onlinedocs/cpp/Stringification.html
*/
#define _READ(IO) TEST(DIO ## IO ## _RPORT, DIO ## IO ## _PIN)
@@ -98,9 +98,9 @@
#define SET_INPUT(IO) _SET_INPUT(IO)
#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _WRITE(IO, HIGH); }while(0)
+#define SET_INPUT_PULLDOWN SET_INPUT
#define SET_OUTPUT(IO) _SET_OUTPUT(IO)
-
-#define SET_PWM(IO) SET_OUTPUT(IO)
+#define SET_PWM SET_OUTPUT
#define IS_INPUT(IO) _IS_INPUT(IO)
#define IS_OUTPUT(IO) _IS_OUTPUT(IO)
@@ -279,14 +279,25 @@ enum ClockSource2 : char {
*/
// Determine which harware PWMs are already in use
+#define _PWM_CHK_FAN_B(P) (P == E0_AUTO_FAN_PIN || P == E1_AUTO_FAN_PIN || P == E2_AUTO_FAN_PIN || P == E3_AUTO_FAN_PIN || P == E4_AUTO_FAN_PIN || P == E5_AUTO_FAN_PIN || P == E6_AUTO_FAN_PIN || P == E7_AUTO_FAN_PIN || P == CHAMBER_AUTO_FAN_PIN)
#if PIN_EXISTS(CONTROLLER_FAN)
- #define PWM_CHK_FAN_B(P) (P == CONTROLLER_FAN_PIN || P == E0_AUTO_FAN_PIN || P == E1_AUTO_FAN_PIN || P == E2_AUTO_FAN_PIN || P == E3_AUTO_FAN_PIN || P == E4_AUTO_FAN_PIN || P == E5_AUTO_FAN_PIN || P == CHAMBER_AUTO_FAN_PIN)
+ #define PWM_CHK_FAN_B(P) (_PWM_CHK_FAN_B(P) || P == CONTROLLER_FAN_PIN)
#else
- #define PWM_CHK_FAN_B(P) (P == E0_AUTO_FAN_PIN || P == E1_AUTO_FAN_PIN || P == E2_AUTO_FAN_PIN || P == E3_AUTO_FAN_PIN || P == E4_AUTO_FAN_PIN || P == E5_AUTO_FAN_PIN || P == CHAMBER_AUTO_FAN_PIN)
+ #define PWM_CHK_FAN_B(P) _PWM_CHK_FAN_B(P)
#endif
-#if ANY_PIN(FAN, FAN1, FAN2)
- #if PIN_EXISTS(FAN2)
+#if ANY_PIN(FAN, FAN1, FAN2, FAN3, FAN4, FAN5, FAN6, FAN7)
+ #if PIN_EXISTS(FAN7)
+ #define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN || P == FAN3_PIN || P == FAN4_PIN || P == FAN5_PIN || P == FAN6_PIN || P == FAN7_PIN)
+ #elif PIN_EXISTS(FAN6)
+ #define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN || P == FAN3_PIN || P == FAN4_PIN || P == FAN5_PIN || P == FAN6_PIN)
+ #elif PIN_EXISTS(FAN5)
+ #define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN || P == FAN3_PIN || P == FAN4_PIN || P == FAN5_PIN)
+ #elif PIN_EXISTS(FAN4)
+ #define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN || P == FAN3_PIN || P == FAN4_PIN)
+ #elif PIN_EXISTS(FAN3)
+ #define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN || P == FAN3_PIN)
+ #elif PIN_EXISTS(FAN2)
#define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN)
#elif PIN_EXISTS(FAN1)
#define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio/fastio_1280.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio/fastio_1280.h
index 62de534d..f482f823 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio/fastio_1280.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -26,7 +26,7 @@
*
* Hardware Pin : 02 03 06 07 01 05 15 16 17 18 23 24 25 26 64 63 13 12 46 45 44 43 78 77 76 75 74 73 72 71 60 59 58 57 56 55 54 53 50 70 52 51 42 41 40 39 38 37 36 35 22 21 20 19 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 | 04 08 09 10 11 14 27 28 29 30 31 32 33 34 47 48 49 61 62 65 66 67 68 69 79 80 81 98 99 100
* Port : E0 E1 E4 E5 G5 E3 H3 H4 H5 H6 B4 B5 B6 B7 J1 J0 H1 H0 D3 D2 D1 D0 A0 A1 A2 A3 A4 A5 A6 A7 C7 C6 C5 C4 C3 C2 C1 C0 D7 G2 G1 G0 L7 L6 L5 L4 L3 L2 L1 L0 B3 B2 B1 B0 F0 F1 F2 F3 F4 F5 F6 F7 K0 K1 K2 K3 K4 K5 K6 K7 | E2 E6 E7 xx xx H2 H7 G3 G4 xx xx xx xx xx D4 D5 D6 xx xx J2 J3 J4 J5 J6 J7 xx xx xx xx xx
- * Logical Pin : 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | 78 79 80 xx xx 84 85 71 70 xx xx xx xx xx 81 82 83 xx xx 72 72 75 76 77 74 xx xx xx xx xx
+ * Logical Pin : 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | 78 79 80 xx xx 84 85 71 70 xx xx xx xx xx 81 82 83 xx xx 72 73 75 76 77 74 xx xx xx xx xx
*/
#include "../fastio.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio/fastio_1281.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio/fastio_1281.h
index e3d2f128..e0bc5e29 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio/fastio_1281.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio/fastio_168.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio/fastio_168.h
index f6ee7a5d..8cfdd1e8 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio/fastio_168.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio/fastio_644.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio/fastio_644.h
index 180a3c4e..f4a9427e 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio/fastio_644.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h
index 3f17a2e2..51d400b7 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/inc/Conditionals_LCD.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/inc/Conditionals_LCD.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/inc/Conditionals_LCD.h
index 85f26f40..5f1c4b16 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/inc/Conditionals_LCD.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/inc/Conditionals_LCD.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/inc/Conditionals_adv.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/inc/Conditionals_adv.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/inc/Conditionals_adv.h
index 85f26f40..5f1c4b16 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/inc/Conditionals_adv.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/inc/Conditionals_adv.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/inc/Conditionals_post.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/inc/Conditionals_post.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/inc/Conditionals_post.h
index 85f26f40..5f1c4b16 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/inc/Conditionals_post.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/inc/Conditionals_post.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/inc/SanityCheck.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/inc/SanityCheck.h
similarity index 76%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/inc/SanityCheck.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/inc/SanityCheck.h
index a6bff05c..e55e45b7 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/inc/SanityCheck.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/inc/SanityCheck.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -25,16 +25,6 @@
* Test AVR-specific configuration values for errors at compile-time.
*/
-/**
- * Digipot requirement
- */
- #if ENABLED(DIGIPOT_MCP4018)
- #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \
- || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1)
- #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined."
- #endif
-#endif
-
/**
* Checks for FAST PWM
*/
@@ -51,11 +41,17 @@
#elif NUM_SERVOS > 0 && (WITHIN(SPINDLE_LASER_PWM_PIN, 2, 3) || SPINDLE_LASER_PWM_PIN == 5)
#error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system."
#endif
+#elif defined(SPINDLE_LASER_FREQUENCY)
+ #error "SPINDLE_LASER_FREQUENCY requires SPINDLE_LASER_PWM."
#endif
/**
* The Trinamic library includes SoftwareSerial.h, leading to a compile error.
*/
-#if HAS_TRINAMIC && ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
+#if BOTH(HAS_TRINAMIC_CONFIG, ENDSTOP_INTERRUPTS_FEATURE)
#error "TMCStepper includes SoftwareSerial.h which is incompatible with ENDSTOP_INTERRUPTS_FEATURE. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."
#endif
+
+#if BOTH(HAS_TMC_SW_SERIAL, MONITOR_DRIVER_STATUS)
+ #error "MONITOR_DRIVER_STATUS causes performance issues when used with SoftwareSerial-connected drivers. Disable MONITOR_DRIVER_STATUS or use hardware serial to continue."
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/math.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/math.h
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/math.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/math.h
index d397cc4e..7ede4acc 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/math.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/math.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/pinsDebug.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/pinsDebug.h
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/pinsDebug.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/pinsDebug.h
index 8e083494..d73f520d 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/pinsDebug.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/pinsDebug.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -70,12 +70,12 @@
void PRINT_ARRAY_NAME(uint8_t x) {
char *name_mem_pointer = (char*)pgm_read_ptr(&pin_array[x].name);
- for (uint8_t y = 0; y < MAX_NAME_LENGTH; y++) {
+ LOOP_L_N(y, MAX_NAME_LENGTH) {
char temp_char = pgm_read_byte(name_mem_pointer + y);
if (temp_char != 0)
SERIAL_CHAR(temp_char);
else {
- for (uint8_t i = 0; i < MAX_NAME_LENGTH - y; i++) SERIAL_CHAR(' ');
+ LOOP_L_N(i, MAX_NAME_LENGTH - y) SERIAL_CHAR(' ');
break;
}
}
@@ -231,11 +231,10 @@ static void err_is_interrupt() { SERIAL_ECHOPGM(" compare interrupt enabled"
static void err_prob_interrupt() { SERIAL_ECHOPGM(" overflow interrupt enabled"); }
static void print_is_also_tied() { SERIAL_ECHOPGM(" is also tied to this pin"); SERIAL_ECHO_SP(14); }
-void com_print(uint8_t N, uint8_t Z) {
+inline void com_print(const uint8_t N, const uint8_t Z) {
const uint8_t *TCCRA = (uint8_t*)TCCR_A(N);
SERIAL_ECHOPGM(" COM");
- SERIAL_CHAR('0' + N);
- SERIAL_CHAR('A' + Z);
+ SERIAL_CHAR('0' + N, Z);
SERIAL_ECHOPAIR(": ", int((*TCCRA >> (6 - Z * 2)) & 0x03));
}
@@ -247,8 +246,7 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1);
SERIAL_ECHOPGM(" TIMER");
- SERIAL_CHAR(T + '0');
- SERIAL_CHAR(L);
+ SERIAL_CHAR(T + '0', L);
SERIAL_ECHO_SP(3);
if (N == 3) {
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/pinsDebug_Teensyduino.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/pinsDebug_Teensyduino.h
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/pinsDebug_Teensyduino.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/pinsDebug_Teensyduino.h
index 43884307..051972a8 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/pinsDebug_Teensyduino.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/pinsDebug_Teensyduino.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/pinsDebug_plus_70.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/pinsDebug_plus_70.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/pinsDebug_plus_70.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/pinsDebug_plus_70.h
index e5bb82f2..46c03088 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/pinsDebug_plus_70.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/pinsDebug_plus_70.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/spi_pins.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/spi_pins.h
similarity index 93%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/spi_pins.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/spi_pins.h
index c7951acf..f3fa78e2 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/spi_pins.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/spi_pins.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/HAL.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/timers.h
similarity index 71%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/HAL.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/timers.h
index e6d96836..6c40d322 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/HAL.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/timers.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
*
* This program is free software: you can redistribute it and/or modify
@@ -14,54 +14,11 @@
* 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 .
+ * along with this program. If not, see .
*/
#pragma once
-#include "../shared/Marduino.h"
-#include "../shared/HAL_SPI.h"
-#include "fastio.h"
-#include "watchdog.h"
-#include "math.h"
-
-#ifdef USBCON
- #include
-#else
- #define HardwareSerial_h // Hack to prevent HardwareSerial.h header inclusion
- #include "MarlinSerial.h"
-#endif
-
#include
-#include
-#include
-#include
-#include
-#include
-
-#ifndef pgm_read_ptr
- // Compatibility for avr-libc 1.8.0-4.1 included with Ubuntu for
- // Windows Subsystem for Linux on Windows 10 as of 10/18/2019
- #define pgm_read_ptr_far(address_long) (void*)__ELPM_word((uint32_t)(address_long))
- #define pgm_read_ptr_near(address_short) (void*)__LPM_word((uint16_t)(address_short))
- #define pgm_read_ptr(address_short) pgm_read_ptr_near(address_short)
-#endif
-
-// ------------------------
-// Defines
-// ------------------------
-
-//#define analogInputToDigitalPin(IO) IO
-
-#ifndef CRITICAL_SECTION_START
- #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli()
- #define CRITICAL_SECTION_END SREG = _sreg
-#endif
-#define ISRS_ENABLED() TEST(SREG, SREG_I)
-#define ENABLE_ISRS() sei()
-#define DISABLE_ISRS() cli()
-
-// On AVR this is in math.h?
-//#define square(x) ((x)*(x))
// ------------------------
// Types
@@ -70,71 +27,21 @@
typedef uint16_t hal_timer_t;
#define HAL_TIMER_TYPE_MAX 0xFFFF
-typedef int8_t pin_t;
-
-#define SHARED_SERVOS HAS_SERVOS
-#define HAL_SERVO_LIB Servo
-
-// ------------------------
-// Public Variables
// ------------------------
-
-//extern uint8_t MCUSR;
-
-// Serial ports
-#ifdef USBCON
- #if ENABLED(BLUETOOTH)
- #define MYSERIAL0 bluetoothSerial
- #else
- #define MYSERIAL0 Serial
- #endif
- #define NUM_SERIAL 1
-#else
- #if !WITHIN(SERIAL_PORT, -1, 3)
- #error "SERIAL_PORT must be from -1 to 3"
- #endif
-
- #define MYSERIAL0 customizedSerial1
-
- #ifdef SERIAL_PORT_2
- #if !WITHIN(SERIAL_PORT_2, -1, 3)
- #error "SERIAL_PORT_2 must be from -1 to 3"
- #elif SERIAL_PORT_2 == SERIAL_PORT
- #error "SERIAL_PORT_2 must be different than SERIAL_PORT"
- #endif
- #define NUM_SERIAL 2
- #define MYSERIAL1 customizedSerial2
- #else
- #define NUM_SERIAL 1
- #endif
-#endif
-
-// ------------------------
-// Public functions
+// Defines
// ------------------------
-void HAL_init();
-
-//void cli();
-
-//void _delay_ms(const int delay);
-
-inline void HAL_clear_reset_source() { MCUSR = 0; }
-inline uint8_t HAL_get_reset_source() { return MCUSR; }
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wunused-function"
-extern "C" {
- int freeMemory();
-}
-#pragma GCC diagnostic pop
-
-// timers
#define HAL_TIMER_RATE ((F_CPU) / 8) // i.e., 2MHz or 2.5MHz
-#define STEP_TIMER_NUM 1
-#define TEMP_TIMER_NUM 0
-#define PULSE_TIMER_NUM STEP_TIMER_NUM
+#ifndef STEP_TIMER_NUM
+ #define STEP_TIMER_NUM 1
+#endif
+#ifndef PULSE_TIMER_NUM
+ #define PULSE_TIMER_NUM STEP_TIMER_NUM
+#endif
+#ifndef TEMP_TIMER_NUM
+ #define TEMP_TIMER_NUM 0
+#endif
#define TEMP_TIMER_FREQUENCY ((F_CPU) / 64.0 / 256.0)
@@ -205,6 +112,8 @@ FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) {
#define HAL_timer_isr_epilogue(TIMER_NUM)
/* 18 cycles maximum latency */
+#ifndef HAL_STEP_TIMER_ISR
+
#define HAL_STEP_TIMER_ISR() \
extern "C" void TIMER1_COMPA_vect() __attribute__ ((signal, naked, used, externally_visible)); \
extern "C" void TIMER1_COMPA_vect_bottom() asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
@@ -277,6 +186,10 @@ void TIMER1_COMPA_vect() { \
} \
void TIMER1_COMPA_vect_bottom()
+#endif // HAL_STEP_TIMER_ISR
+
+#ifndef HAL_TEMP_TIMER_ISR
+
/* 14 cycles maximum latency */
#define HAL_TEMP_TIMER_ISR() \
extern "C" void TIMER0_COMPB_vect() __attribute__ ((signal, naked, used, externally_visible)); \
@@ -343,60 +256,4 @@ void TIMER0_COMPB_vect() { \
} \
void TIMER0_COMPB_vect_bottom()
-// ADC
-#ifdef DIDR2
- #define HAL_ANALOG_SELECT(pin) do{ if (pin < 8) SBI(DIDR0, pin); else SBI(DIDR2, pin & 0x07); }while(0)
-#else
- #define HAL_ANALOG_SELECT(pin) do{ SBI(DIDR0, pin); }while(0)
-#endif
-
-inline void HAL_adc_init() {
- ADCSRA = _BV(ADEN) | _BV(ADSC) | _BV(ADIF) | 0x07;
- DIDR0 = 0;
- #ifdef DIDR2
- DIDR2 = 0;
- #endif
-}
-
-#define SET_ADMUX_ADCSRA(pin) ADMUX = _BV(REFS0) | (pin & 0x07); SBI(ADCSRA, ADSC)
-#ifdef MUX5
- #define HAL_START_ADC(pin) if (pin > 7) ADCSRB = _BV(MUX5); else ADCSRB = 0; SET_ADMUX_ADCSRA(pin)
-#else
- #define HAL_START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin)
-#endif
-
-#define HAL_ADC_RESOLUTION 10
-#define HAL_READ_ADC() ADC
-#define HAL_ADC_READY() !TEST(ADCSRA, ADSC)
-
-#define GET_PIN_MAP_PIN(index) index
-#define GET_PIN_MAP_INDEX(pin) pin
-#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
-
-#define HAL_SENSITIVE_PINS 0, 1
-
-#ifdef __AVR_AT90USB1286__
- #define JTAG_DISABLE() do{ MCUCR = 0x80; MCUCR = 0x80; }while(0)
-#endif
-
-// AVR compatibility
-#define strtof strtod
-
-/**
- * set_pwm_frequency
- * Sets the frequency of the timer corresponding to the provided pin
- * as close as possible to the provided desired frequency. Internally
- * calculates the required waveform generation mode, prescaler and
- * resolution values required and sets the timer registers accordingly.
- * NOTE that the frequency is applied to all pins on the timer (Ex OC3A, OC3B and OC3B)
- * NOTE that there are limitations, particularly if using TIMER2. (see Configuration_adv.h -> FAST FAN PWM Settings)
- */
-void set_pwm_frequency(const pin_t pin, int f_desired);
-
-/**
- * set_pwm_duty
- * Sets the PWM duty cycle of the provided pin to the provided value
- * Optionally allows inverting the duty cycle [default = false]
- * Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255]
- */
-void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false);
+#endif // HAL_TEMP_TIMER_ISR
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/u8g_com_HAL_AVR_sw_spi.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/u8g_com_HAL_AVR_sw_spi.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp
index bc08bc37..c29b1955 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/u8g_com_HAL_AVR_sw_spi.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -88,7 +88,7 @@ void u8g_spiSend_sw_AVR_mode_0(uint8_t val) {
volatile uint8_t *outData = u8g_outData,
*outClock = u8g_outClock;
U8G_ATOMIC_START();
- for (uint8_t i = 0; i < 8; i++) {
+ LOOP_L_N(i, 8) {
if (val & 0x80)
*outData |= bitData;
else
@@ -108,7 +108,7 @@ void u8g_spiSend_sw_AVR_mode_3(uint8_t val) {
volatile uint8_t *outData = u8g_outData,
*outClock = u8g_outClock;
U8G_ATOMIC_START();
- for (uint8_t i = 0; i < 8; i++) {
+ LOOP_L_N(i, 8) {
*outClock &= bitNotClock;
if (val & 0x80)
*outData |= bitData;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/watchdog.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/watchdog.cpp
similarity index 91%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/watchdog.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/watchdog.cpp
index 63a50319..3f10c4ad 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/watchdog.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/watchdog.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __AVR__
#include "../../inc/MarlinConfig.h"
@@ -28,7 +27,7 @@
#include "watchdog.h"
-#include "../../Marlin.h"
+#include "../../MarlinCore.h"
// Initialize watchdog with 8s timeout, if possible. Otherwise, make it 4s.
void watchdog_init() {
@@ -62,7 +61,7 @@ void watchdog_init() {
#if ENABLED(WATCHDOG_RESET_MANUAL)
ISR(WDT_vect) {
sei(); // With the interrupt driven serial we need to allow interrupts.
- SERIAL_ERROR_MSG(MSG_WATCHDOG_FIRED);
+ SERIAL_ERROR_MSG(STR_WATCHDOG_FIRED);
minkill(); // interrupt-safe final kill and infinite loop
}
#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/watchdog.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/watchdog.h
similarity index 88%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/watchdog.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/watchdog.h
index efd725d7..a16c88b3 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/watchdog.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/AVR/watchdog.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/DebugMonitor.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/DebugMonitor.cpp
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/DebugMonitor.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/DebugMonitor.cpp
index 20f10ce4..79759151 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/DebugMonitor.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/DebugMonitor.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef ARDUINO_ARCH_SAM
#include "../../core/macros.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/HAL.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/HAL.cpp
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/HAL.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/HAL.cpp
index 13077989..f2bf4ebb 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/HAL.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/HAL.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
*
* This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
* 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 .
+ * along with this program. If not, see .
*/
/**
@@ -94,8 +94,8 @@ int freeMemory() {
// ADC
// ------------------------
-void HAL_adc_start_conversion(const uint8_t adc_pin) {
- HAL_adc_result = analogRead(adc_pin);
+void HAL_adc_start_conversion(const uint8_t ch) {
+ HAL_adc_result = analogRead(ch);
}
uint16_t HAL_adc_get_result() {
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/HAL.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/HAL.h
similarity index 74%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/HAL.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/HAL.h
index 64cff246..31409c76 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/HAL.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/HAL.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
*
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -30,16 +30,16 @@
#define CPU_32_BIT
#include "../shared/Marduino.h"
+#include "../shared/eeprom_if.h"
#include "../shared/math_32bit.h"
#include "../shared/HAL_SPI.h"
#include "fastio.h"
#include "watchdog.h"
-#include "timers.h"
#include
// Define MYSERIAL0/1 before MarlinSerial includes!
-#if SERIAL_PORT == -1
+#if SERIAL_PORT == -1 || ENABLED(EMERGENCY_PARSER)
#define MYSERIAL0 customizedSerial1
#elif SERIAL_PORT == 0
#define MYSERIAL0 Serial
@@ -56,8 +56,7 @@
#ifdef SERIAL_PORT_2
#if SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different from SERIAL_PORT. Please update your configuration."
- #endif
- #if SERIAL_PORT_2 == -1
+ #elif SERIAL_PORT_2 == -1 || ENABLED(EMERGENCY_PARSER)
#define MYSERIAL1 customizedSerial2
#elif SERIAL_PORT_2 == 0
#define MYSERIAL1 Serial
@@ -75,6 +74,26 @@
#define NUM_SERIAL 1
#endif
+#ifdef DGUS_SERIAL_PORT
+ #if DGUS_SERIAL_PORT == SERIAL_PORT
+ #error "DGUS_SERIAL_PORT must be different from SERIAL_PORT. Please update your configuration."
+ #elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
+ #error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
+ #elif DGUS_SERIAL_PORT == -1
+ #define DGUS_SERIAL internalDgusSerial
+ #elif DGUS_SERIAL_PORT == 0
+ #define DGUS_SERIAL Serial
+ #elif DGUS_SERIAL_PORT == 1
+ #define DGUS_SERIAL Serial1
+ #elif DGUS_SERIAL_PORT == 2
+ #define DGUS_SERIAL Serial2
+ #elif DGUS_SERIAL_PORT == 3
+ #define DGUS_SERIAL Serial3
+ #else
+ #error "DGUS_SERIAL_PORT must be from -1 to 3. Please update your configuration."
+ #endif
+#endif
+
#include "MarlinSerial.h"
#include "MarlinSerialUSB.h"
@@ -99,8 +118,8 @@ typedef int8_t pin_t;
//
// Interrupts
//
-#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq()
-#define CRITICAL_SECTION_END if (!primask) __enable_irq()
+#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq()
+#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
#define ISRS_ENABLED() (!__get_PRIMASK())
#define ENABLE_ISRS() __enable_irq()
#define DISABLE_ISRS() __disable_irq()
@@ -111,14 +130,6 @@ void sei(); // Enable interrupts
void HAL_clear_reset_source(); // clear reset reason
uint8_t HAL_get_reset_source(); // get reset reason
-//
-// EEPROM
-//
-void eeprom_write_byte(uint8_t *pos, unsigned char value);
-uint8_t eeprom_read_byte(uint8_t *pos);
-void eeprom_read_block (void *__dst, const void *__src, size_t __n);
-void eeprom_update_block (const void *__src, void *__dst, size_t __n);
-
//
// ADC
//
@@ -128,16 +139,17 @@ extern uint16_t HAL_adc_result; // result of last ADC conversion
#define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1)
#endif
-#define HAL_ANALOG_SELECT(pin)
+#define HAL_ANALOG_SELECT(ch)
inline void HAL_adc_init() {}//todo
-#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
+#define HAL_ADC_VREF 3.3
#define HAL_ADC_RESOLUTION 10
+#define HAL_START_ADC(ch) HAL_adc_start_conversion(ch)
#define HAL_READ_ADC() HAL_adc_result
#define HAL_ADC_READY() true
-void HAL_adc_start_conversion(const uint8_t adc_pin);
+void HAL_adc_start_conversion(const uint8_t ch);
uint16_t HAL_adc_get_result();
//
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/HAL_SPI.cpp
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/HAL_SPI.cpp
index 35763a5e..6d8f7ef8 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/HAL_SPI.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -240,7 +240,7 @@
}
// all the others
- static uint32_t spiDelayCyclesX4 = (F_CPU) / 1000000; // 4uS => 125khz
+ static uint32_t spiDelayCyclesX4 = (F_CPU) / 1000000; // 4µs => 125khz
static uint8_t spiTransferX(uint8_t b) { // using Mode 0
int bits = 8;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/InterruptVectors.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/InterruptVectors.cpp
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/InterruptVectors.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/InterruptVectors.cpp
index b9f14823..e4e0ce99 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/InterruptVectors.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/InterruptVectors.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -63,13 +63,13 @@ static pfnISR_Handler* get_relocated_table_addr() {
memcpy(&ram_tab, romtab, sizeof(ram_tab));
// Disable global interrupts
- CRITICAL_SECTION_START;
+ CRITICAL_SECTION_START();
// Set the vector table base address to the SRAM copy
SCB->VTOR = (uint32_t)(&ram_tab);
// Reenable interrupts
- CRITICAL_SECTION_END;
+ CRITICAL_SECTION_END();
// Return the address of the table
return (pfnISR_Handler*)(&ram_tab);
@@ -80,7 +80,7 @@ pfnISR_Handler install_isr(IRQn_Type irq, pfnISR_Handler newHandler) {
pfnISR_Handler *isrtab = get_relocated_table_addr();
// Disable global interrupts
- CRITICAL_SECTION_START;
+ CRITICAL_SECTION_START();
// Get the original handler
pfnISR_Handler oldHandler = isrtab[irq + 16];
@@ -89,7 +89,7 @@ pfnISR_Handler install_isr(IRQn_Type irq, pfnISR_Handler newHandler) {
isrtab[irq + 16] = newHandler;
// Reenable interrupts
- CRITICAL_SECTION_END;
+ CRITICAL_SECTION_END();
// Return the original one
return oldHandler;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/InterruptVectors.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/InterruptVectors.h
similarity index 91%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/InterruptVectors.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/InterruptVectors.h
index 87dd0496..6faeb34b 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/InterruptVectors.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/InterruptVectors.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/MarlinSerial.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/MarlinSerial.cpp
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/MarlinSerial.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/MarlinSerial.cpp
index 7b88b6d4..c9a372ee 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/MarlinSerial.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/MarlinSerial.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -31,7 +31,7 @@
#include "MarlinSerial.h"
#include "InterruptVectors.h"
-#include "../../Marlin.h"
+#include "../../MarlinCore.h"
template typename MarlinSerial::ring_buffer_r MarlinSerial::rx_buffer = { 0, 0, { 0 } };
template typename MarlinSerial::ring_buffer_t MarlinSerial::tx_buffer = { 0 };
@@ -45,7 +45,7 @@ template typename MarlinSerial::ring_buffer_pos_t MarlinSeria
// A SW memory barrier, to ensure GCC does not overoptimize loops
#define sw_barrier() asm volatile("": : :"memory");
-#include "../../feature/emergency_parser.h"
+#include "../../feature/e_parser.h"
// (called with RX interrupts disabled)
template
@@ -606,7 +606,7 @@ void MarlinSerial::printFloat(double number, uint8_t digits) {
// Round correctly so that print(1.999, 2) prints as "2.00"
double rounding = 0.5;
- for (uint8_t i = 0; i < digits; ++i) rounding *= 0.1;
+ LOOP_L_N(i, digits) rounding *= 0.1;
number += rounding;
// Extract the integer part of the number and print it
@@ -629,23 +629,13 @@ void MarlinSerial::printFloat(double number, uint8_t digits) {
// If not using the USB port as serial port
#if SERIAL_PORT >= 0
-
- // Preinstantiate
- template class MarlinSerial>;
-
- // Instantiate
- MarlinSerial> customizedSerial1;
-
+ template class MarlinSerial>; // Define
+ MarlinSerial> customizedSerial1; // Instantiate
#endif
-#ifdef SERIAL_PORT_2
-
- // Preinstantiate
- template class MarlinSerial>;
-
- // Instantiate
- MarlinSerial> customizedSerial2;
-
+#if defined(SERIAL_PORT_2) && SERIAL_PORT_2 >= 0
+ template class MarlinSerial>; // Define
+ MarlinSerial> customizedSerial2; // Instantiate
#endif
#endif // ARDUINO_ARCH_SAM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/MarlinSerial.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/MarlinSerial.h
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/MarlinSerial.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/MarlinSerial.h
index 92806f15..dfafa151 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/MarlinSerial.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/MarlinSerial.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -27,10 +27,10 @@
* Based on MarlinSerial for AVR, copyright (c) 2006 Nicholas Zambetti. All right reserved.
*/
-#include "../shared/MarlinSerial.h"
-
#include
+#include "../../inc/MarlinConfigPre.h"
+
#define DEC 10
#define HEX 16
#define OCT 8
@@ -163,22 +163,18 @@ struct MarlinSerialCfg {
static constexpr int PORT = serial;
static constexpr unsigned int RX_SIZE = RX_BUFFER_SIZE;
static constexpr unsigned int TX_SIZE = TX_BUFFER_SIZE;
- static constexpr bool XONOFF = bSERIAL_XON_XOFF;
- static constexpr bool EMERGENCYPARSER = bEMERGENCY_PARSER;
- static constexpr bool DROPPED_RX = bSERIAL_STATS_DROPPED_RX;
- static constexpr bool RX_OVERRUNS = bSERIAL_STATS_RX_BUFFER_OVERRUNS;
- static constexpr bool RX_FRAMING_ERRORS = bSERIAL_STATS_RX_FRAMING_ERRORS;
- static constexpr bool MAX_RX_QUEUED = bSERIAL_STATS_MAX_RX_QUEUED;
+ static constexpr bool XONOFF = ENABLED(SERIAL_XON_XOFF);
+ static constexpr bool EMERGENCYPARSER = ENABLED(EMERGENCY_PARSER);
+ static constexpr bool DROPPED_RX = ENABLED(SERIAL_STATS_DROPPED_RX);
+ static constexpr bool RX_OVERRUNS = ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS);
+ static constexpr bool RX_FRAMING_ERRORS = ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS);
+ static constexpr bool MAX_RX_QUEUED = ENABLED(SERIAL_STATS_MAX_RX_QUEUED);
};
#if SERIAL_PORT >= 0
-
extern MarlinSerial> customizedSerial1;
+#endif
-#endif // SERIAL_PORT >= 0
-
-#ifdef SERIAL_PORT_2
-
+#if defined(SERIAL_PORT_2) && SERIAL_PORT_2 >= 0
extern MarlinSerial> customizedSerial2;
-
#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/MarlinSerialUSB.cpp
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/MarlinSerialUSB.cpp
index f7f48d5f..a41dbfeb 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/MarlinSerialUSB.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -29,12 +29,12 @@
#include "../../inc/MarlinConfig.h"
-#if SERIAL_PORT == -1
+#if HAS_USB_SERIAL
#include "MarlinSerialUSB.h"
#if ENABLED(EMERGENCY_PARSER)
- #include "../../feature/emergency_parser.h"
+ #include "../../feature/e_parser.h"
#endif
// Imports from Atmel USB Stack/CDC implementation
@@ -73,9 +73,7 @@ int MarlinSerialUSB::peek() {
pending_char = udi_cdc_getc();
- #if ENABLED(EMERGENCY_PARSER)
- emergency_parser.update(emergency_state, (char)pending_char);
- #endif
+ TERN_(EMERGENCY_PARSER, emergency_parser.update(emergency_state, (char)pending_char));
return pending_char;
}
@@ -97,9 +95,7 @@ int MarlinSerialUSB::read() {
int c = udi_cdc_getc();
- #if ENABLED(EMERGENCY_PARSER)
- emergency_parser.update(emergency_state, (char)c);
- #endif
+ TERN_(EMERGENCY_PARSER, emergency_parser.update(emergency_state, (char)c));
return c;
}
@@ -259,7 +255,7 @@ void MarlinSerialUSB::printFloat(double number, uint8_t digits) {
// Round correctly so that print(1.999, 2) prints as "2.00"
double rounding = 0.5;
- for (uint8_t i = 0; i < digits; ++i)
+ LOOP_L_N(i, digits)
rounding *= 0.1;
number += rounding;
@@ -283,8 +279,12 @@ void MarlinSerialUSB::printFloat(double number, uint8_t digits) {
}
// Preinstantiate
-MarlinSerialUSB customizedSerial1;
-
-#endif // SERIAL_PORT == -1
+#if SERIAL_PORT == -1
+ MarlinSerialUSB customizedSerial1;
+#endif
+#if SERIAL_PORT_2 == -1
+ MarlinSerialUSB customizedSerial2;
+#endif
+#endif // HAS_USB_SERIAL
#endif // ARDUINO_ARCH_SAM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/MarlinSerialUSB.h
similarity index 89%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/MarlinSerialUSB.h
index 3d9d4baf..2e3622e5 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/MarlinSerialUSB.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -28,7 +28,7 @@
#include "../../inc/MarlinConfig.h"
-#if SERIAL_PORT == -1
+#if HAS_USB_SERIAL
#include
@@ -88,6 +88,12 @@ class MarlinSerialUSB {
static void printFloat(double, uint8_t);
};
-extern MarlinSerialUSB customizedSerial1;
+#if SERIAL_PORT == -1
+ extern MarlinSerialUSB customizedSerial1;
+#endif
+
+#if SERIAL_PORT_2 == -1
+ extern MarlinSerialUSB customizedSerial2;
+#endif
-#endif // SERIAL_PORT == -1
+#endif // HAS_USB_SERIAL
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/Servo.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/Servo.cpp
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/Servo.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/Servo.cpp
index f48fdf57..5524aa9c 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/Servo.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/Servo.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -44,7 +44,6 @@
#if HAS_SERVOS
-#include "../shared/Marduino.h"
#include "../shared/servo.h"
#include "../shared/servo_private.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/ServoTimers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/ServoTimers.h
similarity index 100%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/ServoTimers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/ServoTimers.h
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/Tone.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/Tone.cpp
similarity index 86%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/Tone.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/Tone.cpp
index 2af97aac..9beb6022 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/Tone.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/Tone.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -18,20 +18,19 @@
* 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 .
+ * along with this program. If not, see .
*
*/
/**
* Description: Tone function for Arduino Due and compatible (SAM3X8E)
- * Derived from http://forum.arduino.cc/index.php?topic=136500.msg2903012#msg2903012
+ * Derived from https://forum.arduino.cc/index.php?topic=136500.msg2903012#msg2903012
*/
#ifdef ARDUINO_ARCH_SAM
#include "../../inc/MarlinConfig.h"
#include "HAL.h"
-#include "timers.h"
static pin_t tone_pin;
volatile static int32_t toggles;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp
index 5e5a4e5f..2ef7011b 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -63,7 +63,7 @@
#include
-#include "../../../Marlin.h"
+#include "../../../MarlinCore.h"
void spiBegin();
void spiInit(uint8_t spiRate);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp
index 47e56fdd..47060d6a 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp
index e078bc42..54c244d4 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp
similarity index 94%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp
index d3609f60..960df1bd 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -80,7 +80,7 @@ Pio *SCK_pPio, *MOSI_pPio;
uint32_t SCK_dwMask, MOSI_dwMask;
void u8g_spiSend_sw_DUE_mode_0(uint8_t val) { // 3MHz
- for (uint8_t i = 0; i < 8; i++) {
+ LOOP_L_N(i, 8) {
if (val & 0x80)
MOSI_pPio->PIO_SODR = MOSI_dwMask;
else
@@ -94,7 +94,7 @@ void u8g_spiSend_sw_DUE_mode_0(uint8_t val) { // 3MHz
}
void u8g_spiSend_sw_DUE_mode_3(uint8_t val) { // 3.5MHz
- for (uint8_t i = 0; i < 8; i++) {
+ LOOP_L_N(i, 8) {
SCK_pPio->PIO_CODR = SCK_dwMask;
DELAY_NS(50);
if (val & 0x80)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h
similarity index 89%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h
index b8324741..f076c503 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/eeprom_flash.cpp
similarity index 86%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/eeprom_flash.cpp
index c7b70070..d98f0603 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/eeprom_flash.cpp
@@ -1,3 +1,30 @@
+/**
+ * Marlin 3D Printer Firmware
+ *
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
+ * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
+ * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
+ *
+ * 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 .
+ *
+ */
+#ifdef ARDUINO_ARCH_SAM
+
+#include "../../inc/MarlinConfig.h"
+
+#if ENABLED(FLASH_EEPROM_EMULATION)
/* EEPROM emulation over flash with reduced wear
*
@@ -29,14 +56,7 @@
*
*/
-#ifdef ARDUINO_ARCH_SAM
-
-#include "../../inc/MarlinConfig.h"
-
-#if ENABLED(EEPROM_SETTINGS) && NONE(I2C_EEPROM, SPI_EEPROM)
-
-#include "../shared/Marduino.h"
-#include "../shared/persistent_store_api.h"
+//#define EE_EMU_DEBUG
#define EEPROMSize 4096
#define PagesPerGroup 128
@@ -113,15 +133,18 @@ static uint8_t buffer[256] = {0}, // The RAM buffer to accumulate writes
curPage = 0, // Current FLASH page inside the group
curGroup = 0xFF; // Current FLASH group
-//#define EE_EMU_DEBUG
-#ifdef EE_EMU_DEBUG
- static void ee_Dump(int page,const void* data) {
+#define DEBUG_OUT ENABLED(EE_EMU_DEBUG)
+#include "../../core/debug_out.h"
+
+static void ee_Dump(const int page, const void* data) {
+
+ #ifdef EE_EMU_DEBUG
const uint8_t* c = (const uint8_t*) data;
char buffer[80];
sprintf_P(buffer, PSTR("Page: %d (0x%04x)\n"), page, page);
- SERIAL_ECHO(buffer);
+ DEBUG_ECHO(buffer);
char* p = &buffer[0];
for (int i = 0; i< PageSize; ++i) {
@@ -131,12 +154,16 @@ static uint8_t buffer[256] = {0}, // The RAM buffer to accumulate writes
if ((i & 0xF) == 0xF) {
*p++ = '\n';
*p = 0;
- SERIAL_ECHO(buffer);
+ DEBUG_ECHO(buffer);
p = &buffer[0];
}
}
- }
-#endif
+
+ #else
+ UNUSED(page);
+ UNUSED(data);
+ #endif
+}
/* Flash Writing Protection Key */
#define FWP_KEY 0x5Au
@@ -149,17 +176,16 @@ static uint8_t buffer[256] = {0}, // The RAM buffer to accumulate writes
#define EEFC_ERROR_FLAGS (EEFC_FSR_FLOCKE | EEFC_FSR_FCMDE)
#endif
-
/**
* Writes the contents of the specified page (no previous erase)
* @param page (page #)
* @param data (pointer to the data buffer)
*/
__attribute__ ((long_call, section (".ramfunc")))
-static bool ee_PageWrite(uint16_t page,const void* data) {
+static bool ee_PageWrite(uint16_t page, const void* data) {
uint16_t i;
- uint32_t addrflash = ((uint32_t)getFlashStorage(page));
+ uint32_t addrflash = uint32_t(getFlashStorage(page));
// Read the flash contents
uint32_t pageContents[PageSize>>2];
@@ -174,13 +200,11 @@ static bool ee_PageWrite(uint16_t page,const void* data) {
for (i = 0; i > 2; i++)
pageContents[i] = (((uint32_t*)data)[i]) | (~(pageContents[i] ^ ((uint32_t*)data)[i]));
- #ifdef EE_EMU_DEBUG
- SERIAL_ECHO_START();
- SERIAL_ECHOLNPAIR("EEPROM PageWrite ", page);
- SERIAL_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash);
- SERIAL_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0));
- SERIAL_FLUSH();
- #endif
+ DEBUG_ECHO_START();
+ DEBUG_ECHOLNPAIR("EEPROM PageWrite ", page);
+ DEBUG_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash);
+ DEBUG_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0));
+ DEBUG_FLUSH();
// Get the page relative to the start of the EFC controller, and the EFC controller to use
Efc *efc;
@@ -222,10 +246,8 @@ static bool ee_PageWrite(uint16_t page,const void* data) {
// Reenable interrupts
__enable_irq();
- #ifdef EE_EMU_DEBUG
- SERIAL_ECHO_START();
- SERIAL_ECHOLNPAIR("EEPROM Unlock failure for page ", page);
- #endif
+ DEBUG_ECHO_START();
+ DEBUG_ECHOLNPAIR("EEPROM Unlock failure for page ", page);
return false;
}
@@ -249,10 +271,9 @@ static bool ee_PageWrite(uint16_t page,const void* data) {
// Reenable interrupts
__enable_irq();
- #ifdef EE_EMU_DEBUG
- SERIAL_ECHO_START();
- SERIAL_ECHOLNPAIR("EEPROM Write failure for page ", page);
- #endif
+ DEBUG_ECHO_START();
+ DEBUG_ECHOLNPAIR("EEPROM Write failure for page ", page);
+
return false;
}
@@ -266,11 +287,11 @@ static bool ee_PageWrite(uint16_t page,const void* data) {
if (memcmp(getFlashStorage(page),data,PageSize)) {
#ifdef EE_EMU_DEBUG
- SERIAL_ECHO_START();
- SERIAL_ECHOLNPAIR("EEPROM Verify Write failure for page ", page);
+ DEBUG_ECHO_START();
+ DEBUG_ECHOLNPAIR("EEPROM Verify Write failure for page ", page);
- ee_Dump( page,(uint32_t *) addrflash);
- ee_Dump(-page,data);
+ ee_Dump( page, (uint32_t *)addrflash);
+ ee_Dump(-page, data);
// Calculate count of changed bits
uint32_t* p1 = (uint32_t*)addrflash;
@@ -286,7 +307,7 @@ static bool ee_PageWrite(uint16_t page,const void* data) {
}
}
}
- SERIAL_ECHOLNPAIR("--> Differing bits: ", count);
+ DEBUG_ECHOLNPAIR("--> Differing bits: ", count);
#endif
return false;
@@ -303,15 +324,13 @@ __attribute__ ((long_call, section (".ramfunc")))
static bool ee_PageErase(uint16_t page) {
uint16_t i;
- uint32_t addrflash = ((uint32_t)getFlashStorage(page));
+ uint32_t addrflash = uint32_t(getFlashStorage(page));
- #ifdef EE_EMU_DEBUG
- SERIAL_ECHO_START();
- SERIAL_ECHOLNPAIR("EEPROM PageErase ", page);
- SERIAL_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash);
- SERIAL_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0));
- SERIAL_FLUSH();
- #endif
+ DEBUG_ECHO_START();
+ DEBUG_ECHOLNPAIR("EEPROM PageErase ", page);
+ DEBUG_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash);
+ DEBUG_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0));
+ DEBUG_FLUSH();
// Get the page relative to the start of the EFC controller, and the EFC controller to use
Efc *efc;
@@ -352,10 +371,9 @@ static bool ee_PageErase(uint16_t page) {
// Reenable interrupts
__enable_irq();
- #ifdef EE_EMU_DEBUG
- SERIAL_ECHO_START();
- SERIAL_ECHOLNPAIR("EEPROM Unlock failure for page ",page);
- #endif
+ DEBUG_ECHO_START();
+ DEBUG_ECHOLNPAIR("EEPROM Unlock failure for page ",page);
+
return false;
}
@@ -377,10 +395,9 @@ static bool ee_PageErase(uint16_t page) {
// Reenable interrupts
__enable_irq();
- #ifdef EE_EMU_DEBUG
- SERIAL_ECHO_START();
- SERIAL_ECHOLNPAIR("EEPROM Erase failure for page ",page);
- #endif
+ DEBUG_ECHO_START();
+ DEBUG_ECHOLNPAIR("EEPROM Erase failure for page ",page);
+
return false;
}
@@ -394,20 +411,17 @@ static bool ee_PageErase(uint16_t page) {
uint32_t * aligned_src = (uint32_t *) addrflash;
for (i = 0; i < PageSize >> 2; i++) {
if (*aligned_src++ != 0xFFFFFFFF) {
-
- #ifdef EE_EMU_DEBUG
- SERIAL_ECHO_START();
- SERIAL_ECHOLNPAIR("EEPROM Verify Erase failure for page ",page);
-
- ee_Dump( page,(uint32_t *) addrflash);
- #endif
+ DEBUG_ECHO_START();
+ DEBUG_ECHOLNPAIR("EEPROM Verify Erase failure for page ",page);
+ ee_Dump(page, (uint32_t *)addrflash);
return false;
}
}
return true;
}
-static uint8_t ee_Read(uint32_t address, bool excludeRAMBuffer = false) {
+
+static uint8_t ee_Read(uint32_t address, bool excludeRAMBuffer=false) {
uint32_t baddr;
uint32_t blen;
@@ -490,7 +504,7 @@ static uint8_t ee_Read(uint32_t address, bool excludeRAMBuffer = false) {
return 0xFF;
}
-static uint32_t ee_GetAddrRange(uint32_t address, bool excludeRAMBuffer = false) {
+static uint32_t ee_GetAddrRange(uint32_t address, bool excludeRAMBuffer=false) {
uint32_t baddr,
blen,
nextAddr = 0xFFFF,
@@ -582,7 +596,7 @@ static bool ee_IsPageClean(int page) {
return true;
}
-static bool ee_Flush(uint32_t overrideAddress = 0xFFFFFFFF, uint8_t overrideData = 0xFF) {
+static bool ee_Flush(uint32_t overrideAddress = 0xFFFFFFFF, uint8_t overrideData=0xFF) {
// Check if RAM buffer has something to be written
bool isEmpty = true;
@@ -908,11 +922,9 @@ static void ee_Init() {
// If all groups seem to be used, default to first group
if (curGroup >= GroupCount) curGroup = 0;
- #ifdef EE_EMU_DEBUG
- SERIAL_ECHO_START();
- SERIAL_ECHOLNPAIR("EEPROM Current Group: ",curGroup);
- SERIAL_FLUSH();
- #endif
+ DEBUG_ECHO_START();
+ DEBUG_ECHOLNPAIR("EEPROM Current Group: ",curGroup);
+ DEBUG_FLUSH();
// Now, validate that all the other group pages are empty
for (int grp = 0; grp < GroupCount; grp++) {
@@ -920,11 +932,9 @@ static void ee_Init() {
for (int page = 0; page < PagesPerGroup; page++) {
if (!ee_IsPageClean(grp * PagesPerGroup + page)) {
- #ifdef EE_EMU_DEBUG
- SERIAL_ECHO_START();
- SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on group ", grp);
- SERIAL_FLUSH();
- #endif
+ DEBUG_ECHO_START();
+ DEBUG_ECHOLNPAIR("EEPROM Page ", page, " not clean on group ", grp);
+ DEBUG_FLUSH();
ee_PageErase(grp * PagesPerGroup + page);
}
}
@@ -934,66 +944,69 @@ static void ee_Init() {
// and also validate that all the other ones are clean
for (curPage = 0; curPage < PagesPerGroup; curPage++) {
if (ee_IsPageClean(curGroup * PagesPerGroup + curPage)) {
- #ifdef EE_EMU_DEBUG
- ee_Dump(curGroup * PagesPerGroup + curPage, getFlashStorage(curGroup * PagesPerGroup + curPage));
- #endif
+ ee_Dump(curGroup * PagesPerGroup + curPage, getFlashStorage(curGroup * PagesPerGroup + curPage));
break;
}
}
- #ifdef EE_EMU_DEBUG
- SERIAL_ECHO_START();
- SERIAL_ECHOLNPAIR("EEPROM Active page: ", curPage);
- SERIAL_FLUSH();
- #endif
+ DEBUG_ECHO_START();
+ DEBUG_ECHOLNPAIR("EEPROM Active page: ", curPage);
+ DEBUG_FLUSH();
// Make sure the pages following the first clean one are also clean
for (int page = curPage + 1; page < PagesPerGroup; page++) {
if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) {
- #ifdef EE_EMU_DEBUG
- SERIAL_ECHO_START();
- SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on active group ", curGroup);
- SERIAL_FLUSH();
- ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page));
- #endif
+ DEBUG_ECHO_START();
+ DEBUG_ECHOLNPAIR("EEPROM Page ", page, " not clean on active group ", curGroup);
+ DEBUG_FLUSH();
+ ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page));
ee_PageErase(curGroup * PagesPerGroup + page);
}
}
}
-uint8_t eeprom_read_byte(uint8_t* addr) {
- ee_Init();
- return ee_Read((uint32_t)addr);
-}
-
-void eeprom_write_byte(uint8_t* addr, uint8_t value) {
- ee_Init();
- ee_Write((uint32_t)addr, value);
-}
+/* PersistentStore -----------------------------------------------------------*/
-void eeprom_update_block(const void* __src, void* __dst, size_t __n) {
- uint8_t* dst = (uint8_t*)__dst;
- const uint8_t* src = (const uint8_t*)__src;
- while (__n--) {
- eeprom_write_byte(dst, *src);
- ++dst;
- ++src;
- }
-}
+#include "../shared/eeprom_api.h"
-void eeprom_read_block(void* __dst, const void* __src, size_t __n) {
- uint8_t* dst = (uint8_t*)__dst;
- uint8_t* src = (uint8_t*)__src;
- while (__n--) {
- *dst = eeprom_read_byte(src);
- ++dst;
- ++src;
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE 0x1000 // 4KB
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+bool PersistentStore::access_start() { ee_Init(); return true; }
+bool PersistentStore::access_finish() { ee_Flush(); return true; }
+
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
+ while (size--) {
+ uint8_t * const p = (uint8_t * const)pos;
+ uint8_t v = *value;
+ // EEPROM has only ~100,000 write cycles,
+ // so only write bytes that have changed!
+ if (v != ee_Read(uint32_t(p))) {
+ ee_Write(uint32_t(p), v);
+ delay(2);
+ if (ee_Read(uint32_t(p)) != v) {
+ SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
+ return true;
+ }
+ }
+ crc16(crc, &v, 1);
+ pos++;
+ value++;
}
+ return false;
}
-void eeprom_flush() {
- ee_Flush();
+bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
+ do {
+ uint8_t c = ee_Read(uint32_t(pos));
+ if (writing) *value = c;
+ crc16(crc, &c, 1);
+ pos++;
+ value++;
+ } while (--size);
+ return false;
}
-#endif // EEPROM_SETTINGS && (!I2C_EEPROM && !SPI_EEPROM)
-#endif // ARDUINO_ARCH_AVR
+#endif // FLASH_EEPROM_EMULATION
+#endif // ARDUINO_ARCH_SAM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/eeprom_wired.cpp
similarity index 70%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/eeprom_wired.cpp
index fc1baa22..4599d6a7 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/eeprom_wired.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
@@ -17,32 +17,29 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#ifdef ARDUINO_ARCH_SAM
-#include "../../inc/MarlinConfigPre.h"
-
-#if ENABLED(EEPROM_SETTINGS)
-
#include "../../inc/MarlinConfig.h"
-#include "../shared/persistent_store_api.h"
-#if !defined(E2END) && NONE(I2C_EEPROM, SPI_EEPROM)
- #define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp)
-#endif
+#if USE_WIRED_EEPROM
-extern void eeprom_flush();
+/**
+ * PersistentStore for Arduino-style EEPROM interface
+ * with simple implementations supplied by Marlin.
+ */
-bool PersistentStore::access_start() { return true; }
+#include "../shared/eeprom_if.h"
+#include "../shared/eeprom_api.h"
-bool PersistentStore::access_finish() {
- #if NONE(I2C_EEPROM, SPI_EEPROM)
- eeprom_flush();
- #endif
- return true;
-}
+#ifndef MARLIN_EEPROM_SIZE
+ #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM."
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+bool PersistentStore::access_start() { eeprom_init(); return true; }
+bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) {
@@ -54,14 +51,14 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
eeprom_write_byte(p, v);
delay(2);
if (eeprom_read_byte(p) != v) {
- SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
+ SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
return true;
}
}
crc16(crc, &v, 1);
pos++;
value++;
- };
+ }
return false;
}
@@ -76,7 +73,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false;
}
-size_t PersistentStore::capacity() { return E2END + 1; }
-
-#endif // EEPROM_SETTINGS
+#endif // USE_WIRED_EEPROM
#endif // ARDUINO_ARCH_SAM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/endstop_interrupts.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/endstop_interrupts.h
similarity index 66%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/endstop_interrupts.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/endstop_interrupts.h
index daa2b3c1..999ada51 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/endstop_interrupts.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/endstop_interrupts.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -47,37 +47,21 @@ void endstop_ISR() { endstops.update(); }
void setup_endstop_interrupts() {
#define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
- #if HAS_X_MAX
- _ATTACH(X_MAX_PIN);
- #endif
- #if HAS_X_MIN
- _ATTACH(X_MIN_PIN);
- #endif
- #if HAS_Y_MAX
- _ATTACH(Y_MAX_PIN);
- #endif
- #if HAS_Y_MIN
- _ATTACH(Y_MIN_PIN);
- #endif
- #if HAS_Z_MAX
- _ATTACH(Z_MAX_PIN);
- #endif
- #if HAS_Z_MIN
- _ATTACH(Z_MIN_PIN);
- #endif
- #if HAS_Z2_MAX
- _ATTACH(Z2_MAX_PIN);
- #endif
- #if HAS_Z2_MIN
- _ATTACH(Z2_MIN_PIN);
- #endif
- #if HAS_Z3_MAX
- _ATTACH(Z3_MAX_PIN);
- #endif
- #if HAS_Z3_MIN
- _ATTACH(Z3_MIN_PIN);
- #endif
- #if HAS_Z_MIN_PROBE_PIN
- _ATTACH(Z_MIN_PROBE_PIN);
- #endif
+ TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN));
+ TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN));
+ TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN));
+ TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN));
+ TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN));
+ TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN));
+ TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN));
+ TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN));
+ TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN));
+ TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN));
+ TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN));
+ TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN));
+ TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN));
+ TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN));
+ TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
+ TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
+ TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/fastio.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/fastio.h
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/fastio.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/fastio.h
index a97a944e..28631930 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/fastio.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/fastio.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -58,7 +58,7 @@
*
* Now you can simply SET_OUTPUT(STEP); WRITE(STEP, HIGH); WRITE(STEP, LOW);
*
- * Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
+ * Why double up on these macros? see https://gcc.gnu.org/onlinedocs/cpp/Stringification.html
*/
// Read a pin
@@ -166,7 +166,7 @@
// Set pin as output (wrapper) - reads the pin and sets the output to that value
#define SET_OUTPUT(IO) _SET_OUTPUT(IO)
// Set pin as PWM
-#define SET_PWM(IO) SET_OUTPUT(IO)
+#define SET_PWM SET_OUTPUT
// Check if pin is an input
#define IS_INPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) == 0)
@@ -174,7 +174,7 @@
#define IS_OUTPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) != 0)
// Shorthand
-#define OUT_WRITE(IO,V) { SET_OUTPUT(IO); WRITE(IO,V); }
+#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
// digitalRead/Write wrappers
#define extDigitalRead(IO) digitalRead(IO)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp
new file mode 100644
index 00000000..1682faea
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp
@@ -0,0 +1,206 @@
+/**
+ * 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 .
+ *
+ */
+
+/**
+ * The PWM module is only used to generate interrupts at specified times. It
+ * is NOT used to directly toggle pins. The ISR writes to the pin assigned to
+ * that interrupt.
+ *
+ * All PWMs use the same repetition rate. The G2 needs about 10KHz min in order to
+ * not have obvious ripple on the Vref signals.
+ *
+ * The data structures are setup to minimize the computation done by the ISR which
+ * minimizes ISR execution time. Execution times are 0.8 to 1.1 microseconds.
+ *
+ * FIve PWM interrupt sources are used. Channel 0 sets the base period. All Vref
+ * signals are set active when this counter overflows and resets to zero. The compare
+ * values in channels 1-4 are set to give the desired duty cycle for that Vref pin.
+ * When counter 0 matches the compare value then that channel generates an interrupt.
+ * The ISR checks the source of the interrupt and sets the corresponding pin inactive.
+ *
+ * Some jitter in the Vref signal is OK so the interrupt priority is left at its default value.
+ */
+
+#include "../../../inc/MarlinConfig.h"
+
+#if MB(PRINTRBOARD_G2)
+
+#include "G2_PWM.h"
+
+#if PIN_EXISTS(MOTOR_CURRENT_PWM_X)
+ #define G2_PWM_X 1
+#else
+ #define G2_PWM_X 0
+#endif
+#if PIN_EXISTS(MOTOR_CURRENT_PWM_Y)
+ #define G2_PWM_Y 1
+#else
+ #define G2_PWM_Y 0
+#endif
+#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
+ #define G2_PWM_Z 1
+#else
+ #define G2_PWM_Z 0
+#endif
+#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
+ #define G2_PWM_E 1
+#else
+ #define G2_PWM_E 0
+#endif
+#define G2_MASK_X(V) (G2_PWM_X * (V))
+#define G2_MASK_Y(V) (G2_PWM_Y * (V))
+#define G2_MASK_Z(V) (G2_PWM_Z * (V))
+#define G2_MASK_E(V) (G2_PWM_E * (V))
+
+volatile uint32_t *SODR_A = &PIOA->PIO_SODR,
+ *SODR_B = &PIOB->PIO_SODR,
+ *CODR_A = &PIOA->PIO_CODR,
+ *CODR_B = &PIOB->PIO_CODR;
+
+PWM_map ISR_table[NUM_PWMS] = PWM_MAP_INIT;
+
+void Stepper::digipot_init() {
+
+ #if PIN_EXISTS(MOTOR_CURRENT_PWM_X)
+ OUT_WRITE(MOTOR_CURRENT_PWM_X_PIN, 0); // init pins
+ #endif
+ #if PIN_EXISTS(MOTOR_CURRENT_PWM_Y)
+ OUT_WRITE(MOTOR_CURRENT_PWM_Y_PIN, 0);
+ #endif
+ #if G2_PWM_Z
+ OUT_WRITE(MOTOR_CURRENT_PWM_Z_PIN, 0);
+ #endif
+ #if G2_PWM_E
+ OUT_WRITE(MOTOR_CURRENT_PWM_E_PIN, 0);
+ #endif
+
+ #define WPKEY (0x50574D << 8) // “PWM” in ASCII
+ #define WPCMD_DIS_SW 0 // command to disable Write Protect SW
+ #define WPRG_ALL (PWM_WPCR_WPRG0 | PWM_WPCR_WPRG1 | PWM_WPCR_WPRG2 | PWM_WPCR_WPRG3 | PWM_WPCR_WPRG4 | PWM_WPCR_WPRG5) // all Write Protect Groups
+
+ #define PWM_CLOCK_F F_CPU / 1000000UL // set clock to 1MHz
+
+ PMC->PMC_PCER1 = PMC_PCER1_PID36; // enable PWM controller clock (disabled on power up)
+
+ PWM->PWM_WPCR = WPKEY | WPRG_ALL | WPCMD_DIS_SW; // enable setting of all PWM registers
+ PWM->PWM_CLK = PWM_CLOCK_F; // enable CLK_A and set it to 1MHz, leave CLK_B disabled
+ PWM->PWM_CH_NUM[0].PWM_CMR = 0b1011; // set channel 0 to Clock A input & to left aligned
+ if (G2_PWM_X) PWM->PWM_CH_NUM[1].PWM_CMR = 0b1011; // set channel 1 to Clock A input & to left aligned
+ if (G2_PWM_Y) PWM->PWM_CH_NUM[2].PWM_CMR = 0b1011; // set channel 2 to Clock A input & to left aligned
+ if (G2_PWM_Z) PWM->PWM_CH_NUM[3].PWM_CMR = 0b1011; // set channel 3 to Clock A input & to left aligned
+ if (G2_PWM_E) PWM->PWM_CH_NUM[4].PWM_CMR = 0b1011; // set channel 4 to Clock A input & to left aligned
+
+ PWM->PWM_CH_NUM[0].PWM_CPRD = PWM_PERIOD_US; // set channel 0 Period
+
+ PWM->PWM_IER2 = PWM_IER1_CHID0; // generate interrupt when counter0 overflows
+ PWM->PWM_IER2 = PWM_IER2_CMPM0
+ | G2_MASK_X(PWM_IER2_CMPM1)
+ | G2_MASK_Y(PWM_IER2_CMPM2)
+ | G2_MASK_Z(PWM_IER2_CMPM3)
+ | G2_MASK_E(PWM_IER2_CMPM4)
+ ; // generate interrupt on compare event
+
+ if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 1 PWM inactive
+ if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 2 PWM inactive
+ if (G2_PWM_Z) PWM->PWM_CMP[3].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[1])); // interrupt when counter0 == CMPV - used to set Motor 3 PWM inactive
+ if (G2_PWM_E) PWM->PWM_CMP[4].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[2])); // interrupt when counter0 == CMPV - used to set Motor 4 PWM inactive
+
+ if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPM = 0x0001; // enable compare event
+ if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPM = 0x0001; // enable compare event
+ if (G2_PWM_Z) PWM->PWM_CMP[3].PWM_CMPM = 0x0001; // enable compare event
+ if (G2_PWM_E) PWM->PWM_CMP[4].PWM_CMPM = 0x0001; // enable compare event
+
+ PWM->PWM_SCM = PWM_SCM_UPDM_MODE0 | PWM_SCM_SYNC0
+ | G2_MASK_X(PWM_SCM_SYNC1)
+ | G2_MASK_Y(PWM_SCM_SYNC2)
+ | G2_MASK_Z(PWM_SCM_SYNC3)
+ | G2_MASK_E(PWM_SCM_SYNC4)
+ ; // sync 1-4 with 0, use mode 0 for updates
+
+ PWM->PWM_ENA = PWM_ENA_CHID0
+ | G2_MASK_X(PWM_ENA_CHID1)
+ | G2_MASK_Y(PWM_ENA_CHID2)
+ | G2_MASK_Z(PWM_ENA_CHID3)
+ | G2_MASK_E(PWM_ENA_CHID4)
+ ; // enable channels used by G2
+
+ PWM->PWM_IER1 = PWM_IER1_CHID0
+ | G2_MASK_X(PWM_IER1_CHID1)
+ | G2_MASK_Y(PWM_IER1_CHID2)
+ | G2_MASK_Z(PWM_IER1_CHID3)
+ | G2_MASK_E(PWM_IER1_CHID4)
+ ; // enable interrupts for channels used by G2
+
+ NVIC_EnableIRQ(PWM_IRQn); // Enable interrupt handler
+ NVIC_SetPriority(PWM_IRQn, NVIC_EncodePriority(0, 10, 0)); // normal priority for PWM module (can stand some jitter on the Vref signals)
+}
+
+void Stepper::digipot_current(const uint8_t driver, const int16_t current) {
+
+ if (!(PWM->PWM_CH_NUM[0].PWM_CPRD == PWM_PERIOD_US)) digipot_init(); // Init PWM system if needed
+
+ switch (driver) {
+ case 0:
+ if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update X & Y
+ if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current));
+ if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPMUPD = 0x0001; // enable compare event
+ if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPMUPD = 0x0001; // enable compare event
+ if (G2_PWM_X || G2_PWM_Y) PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
+ break;
+ case 1:
+ if (G2_PWM_Z) {
+ PWM->PWM_CMP[3].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update Z
+ PWM->PWM_CMP[3].PWM_CMPMUPD = 0x0001; // enable compare event
+ PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
+ }
+ break;
+ default:
+ if (G2_PWM_E) {
+ PWM->PWM_CMP[4].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update E
+ PWM->PWM_CMP[4].PWM_CMPMUPD = 0x0001; // enable compare event
+ PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
+ }
+ break;
+ }
+}
+
+volatile uint32_t PWM_ISR1_STATUS, PWM_ISR2_STATUS;
+
+void PWM_Handler() {
+ PWM_ISR1_STATUS = PWM->PWM_ISR1;
+ PWM_ISR2_STATUS = PWM->PWM_ISR2;
+ if (PWM_ISR1_STATUS & PWM_IER1_CHID0) { // CHAN_0 interrupt
+ if (G2_PWM_X) *ISR_table[0].set_register = ISR_table[0].write_mask; // set X to active
+ if (G2_PWM_Y) *ISR_table[1].set_register = ISR_table[1].write_mask; // set Y to active
+ if (G2_PWM_Z) *ISR_table[2].set_register = ISR_table[2].write_mask; // set Z to active
+ if (G2_PWM_E) *ISR_table[3].set_register = ISR_table[3].write_mask; // set E to active
+ }
+ else {
+ if (G2_PWM_X && (PWM_ISR2_STATUS & PWM_IER2_CMPM1)) *ISR_table[0].clr_register = ISR_table[0].write_mask; // set X to inactive
+ if (G2_PWM_Y && (PWM_ISR2_STATUS & PWM_IER2_CMPM2)) *ISR_table[1].clr_register = ISR_table[1].write_mask; // set Y to inactive
+ if (G2_PWM_Z && (PWM_ISR2_STATUS & PWM_IER2_CMPM3)) *ISR_table[2].clr_register = ISR_table[2].write_mask; // set Z to inactive
+ if (G2_PWM_E && (PWM_ISR2_STATUS & PWM_IER2_CMPM4)) *ISR_table[3].clr_register = ISR_table[3].write_mask; // set E to inactive
+ }
+ return;
+}
+
+#endif // PRINTRBOARD_G2
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/fastio/G2_PWM.h
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/fastio/G2_PWM.h
index 4a84dfe6..dc4edfff 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/fastio/G2_PWM.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -63,7 +63,7 @@ extern PWM_map ISR_table[NUM_PWMS];
extern uint32_t motor_current_setting[3];
#define IR_BIT(p) (WITHIN(p, 0, 3) ? (p) : (p) + 4)
-#define COPY_ACTIVE_TABLE() do{ for (uint8_t i = 0; i < 6 ; i++) work_table[i] = active_table[i]; }while(0)
+#define COPY_ACTIVE_TABLE() do{ LOOP_L_N(i, 6) work_table[i] = active_table[i]; }while(0)
#define PWM_MR0 19999 // base repetition rate minus one count - 20mS
#define PWM_PR 24 // prescaler value - prescaler divide by 24 + 1 - 1 MHz output
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/fastio/G2_pins.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/fastio/G2_pins.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/fastio/G2_pins.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/fastio/G2_pins.h
index e5ce834f..80c87bd3 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/fastio/G2_pins.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/fastio/G2_pins.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/inc/Conditionals_LCD.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_LCD.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/inc/Conditionals_LCD.h
index 85f26f40..5f1c4b16 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_LCD.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/inc/Conditionals_LCD.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/inc/Conditionals_adv.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/inc/Conditionals_adv.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/inc/Conditionals_adv.h
index 85f26f40..5f1c4b16 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/inc/Conditionals_adv.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/inc/Conditionals_adv.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/inc/Conditionals_post.h
new file mode 100644
index 00000000..ce6d3fdd
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/inc/Conditionals_post.h
@@ -0,0 +1,28 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#if USE_FALLBACK_EEPROM
+ #define FLASH_EEPROM_EMULATION
+#elif EITHER(I2C_EEPROM, SPI_EEPROM)
+ #define USE_SHARED_EEPROM 1
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/inc/SanityCheck.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/inc/SanityCheck.h
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/inc/SanityCheck.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/inc/SanityCheck.h
index a8d51edf..cdea3443 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/inc/SanityCheck.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/inc/SanityCheck.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -55,3 +55,7 @@
#if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform."
#endif
+
+#if HAS_TMC_SW_SERIAL
+ #error "TMC220x Software Serial is not supported on this platform."
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/pinsDebug.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/pinsDebug.h
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/pinsDebug.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/pinsDebug.h
index ed78f8ad..28687ff2 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/pinsDebug.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/pinsDebug.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/spi_pins.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/spi_pins.h
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/spi_pins.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/spi_pins.h
index 64ee17a9..e28eaf82 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/spi_pins.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/spi_pins.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/timers.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/timers.cpp
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/timers.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/timers.cpp
index 6925f934..795cdad6 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/timers.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/timers.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
*
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -34,8 +34,6 @@
#include "../../inc/MarlinConfig.h"
#include "HAL.h"
-#include "timers.h"
-
// ------------------------
// Local defines
// ------------------------
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/timers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/timers.h
similarity index 85%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/timers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/timers.h
index b7b2cf73..9defe39a 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/timers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/timers.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -40,11 +40,17 @@ typedef uint32_t hal_timer_t;
#define HAL_TIMER_RATE ((F_CPU) / 2) // frequency of timers peripherals
#ifndef STEP_TIMER_NUM
-#define STEP_TIMER_NUM 2 // index of timer to use for stepper
+ #define STEP_TIMER_NUM 2 // Timer Index for Stepper
+#endif
+#ifndef PULSE_TIMER_NUM
+ #define PULSE_TIMER_NUM STEP_TIMER_NUM
+#endif
+#ifndef TEMP_TIMER_NUM
+ #define TEMP_TIMER_NUM 4 // Timer Index for Temperature
+#endif
+#ifndef TONE_TIMER_NUM
+ #define TONE_TIMER_NUM 6 // index of timer to use for beeper tones
#endif
-#define TEMP_TIMER_NUM 4 // index of timer to use for temperature
-#define PULSE_TIMER_NUM STEP_TIMER_NUM
-#define TONE_TIMER_NUM 6 // index of timer to use for beeper tones
#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
@@ -66,8 +72,12 @@ typedef uint32_t hal_timer_t;
#ifndef HAL_STEP_TIMER_ISR
#define HAL_STEP_TIMER_ISR() void TC2_Handler()
#endif
-#define HAL_TEMP_TIMER_ISR() void TC4_Handler()
-#define HAL_TONE_TIMER_ISR() void TC6_Handler()
+#ifndef HAL_TEMP_TIMER_ISR
+ #define HAL_TEMP_TIMER_ISR() void TC4_Handler()
+#endif
+#ifndef HAL_TONE_TIMER_ISR
+ #define HAL_TONE_TIMER_ISR() void TC6_Handler()
+#endif
// ------------------------
// Types
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/upload_extra_script.py b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/upload_extra_script.py
new file mode 100644
index 00000000..06c2b914
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/upload_extra_script.py
@@ -0,0 +1,18 @@
+#
+# Set upload_command
+#
+# Windows: bossac.exe
+# Other: leave unchanged
+#
+
+import platform
+current_OS = platform.system()
+
+if current_OS == 'Windows':
+
+ Import("env")
+
+ # Use bossac.exe on Windows
+ env.Replace(
+ UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot"
+ )
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/arduino_due_x.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/arduino_due_x.h
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/arduino_due_x.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/arduino_due_x.h
index 7355f74f..b5be6217 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/arduino_due_x.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/arduino_due_x.h
@@ -43,7 +43,7 @@
#pragma once
/**
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
/**
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/compiler.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/compiler.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/compiler.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/compiler.h
index 33df080e..7b746543 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/compiler.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/compiler.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef UTILS_COMPILER_H
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/conf_access.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/conf_access.h
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/conf_access.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/conf_access.h
index fdac1ab7..f4016852 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/conf_access.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/conf_access.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _CONF_ACCESS_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/conf_clock.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/conf_clock.h
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/conf_clock.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/conf_clock.h
index d0f68500..97e70e99 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/conf_clock.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/conf_clock.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef CONF_CLOCK_H_INCLUDED
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/conf_usb.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/conf_usb.h
index 8d5924d3..4de9e347 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/conf_usb.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _CONF_USB_H_
@@ -78,10 +78,6 @@
//! To define a Full speed device
//#define USB_DEVICE_FULL_SPEED
-#if MB(ARCHIM1)
- #define USB_DEVICE_FULL_SPEED
-#endif
-
//! To authorize the High speed
#ifndef USB_DEVICE_FULL_SPEED
#if (UC3A3||UC3A4)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/ctrl_access.c b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/ctrl_access.c
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/ctrl_access.c
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/ctrl_access.c
index 0ec14e0b..99f97f62 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/ctrl_access.c
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/ctrl_access.c
@@ -53,7 +53,7 @@
*
******************************************************************************/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifdef ARDUINO_ARCH_SAM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/ctrl_access.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/ctrl_access.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/ctrl_access.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/ctrl_access.h
index af6c8ceb..b3383907 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/ctrl_access.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/ctrl_access.h
@@ -53,7 +53,7 @@
*
******************************************************************************/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/genclk.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/genclk.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/genclk.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/genclk.h
index 895aba03..cde03bc0 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/genclk.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/genclk.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef CHIP_GENCLK_H_INCLUDED
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/mrepeat.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/mrepeat.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/mrepeat.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/mrepeat.h
index 5a2017be..8363d9cd 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/mrepeat.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/mrepeat.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _MREPEAT_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/osc.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/osc.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/osc.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/osc.h
index 3a954350..953bcbbe 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/osc.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/osc.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef CHIP_OSC_H_INCLUDED
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/pll.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/pll.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/pll.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/pll.h
index d3d21748..8eaf2767 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/pll.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/pll.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef CHIP_PLL_H_INCLUDED
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/preprocessor.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/preprocessor.h
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/preprocessor.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/preprocessor.h
index 184c03ae..c12d01cb 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/preprocessor.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/preprocessor.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _PREPROCESSOR_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/sbc_protocol.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/sbc_protocol.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/sbc_protocol.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/sbc_protocol.h
index 082b735f..ab845739 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/sbc_protocol.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/sbc_protocol.h
@@ -52,7 +52,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _SBC_PROTOCOL_H_
#define _SBC_PROTOCOL_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp
similarity index 100%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h
index 6df82c14..d77e4f95 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h
@@ -42,7 +42,7 @@
*
******************************************************************************/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/spc_protocol.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/spc_protocol.h
index 6fadb9f3..d67cc5c7 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/spc_protocol.h
@@ -45,7 +45,7 @@
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _SPC_PROTOCOL_H_
#define _SPC_PROTOCOL_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/stringz.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/stringz.h
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/stringz.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/stringz.h
index b914b734..fc9aaf38 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/stringz.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/stringz.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _STRINGZ_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/sysclk.c b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/sysclk.c
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/sysclk.c
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/sysclk.c
index 899244dd..cbb4e2c9 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/sysclk.c
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/sysclk.c
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifdef ARDUINO_ARCH_SAM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/sysclk.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/sysclk.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/sysclk.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/sysclk.h
index 48c99de2..16db8c86 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/sysclk.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/sysclk.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef CHIP_SYSCLK_H_INCLUDED
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/tpaste.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/tpaste.h
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/tpaste.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/tpaste.h
index f8ec44a4..2ad3f275 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/tpaste.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/tpaste.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _TPASTE_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udc.c b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udc.c
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udc.c
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udc.c
index 048a902d..60bf0cff 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udc.c
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udc.c
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifdef ARDUINO_ARCH_SAM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udc.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udc.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udc.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udc.h
index 885bdf04..8d92eb5c 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udc.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udc.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _UDC_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udc_desc.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udc_desc.h
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udc_desc.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udc_desc.h
index 88ed08a9..052ca08e 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udc_desc.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udc_desc.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _UDC_DESC_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udd.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udd.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udd.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udd.h
index c87763de..7ec8c03d 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udd.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udd.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _UDD_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi.h
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi.h
index 709908ca..febf03b7 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _UDI_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.c b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_cdc.c
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.c
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_cdc.c
index 60c9546c..cbe23dbb 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.c
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_cdc.c
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifdef ARDUINO_ARCH_SAM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_cdc.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_cdc.h
index 526419c8..0ecf7bb0 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_cdc.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _UDI_CDC_H_
@@ -701,7 +701,7 @@ iram_size_t udi_cdc_multi_write_buf(uint8_t port, const void* buf, iram_size_t s
* another "Composite Device" module, like "USB HID Mouse (Composite Device)".
*
* Also, you can refer to application note
- *
+ *
* AVR4902 ASF - USB Composite Device.
*
* \section udi_cdc_use_case_composite_setup Setup steps
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_cdc_conf.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_cdc_conf.h
index cbd3eb00..d406a877 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_cdc_conf.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _UDI_CDC_CONF_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_desc.c b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_desc.c
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c
index 8f730ba8..97c334e2 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_desc.c
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifdef ARDUINO_ARCH_SAM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_composite_desc.c b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_composite_desc.c
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_composite_desc.c
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_composite_desc.c
index 07bdd1b9..da74fbe6 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_composite_desc.c
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_composite_desc.c
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifdef ARDUINO_ARCH_SAM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_msc.c b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_msc.c
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_msc.c
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_msc.c
index 627bca0d..b7c3bb5e 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_msc.c
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_msc.c
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifdef ARDUINO_ARCH_SAM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_msc.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_msc.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_msc.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_msc.h
index c632ee4a..730dbc8e 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/udi_msc.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/udi_msc.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _UDI_MSC_H_
@@ -290,7 +290,7 @@ bool udi_msc_trans_block(bool b_read, uint8_t * block, iram_size_t block_size,
* another "Composite Device" module, like "USB HID Mouse (Composite Device)".
*
* Also, you can refer to application note
- *
+ *
* AVR4902 ASF - USB Composite Device.
*
* \section udi_msc_use_case_composite_setup Setup steps
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/uotghs_device_due.c
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/uotghs_device_due.c
index 9bac2927..e13232a3 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/uotghs_device_due.c
@@ -42,7 +42,7 @@
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifdef ARDUINO_ARCH_SAM
@@ -1479,7 +1479,7 @@ static void udd_ctrl_in_sent(void)
// The IN data don't must be written in endpoint 0 DPRAM during
// a next setup reception in same endpoint 0 DPRAM.
// Thereby, an OUT ZLP reception must check before IN data write
- // and if no OUT ZLP is recevied the data must be written quickly (800us)
+ // and if no OUT ZLP is received the data must be written quickly (800µs)
// before an eventually ZLP OUT and SETUP reception
flags = cpu_irq_save();
if (Is_udd_out_received(0)) {
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/uotghs_device_due.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/uotghs_device_due.h
index 97877994..6df26d63 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/uotghs_device_due.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef UOTGHS_DEVICE_DUE_H_INCLUDED
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/uotghs_otg.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/uotghs_otg.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/uotghs_otg.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/uotghs_otg.h
index 86c903b2..eca5e938 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/uotghs_otg.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/uotghs_otg.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef UOTGHS_OTG_H_INCLUDED
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/usb_protocol.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/usb_protocol.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/usb_protocol.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/usb_protocol.h
index 31c783f9..ea51a868 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/usb_protocol.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/usb_protocol.h
@@ -44,7 +44,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _USB_PROTOCOL_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/usb_protocol_cdc.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/usb_protocol_cdc.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h
index 49fc7387..d594db52 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/usb_protocol_cdc.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _USB_PROTOCOL_CDC_H_
#define _USB_PROTOCOL_CDC_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/usb_protocol_msc.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/usb_protocol_msc.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/usb_protocol_msc.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/usb_protocol_msc.h
index db8f9caf..0fef3080 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/usb_protocol_msc.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/usb_protocol_msc.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _USB_PROTOCOL_MSC_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/usb_task.c b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/usb_task.c
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/usb_task.c
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/usb_task.c
index 29d02fae..66bdb265 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/usb_task.c
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/usb_task.c
@@ -41,7 +41,7 @@
*
*/
-// Support and FAQ: visit Atmel Support
+// Support and FAQ: visit Atmel Support
#ifdef ARDUINO_ARCH_SAM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/usb_task.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/usb_task.h
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/usb_task.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/usb_task.h
index fad62fda..e9831ae0 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/usb/usb_task.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/usb/usb_task.h
@@ -41,7 +41,7 @@
*
*/
/*
- * Support and FAQ: visit Atmel Support
+ * Support and FAQ: visit Atmel Support
*/
#ifndef _USB_TASK_H_
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/watchdog.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/watchdog.cpp
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/watchdog.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/watchdog.cpp
index 1f51b75c..0f469718 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/watchdog.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/watchdog.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,14 +16,13 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef ARDUINO_ARCH_SAM
#include "../../inc/MarlinConfig.h"
-#include "../../Marlin.h"
+#include "../../MarlinCore.h"
#include "watchdog.h"
// Override Arduino runtime to either config or disable the watchdog
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/watchdog.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/watchdog.h
similarity index 88%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/watchdog.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/watchdog.h
index 6e70adef..5725a100 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/watchdog.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/DUE/watchdog.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/FlushableHardwareSerial.cpp
similarity index 87%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/FlushableHardwareSerial.cpp
index 544b1b3f..d4b2f42c 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/FlushableHardwareSerial.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/FlushableHardwareSerial.h
similarity index 88%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/FlushableHardwareSerial.h
index 9fca4fcb..b43caea1 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/FlushableHardwareSerial.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/HAL.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/HAL.cpp
similarity index 67%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/HAL.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/HAL.cpp
index c3e6f096..1e00df51 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/HAL.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/HAL.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,23 +16,17 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef ARDUINO_ARCH_ESP32
-#include "HAL.h"
-#include "timers.h"
+#include "../../inc/MarlinConfig.h"
+
#include
#include
#include
-
-#include "../../inc/MarlinConfigPre.h"
-
-#if ENABLED(WEBSUPPORT)
- #include "spiffs.h"
-#endif
+#include
#if ENABLED(WIFISUPPORT)
#include
@@ -41,6 +35,7 @@
#include "ota.h"
#endif
#if ENABLED(WEBSUPPORT)
+ #include "spiffs.h"
#include "web.h"
#endif
#endif
@@ -78,31 +73,62 @@ volatile int numPWMUsed = 0,
// Public functions
// ------------------------
-void HAL_init() {
- i2s_init();
-}
+#if ENABLED(WIFI_CUSTOM_COMMAND)
+
+ bool wifi_custom_command(char * const command_ptr) {
+ #if ENABLED(ESP3D_WIFISUPPORT)
+ return esp3dlib.parse(command_ptr);
+ #else
+ UNUSED(command_ptr);
+ return false;
+ #endif
+ }
+
+#endif
+
+void HAL_init() { i2s_init(); }
void HAL_init_board() {
- #if ENABLED(WEBSUPPORT)
- spiffs_init();
- #endif
- #if ENABLED(WIFISUPPORT)
+ #if ENABLED(ESP3D_WIFISUPPORT)
+ esp3dlib.init();
+ #elif ENABLED(WIFISUPPORT)
wifi_init();
- #if ENABLED(OTASUPPORT)
- OTA_init();
- #endif
+ TERN_(OTASUPPORT, OTA_init());
#if ENABLED(WEBSUPPORT)
+ spiffs_init();
web_init();
#endif
server.begin();
#endif
+
+ // ESP32 uses a GPIO matrix that allows pins to be assigned to hardware serial ports.
+ // The following code initializes hardware Serial1 and Serial2 to use user-defined pins
+ // if they have been defined.
+ #if defined(HARDWARE_SERIAL1_RX) && defined(HARDWARE_SERIAL1_TX)
+ HardwareSerial Serial1(1);
+ #ifdef TMC_BAUD_RATE // use TMC_BAUD_RATE for Serial1 if defined
+ Serial1.begin(TMC_BAUD_RATE, SERIAL_8N1, HARDWARE_SERIAL1_RX, HARDWARE_SERIAL1_TX);
+ #else // use default BAUDRATE if TMC_BAUD_RATE not defined
+ Serial1.begin(BAUDRATE, SERIAL_8N1, HARDWARE_SERIAL1_RX, HARDWARE_SERIAL1_TX);
+ #endif
+ #endif
+ #if defined(HARDWARE_SERIAL2_RX) && defined(HARDWARE_SERIAL2_TX)
+ HardwareSerial Serial2(2);
+ #ifdef TMC_BAUD_RATE // use TMC_BAUD_RATE for Serial1 if defined
+ Serial2.begin(TMC_BAUD_RATE, SERIAL_8N1, HARDWARE_SERIAL2_RX, HARDWARE_SERIAL2_TX);
+ #else // use default BAUDRATE if TMC_BAUD_RATE not defined
+ Serial2.begin(BAUDRATE, SERIAL_8N1, HARDWARE_SERIAL2_RX, HARDWARE_SERIAL2_TX);
+ #endif
+ #endif
+
}
void HAL_idletask() {
- #if ENABLED(OTASUPPORT)
+ #if BOTH(WIFISUPPORT, OTASUPPORT)
OTA_handle();
#endif
+ TERN_(ESP3D_WIFISUPPORT, esp3dlib.idletask());
}
void HAL_clear_reset_source() { }
@@ -143,33 +169,17 @@ void HAL_adc_init() {
adc1_config_width(ADC_WIDTH_12Bit);
// Configure channels only if used as (re-)configuring a pin for ADC that is used elsewhere might have adverse effects
- #if HAS_TEMP_ADC_0
- adc1_set_attenuation(get_channel(TEMP_0_PIN), ADC_ATTEN_11db);
- #endif
- #if HAS_TEMP_ADC_1
- adc1_set_attenuation(get_channel(TEMP_1_PIN), ADC_ATTEN_11db);
- #endif
- #if HAS_TEMP_ADC_2
- adc1_set_attenuation(get_channel(TEMP_2_PIN), ADC_ATTEN_11db);
- #endif
- #if HAS_TEMP_ADC_3
- adc1_set_attenuation(get_channel(TEMP_3_PIN), ADC_ATTEN_11db);
- #endif
- #if HAS_TEMP_ADC_4
- adc1_set_attenuation(get_channel(TEMP_4_PIN), ADC_ATTEN_11db);
- #endif
- #if HAS_TEMP_ADC_5
- adc1_set_attenuation(get_channel(TEMP_5_PIN), ADC_ATTEN_11db);
- #endif
- #if HAS_HEATED_BED
- adc1_set_attenuation(get_channel(TEMP_BED_PIN), ADC_ATTEN_11db);
- #endif
- #if HAS_TEMP_CHAMBER
- adc1_set_attenuation(get_channel(TEMP_CHAMBER_PIN), ADC_ATTEN_11db);
- #endif
- #if ENABLED(FILAMENT_WIDTH_SENSOR)
- adc1_set_attenuation(get_channel(FILWIDTH_PIN), ADC_ATTEN_11db);
- #endif
+ TERN_(HAS_TEMP_ADC_0, adc1_set_attenuation(get_channel(TEMP_0_PIN), ADC_ATTEN_11db));
+ TERN_(HAS_TEMP_ADC_1, adc1_set_attenuation(get_channel(TEMP_1_PIN), ADC_ATTEN_11db));
+ TERN_(HAS_TEMP_ADC_2, adc1_set_attenuation(get_channel(TEMP_2_PIN), ADC_ATTEN_11db));
+ TERN_(HAS_TEMP_ADC_3, adc1_set_attenuation(get_channel(TEMP_3_PIN), ADC_ATTEN_11db));
+ TERN_(HAS_TEMP_ADC_4, adc1_set_attenuation(get_channel(TEMP_4_PIN), ADC_ATTEN_11db));
+ TERN_(HAS_TEMP_ADC_5, adc1_set_attenuation(get_channel(TEMP_5_PIN), ADC_ATTEN_11db));
+ TERN_(HAS_TEMP_ADC_6, adc2_set_attenuation(get_channel(TEMP_6_PIN), ADC_ATTEN_11db));
+ TERN_(HAS_TEMP_ADC_7, adc3_set_attenuation(get_channel(TEMP_7_PIN), ADC_ATTEN_11db));
+ TERN_(HAS_HEATED_BED, adc1_set_attenuation(get_channel(TEMP_BED_PIN), ADC_ATTEN_11db));
+ TERN_(HAS_TEMP_CHAMBER, adc1_set_attenuation(get_channel(TEMP_CHAMBER_PIN), ADC_ATTEN_11db));
+ TERN_(FILAMENT_WIDTH_SENSOR, adc1_set_attenuation(get_channel(FILWIDTH_PIN), ADC_ATTEN_11db));
// Note that adc2 is shared with the WiFi module, which has higher priority, so the conversion may fail.
// That's why we're not setting it up here.
@@ -183,7 +193,7 @@ void HAL_adc_init() {
}
}
-void HAL_adc_start_conversion(uint8_t adc_pin) {
+void HAL_adc_start_conversion(const uint8_t adc_pin) {
const adc1_channel_t chan = get_channel(adc_pin);
uint32_t mv;
esp_adc_cal_get_voltage((adc_channel_t)chan, &characteristics[attenuations[chan]], &mv);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/HAL.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/HAL.h
similarity index 53%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/HAL.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/HAL.h
index df9a5648..c91f9eff 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/HAL.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/HAL.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
*
* This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
* 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 .
+ * along with this program. If not, see .
*/
#pragma once
@@ -34,9 +34,14 @@
#include "watchdog.h"
#include "i2s.h"
-#include "timers.h"
+#if ENABLED(WIFISUPPORT)
+ #include "WebSocketSerial.h"
+#endif
+
+#if ENABLED(ESP3D_WIFISUPPORT)
+ #include "esp3dlib.h"
+#endif
-#include "WebSocketSerial.h"
#include "FlushableHardwareSerial.h"
// ------------------------
@@ -47,20 +52,23 @@ extern portMUX_TYPE spinlock;
#define MYSERIAL0 flushableSerial
-#if ENABLED(WIFISUPPORT)
+#if EITHER(WIFISUPPORT, ESP3D_WIFISUPPORT)
+ #if ENABLED(ESP3D_WIFISUPPORT)
+ #define MYSERIAL1 Serial2Socket
+ #else
+ #define MYSERIAL1 webSocketSerial
+ #endif
#define NUM_SERIAL 2
- #define MYSERIAL1 webSocketSerial
#else
#define NUM_SERIAL 1
#endif
-#define CRITICAL_SECTION_START portENTER_CRITICAL(&spinlock)
-#define CRITICAL_SECTION_END portEXIT_CRITICAL(&spinlock)
+#define CRITICAL_SECTION_START() portENTER_CRITICAL(&spinlock)
+#define CRITICAL_SECTION_END() portEXIT_CRITICAL(&spinlock)
#define ISRS_ENABLED() (spinlock.owner == portMUX_FREE_VAL)
#define ENABLE_ISRS() if (spinlock.owner != portMUX_FREE_VAL) portEXIT_CRITICAL(&spinlock)
#define DISABLE_ISRS() portENTER_CRITICAL(&spinlock)
-
// Fix bug in pgm_read_ptr
#undef pgm_read_ptr
#define pgm_read_ptr(addr) (*(addr))
@@ -99,23 +107,18 @@ int freeMemory();
void analogWrite(pin_t pin, int value);
-// EEPROM
-void eeprom_write_byte(uint8_t *pos, unsigned char value);
-uint8_t eeprom_read_byte(uint8_t *pos);
-void eeprom_read_block (void *__dst, const void *__src, size_t __n);
-void eeprom_update_block (const void *__src, void *__dst, size_t __n);
-
// ADC
#define HAL_ANALOG_SELECT(pin)
void HAL_adc_init();
-#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
+#define HAL_ADC_VREF 3.3
#define HAL_ADC_RESOLUTION 10
+#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
#define HAL_READ_ADC() HAL_adc_result
#define HAL_ADC_READY() true
-void HAL_adc_start_conversion(uint8_t adc_pin);
+void HAL_adc_start_conversion(const uint8_t adc_pin);
#define GET_PIN_MAP_PIN(index) index
#define GET_PIN_MAP_INDEX(pin) pin
@@ -127,3 +130,44 @@ void HAL_adc_start_conversion(uint8_t adc_pin);
void HAL_idletask();
void HAL_init();
void HAL_init_board();
+
+//
+// Delay in cycles (used by DELAY_NS / DELAY_US)
+//
+FORCE_INLINE static void DELAY_CYCLES(uint32_t x) {
+ unsigned long start, ccount, stop;
+
+ /**
+ * It's important to care for race conditions (and overflows) here.
+ * Race condition example: If `stop` calculates to being close to the upper boundary of
+ * `uint32_t` and if at the same time a longer loop interruption kicks in (e.g. due to other
+ * FreeRTOS tasks or interrupts), `ccount` might overflow (and therefore be below `stop` again)
+ * without the loop ever being able to notice that `ccount` had already been above `stop` once
+ * (and that therefore the number of cycles to delay has already passed).
+ * As DELAY_CYCLES (through DELAY_NS / DELAY_US) is used by software SPI bit banging to drive
+ * LCDs and therefore might be called very, very often, this seemingly improbable situation did
+ * actually happen in reality. It resulted in apparently random print pauses of ~17.9 seconds
+ * (0x100000000 / 240 MHz) or multiples thereof, essentially ruining the current print by causing
+ * large blobs of filament.
+ */
+
+ __asm__ __volatile__ ( "rsr %0, ccount" : "=a" (start) );
+ stop = start + x;
+ ccount = start;
+
+ if (stop >= start) {
+ // no overflow, so only loop while in between start and stop:
+ // 0x00000000 -----------------start****stop-- 0xffffffff
+ while (ccount >= start && ccount < stop) {
+ __asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) );
+ }
+ }
+ else {
+ // stop did overflow, so only loop while outside of stop and start:
+ // 0x00000000 **stop-------------------start** 0xffffffff
+ while (ccount >= start || ccount < stop) {
+ __asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) );
+ }
+ }
+
+}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/HAL_SPI.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/HAL_SPI.cpp
similarity index 93%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/HAL_SPI.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/HAL_SPI.cpp
index eba880b4..8e5875fc 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/HAL_SPI.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/HAL_SPI.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -17,20 +17,18 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef ARDUINO_ARCH_ESP32
-#include "HAL.h"
+#include "../../inc/MarlinConfig.h"
+
#include "../shared/HAL_SPI.h"
+
#include
-#include "spi_pins.h"
#include
-#include "../../core/macros.h"
-
// ------------------------
// Public Variables
// ------------------------
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/Servo.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/Servo.cpp
similarity index 89%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/Servo.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/Servo.cpp
index 3c3b8fa7..fcf58485 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/Servo.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/Servo.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#ifdef ARDUINO_ARCH_ESP32
@@ -37,7 +37,7 @@ Servo::Servo() {
int8_t Servo::attach(const int inPin) {
if (channel >= CHANNEL_MAX_NUM) return -1;
- if (pin > 0) pin = inPin;
+ if (inPin > 0) pin = inPin;
ledcSetup(channel, 50, 16); // channel X, 50 Hz, 16-bit depth
ledcAttachPin(pin, channel);
@@ -61,9 +61,7 @@ void Servo::move(const int value) {
if (attach(0) >= 0) {
write(value);
safe_delay(servo_delay[channel]);
- #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- detach();
- #endif
+ TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
}
}
#endif // HAS_SERVOS
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/Servo.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/Servo.h
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/Servo.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/Servo.h
index 7b73ef0f..b0d92945 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/Servo.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/Servo.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/WebSocketSerial.cpp
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/WebSocketSerial.cpp
index 9a38d399..533f873e 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/WebSocketSerial.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#ifdef ARDUINO_ARCH_ESP32
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/WebSocketSerial.h
similarity index 93%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/WebSocketSerial.h
index 3d22c4d1..7a25c6dc 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/WebSocketSerial.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/persistent_store_impl.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/eeprom.cpp
similarity index 72%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/persistent_store_impl.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/eeprom.cpp
index a65a4301..1bf687c6 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/persistent_store_impl.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/eeprom.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,29 +16,25 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef ARDUINO_ARCH_ESP32
#include "../../inc/MarlinConfig.h"
-#if ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION)
+#if ENABLED(EEPROM_SETTINGS)
-#include "../shared/persistent_store_api.h"
-#include "EEPROM.h"
+#include "../shared/eeprom_api.h"
+#include
-#define EEPROM_SIZE 4096
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE 0x1000 // 4KB
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
-bool PersistentStore::access_start() {
- return EEPROM.begin(EEPROM_SIZE);
-}
-
-bool PersistentStore::access_finish() {
- EEPROM.end();
- return true;
-}
+bool PersistentStore::access_start() { return EEPROM.begin(MARLIN_EEPROM_SIZE); }
+bool PersistentStore::access_finish() { EEPROM.end(); return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
for (size_t i = 0; i < size; i++) {
@@ -57,7 +53,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false;
}
-size_t PersistentStore::capacity() { return EEPROM_SIZE; }
-
#endif // EEPROM_SETTINGS
#endif // ARDUINO_ARCH_ESP32
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/endstop_interrupts.h
similarity index 65%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/endstop_interrupts.h
index 31a3e4d6..743ccd99 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/endstop_interrupts.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -42,37 +42,21 @@ void ICACHE_RAM_ATTR endstop_ISR() { endstops.update(); }
void setup_endstop_interrupts() {
#define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
- #if HAS_X_MAX
- _ATTACH(X_MAX_PIN);
- #endif
- #if HAS_X_MIN
- _ATTACH(X_MIN_PIN);
- #endif
- #if HAS_Y_MAX
- _ATTACH(Y_MAX_PIN);
- #endif
- #if HAS_Y_MIN
- _ATTACH(Y_MIN_PIN);
- #endif
- #if HAS_Z_MAX
- _ATTACH(Z_MAX_PIN);
- #endif
- #if HAS_Z_MIN
- _ATTACH(Z_MIN_PIN);
- #endif
- #if HAS_Z2_MAX
- _ATTACH(Z2_MAX_PIN);
- #endif
- #if HAS_Z2_MIN
- _ATTACH(Z2_MIN_PIN);
- #endif
- #if HAS_Z3_MAX
- _ATTACH(Z3_MAX_PIN);
- #endif
- #if HAS_Z3_MIN
- _ATTACH(Z3_MIN_PIN);
- #endif
- #if HAS_Z_MIN_PROBE_PIN
- _ATTACH(Z_MIN_PROBE_PIN);
- #endif
+ TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN));
+ TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN));
+ TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN));
+ TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN));
+ TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN));
+ TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN));
+ TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN));
+ TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN));
+ TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN));
+ TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN));
+ TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN));
+ TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN));
+ TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN));
+ TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN));
+ TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
+ TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
+ TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/fastio.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/fastio.h
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/fastio.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/fastio.h
index 1641116b..2ded3a5f 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/fastio.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/fastio.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -56,7 +56,7 @@
#define SET_OUTPUT(IO) do{ _SET_OUTPUT(IO); }while(0)
// Set pin as PWM
-#define SET_PWM(IO) SET_OUTPUT(IO)
+#define SET_PWM SET_OUTPUT
// Set pin as output and init
#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/i2s.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/i2s.cpp
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/i2s.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/i2s.cpp
index 33a50345..99b2f755 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/i2s.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/i2s.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#ifdef ARDUINO_ARCH_ESP32
@@ -153,8 +153,8 @@ void stepperTask(void* parameter) {
remaining--;
}
else {
- Stepper::stepper_pulse_phase_isr();
- remaining = Stepper::stepper_block_phase_isr();
+ Stepper::pulse_phase_isr();
+ remaining = Stepper::block_phase_isr();
}
}
}
@@ -177,7 +177,7 @@ int i2s_init() {
*
* fwclk = fbclk / 32
*
- * for fwclk = 250kHz (4uS pulse time)
+ * for fwclk = 250kHz (4µS pulse time)
* N = 10
* M = 20
*/
@@ -308,7 +308,7 @@ int i2s_init() {
esp_intr_enable(i2s_isr_handle);
// Create the task that will feed the buffer
- xTaskCreate(stepperTask, "StepperTask", 10000, nullptr, 1, nullptr);
+ xTaskCreatePinnedToCore(stepperTask, "StepperTask", 10000, nullptr, 1, nullptr, CONFIG_ARDUINO_RUNNING_CORE); // run I2S stepper task on same core as rest of Marlin
// Route the i2s pins to the appropriate GPIO
gpio_matrix_out_check(I2S_DATA, I2S0O_DATA_OUT23_IDX, 0, 0);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/i2s.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/i2s.h
similarity index 87%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/i2s.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/i2s.h
index 971405a3..573b9838 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/i2s.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/i2s.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/inc/Conditionals_LCD.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_LCD.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/inc/Conditionals_LCD.h
index 85f26f40..5f1c4b16 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_LCD.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/inc/Conditionals_LCD.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/inc/Conditionals_adv.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_adv.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/inc/Conditionals_adv.h
index 85f26f40..5f1c4b16 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_adv.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/inc/Conditionals_adv.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/inc/Conditionals_post.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_post.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/inc/Conditionals_post.h
index 85f26f40..5f1c4b16 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/inc/Conditionals_post.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/inc/Conditionals_post.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/inc/SanityCheck.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/inc/SanityCheck.h
similarity index 72%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/inc/SanityCheck.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/inc/SanityCheck.h
index 9c62a353..7653f6fe 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/inc/SanityCheck.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/inc/SanityCheck.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -28,3 +28,11 @@
#if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform."
#endif
+
+#if HAS_TMC_SW_SERIAL
+ #error "TMC220x Software Serial is not supported on this platform."
+#endif
+
+#if BOTH(WIFISUPPORT, ESP3D_WIFISUPPORT)
+ #error "Only enable one WiFi option, either WIFISUPPORT or ESP3D_WIFISUPPORT."
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/ota.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/ota.cpp
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/ota.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/ota.cpp
index 377856f8..7cf65ed2 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/ota.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/ota.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
*
* This program is free software: you can redistribute it and/or modify
@@ -14,14 +14,14 @@
* 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 .
+ * along with this program. If not, see .
*/
#ifdef ARDUINO_ARCH_ESP32
#include "../../inc/MarlinConfigPre.h"
-#if ENABLED(OTASUPPORT)
+#if BOTH(WIFISUPPORT, OTASUPPORT)
#include
#include
@@ -67,6 +67,5 @@ void OTA_handle() {
ArduinoOTA.handle();
}
-#endif // OTASUPPORT
-
+#endif // WIFISUPPORT && OTASUPPORT
#endif // ARDUINO_ARCH_ESP32
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/ota.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/ota.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/ota.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/ota.h
index 7e89e93c..7f9b237a 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/ota.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/ota.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
*
* This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
* 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 .
+ * along with this program. If not, see .
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/servotimers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/servotimers.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/servotimers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/servotimers.h
index 85f26f40..5f1c4b16 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/servotimers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/servotimers.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/spi_pins.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/spi_pins.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/spi_pins.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/spi_pins.h
index 03ab2152..15f8f2ab 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/spi_pins.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/spi_pins.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/spiffs.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/spiffs.cpp
similarity index 83%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/spiffs.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/spiffs.cpp
index 1a542580..a0e713bf 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/spiffs.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/spiffs.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,15 +16,14 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef ARDUINO_ARCH_ESP32
#include "../../inc/MarlinConfigPre.h"
-#if ENABLED(WEBSUPPORT)
+#if BOTH(WIFISUPPORT, WEBSUPPORT)
#include "../../core/serial.h"
@@ -40,5 +39,5 @@ void spiffs_init() {
SERIAL_ERROR_MSG("SPIFFS mount failed");
}
-#endif // WEBSUPPORT
+#endif // WIFISUPPORT && WEBSUPPORT
#endif // ARDUINO_ARCH_ESP32
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/spiffs.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/spiffs.h
similarity index 85%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/spiffs.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/spiffs.h
index 8a1ee2f1..64ec7dd1 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/spiffs.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/spiffs.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/timers.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/timers.cpp
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/timers.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/timers.cpp
index 54388976..3300aea8 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/timers.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/timers.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef ARDUINO_ARCH_ESP32
#include
@@ -28,9 +27,7 @@
#include
#include
-#include "HAL.h"
-
-#include "timers.h"
+#include "../../inc/MarlinConfig.h"
// ------------------------
// Local defines
@@ -106,7 +103,7 @@ void HAL_timer_start(const uint8_t timer_num, uint32_t frequency) {
timer_enable_intr(timer.group, timer.idx);
- timer_isr_register(timer.group, timer.idx, timer_isr, (void*)timer_num, 0, nullptr);
+ timer_isr_register(timer.group, timer.idx, timer_isr, (void*)(uint32_t)timer_num, 0, nullptr);
timer_start(timer.group, timer.idx);
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/timers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/timers.h
similarity index 82%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/timers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/timers.h
index e6e3495b..d722670f 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/timers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/timers.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -38,16 +38,24 @@
typedef uint64_t hal_timer_t;
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFFFFFFFFFFULL
-#define STEP_TIMER_NUM 0 // index of timer to use for stepper
-#define TEMP_TIMER_NUM 1 // index of timer to use for temperature
-#define PWM_TIMER_NUM 2 // index of timer to use for PWM outputs
-#define PULSE_TIMER_NUM STEP_TIMER_NUM
+#ifndef STEP_TIMER_NUM
+ #define STEP_TIMER_NUM 0 // Timer Index for Stepper
+#endif
+#ifndef PULSE_TIMER_NUM
+ #define PULSE_TIMER_NUM STEP_TIMER_NUM
+#endif
+#ifndef TEMP_TIMER_NUM
+ #define TEMP_TIMER_NUM 1 // Timer Index for Temperature
+#endif
+#ifndef PWM_TIMER_NUM
+ #define PWM_TIMER_NUM 2 // index of timer to use for PWM outputs
+#endif
#define HAL_TIMER_RATE APB_CLK_FREQ // frequency of timer peripherals
#if ENABLED(I2S_STEPPER_STREAM)
#define STEPPER_TIMER_PRESCALE 1
- #define STEPPER_TIMER_RATE 250000 // 250khz, 4us pulses of i2s word clock
+ #define STEPPER_TIMER_RATE 250000 // 250khz, 4µs pulses of i2s word clock
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs // wrong would be 0.25
#else
#define STEPPER_TIMER_PRESCALE 40
@@ -79,9 +87,15 @@ typedef uint64_t hal_timer_t;
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
-#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler()
-#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler()
-#define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler()
+#ifndef HAL_TEMP_TIMER_ISR
+ #define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler()
+#endif
+#ifndef HAL_STEP_TIMER_ISR
+ #define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler()
+#endif
+#ifndef HAL_PWM_TIMER_ISR
+ #define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler()
+#endif
extern "C" void tempTC_Handler();
extern "C" void stepTC_Handler();
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/watchdog.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/watchdog.cpp
similarity index 87%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/watchdog.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/watchdog.cpp
index d05e67c8..f6fcfa31 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/watchdog.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/watchdog.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef ARDUINO_ARCH_ESP32
#include "../../inc/MarlinConfig.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/watchdog.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/watchdog.h
similarity index 87%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/watchdog.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/watchdog.h
index 9fb39ff9..b6c169e3 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/watchdog.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/watchdog.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/web.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/web.cpp
similarity index 83%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/web.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/web.cpp
index c593fc02..7a27707a 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/web.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/web.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,19 +16,19 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef ARDUINO_ARCH_ESP32
-#include
-#undef DISABLED // esp32-hal-gpio.h
-
#include "../../inc/MarlinConfigPre.h"
-#if ENABLED(WEBSUPPORT)
+#if BOTH(WIFISUPPORT, WEBSUPPORT)
+#include "../../inc/MarlinConfig.h"
+
+#undef DISABLED // esp32-hal-gpio.h
+#include
#include "wifi.h"
AsyncEventSource events("/events"); // event source (Server-Sent events)
@@ -43,5 +43,5 @@ void web_init() {
server.onNotFound(onNotFound);
}
-#endif // WEBSUPPORT
+#endif // WIFISUPPORT && WEBSUPPORT
#endif // ARDUINO_ARCH_ESP32
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/web.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/web.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/web.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/web.h
index d1d91b9c..60023ac6 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/web.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/web.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/wifi.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/wifi.cpp
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/wifi.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/wifi.cpp
index 19f1d8fb..f4cf5a60 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/wifi.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/wifi.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef ARDUINO_ARCH_ESP32
#include "../../core/serial.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/wifi.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/wifi.h
similarity index 86%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/wifi.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/wifi.h
index 4cd656cb..759a73b2 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_ESP32/wifi.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/ESP32/wifi.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL.h
index 5ad13931..29702f2d 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -27,8 +27,20 @@
#define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION)
+#ifndef I2C_ADDRESS
+ #define I2C_ADDRESS(A) (A)
+#endif
+
+// Needed for AVR sprintf_P PROGMEM extension
+#ifndef S_FMT
+ #define S_FMT "%s"
+#endif
+
+// String helper
+#ifndef PGMSTR
+ #define PGMSTR(NAM,STR) constexpr char NAM[] = STR
+#endif
+
inline void watchdog_refresh() {
- #if ENABLED(USE_WATCHDOG)
- HAL_watchdog_refresh();
- #endif
+ TERN_(USE_WATCHDOG, HAL_watchdog_refresh());
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.cpp
deleted file mode 100644
index 4afd83ad..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 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 .
- *
- */
-
-/**
- * The PWM module is only used to generate interrupts at specified times. It
- * is NOT used to directly toggle pins. The ISR writes to the pin assigned to
- * that interrupt.
- *
- * All PWMs use the same repetition rate. The G2 needs about 10KHz min in order to
- * not have obvious ripple on the Vref signals.
- *
- * The data structures are setup to minimize the computation done by the ISR which
- * minimizes ISR execution time. Execution times are 0.8 to 1.1 microseconds.
- *
- * FIve PWM interrupt sources are used. Channel 0 sets the base period. All Vref
- * signals are set active when this counter overflows and resets to zero. The compare
- * values in channels 1-4 are set to give the desired duty cycle for that Vref pin.
- * When counter 0 matches the compare value then that channel generates an interrupt.
- * The ISR checks the source of the interrupt and sets the corresponding pin inactive.
- *
- * Some jitter in the Vref signal is OK so the interrupt priority is left at its default value.
- */
-
-#include "../../../inc/MarlinConfig.h"
-
-#if MB(PRINTRBOARD_G2)
-
-#include "G2_PWM.h"
-
-volatile uint32_t *SODR_A = &PIOA->PIO_SODR,
- *SODR_B = &PIOB->PIO_SODR,
- *CODR_A = &PIOA->PIO_CODR,
- *CODR_B = &PIOB->PIO_CODR;
-
-PWM_map ISR_table[NUM_PWMS] = PWM_MAP_INIT;
-
-void Stepper::digipot_init() {
-
- OUT_WRITE(MOTOR_CURRENT_PWM_X_PIN, 0); // init pins
- OUT_WRITE(MOTOR_CURRENT_PWM_Y_PIN, 0);
- OUT_WRITE(MOTOR_CURRENT_PWM_Z_PIN, 0);
- OUT_WRITE(MOTOR_CURRENT_PWM_E_PIN, 0);
-
- #define WPKEY (0x50574D << 8) // “PWM” in ASCII
- #define WPCMD_DIS_SW 0 // command to disable Write Protect SW
- #define WPRG_ALL (PWM_WPCR_WPRG0 | PWM_WPCR_WPRG1 | PWM_WPCR_WPRG2 | PWM_WPCR_WPRG3 | PWM_WPCR_WPRG4 | PWM_WPCR_WPRG5) // all Write Protect Groups
-
- #define PWM_CLOCK_F F_CPU / 1000000UL // set clock to 1MHz
-
- PMC->PMC_PCER1 = PMC_PCER1_PID36; // enable PWM controller clock (disabled on power up)
-
- PWM->PWM_WPCR = WPKEY | WPRG_ALL | WPCMD_DIS_SW; // enable setting of all PWM registers
- PWM->PWM_CLK = PWM_CLOCK_F; // enable CLK_A and set it to 1MHz, leave CLK_B disabled
- PWM->PWM_CH_NUM[0].PWM_CMR = 0b1011; // set channel 0 to Clock A input & to left aligned
- PWM->PWM_CH_NUM[1].PWM_CMR = 0b1011; // set channel 1 to Clock A input & to left aligned
- PWM->PWM_CH_NUM[2].PWM_CMR = 0b1011; // set channel 2 to Clock A input & to left aligned
- PWM->PWM_CH_NUM[3].PWM_CMR = 0b1011; // set channel 3 to Clock A input & to left aligned
- PWM->PWM_CH_NUM[4].PWM_CMR = 0b1011; // set channel 4 to Clock A input & to left aligned
-
- PWM->PWM_CH_NUM[0].PWM_CPRD = PWM_PERIOD_US; // set channel 0 Period
-
- PWM->PWM_IER2 = PWM_IER1_CHID0; // generate interrupt when counter0 overflows
- PWM->PWM_IER2 = PWM_IER2_CMPM0 | PWM_IER2_CMPM1 | PWM_IER2_CMPM2 | PWM_IER2_CMPM3 | PWM_IER2_CMPM4; // generate interrupt on compare event
-
- PWM->PWM_CMP[1].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 1 PWM inactive
- PWM->PWM_CMP[2].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 2 PWM inactive
- PWM->PWM_CMP[3].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[1])); // interrupt when counter0 == CMPV - used to set Motor 3 PWM inactive
- PWM->PWM_CMP[4].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[2])); // interrupt when counter0 == CMPV - used to set Motor 4 PWM inactive
-
- PWM->PWM_CMP[1].PWM_CMPM = 0x0001; // enable compare event
- PWM->PWM_CMP[2].PWM_CMPM = 0x0001; // enable compare event
- PWM->PWM_CMP[3].PWM_CMPM = 0x0001; // enable compare event
- PWM->PWM_CMP[4].PWM_CMPM = 0x0001; // enable compare event
-
- PWM->PWM_SCM = PWM_SCM_UPDM_MODE0 | PWM_SCM_SYNC0 | PWM_SCM_SYNC1 | PWM_SCM_SYNC2 | PWM_SCM_SYNC3 | PWM_SCM_SYNC4; // sync 1-4 with 0, use mode 0 for updates
-
- PWM->PWM_ENA = PWM_ENA_CHID0 | PWM_ENA_CHID1 | PWM_ENA_CHID2 | PWM_ENA_CHID3 | PWM_ENA_CHID4; // enable the channels used by G2
- PWM->PWM_IER1 = PWM_IER1_CHID0 | PWM_IER1_CHID1 | PWM_IER1_CHID2 | PWM_IER1_CHID3 | PWM_IER1_CHID4; // enable interrupts for the channels used by G2
-
- NVIC_EnableIRQ(PWM_IRQn); // Enable interrupt handler
- NVIC_SetPriority(PWM_IRQn, NVIC_EncodePriority(0, 10, 0)); // normal priority for PWM module (can stand some jitter on the Vref signals)
-}
-
-void Stepper::digipot_current(const uint8_t driver, const int16_t current) {
-
- if (!(PWM->PWM_CH_NUM[0].PWM_CPRD == PWM_PERIOD_US)) digipot_init(); // Init PWM system if needed
-
- switch (driver) {
- case 0: PWM->PWM_CMP[1].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update X & Y
- PWM->PWM_CMP[2].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current));
- PWM->PWM_CMP[1].PWM_CMPMUPD = 0x0001; // enable compare event
- PWM->PWM_CMP[2].PWM_CMPMUPD = 0x0001; // enable compare event
- PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
- break;
- case 1: PWM->PWM_CMP[3].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update Z
- PWM->PWM_CMP[3].PWM_CMPMUPD = 0x0001; // enable compare event
- PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
- break;
- default:PWM->PWM_CMP[4].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update E
- PWM->PWM_CMP[4].PWM_CMPMUPD = 0x0001; // enable compare event
- PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
- break;
- }
-}
-
-volatile uint32_t PWM_ISR1_STATUS, PWM_ISR2_STATUS;
-
-void PWM_Handler() {
- PWM_ISR1_STATUS = PWM->PWM_ISR1;
- PWM_ISR2_STATUS = PWM->PWM_ISR2;
- if (PWM_ISR1_STATUS & PWM_IER1_CHID0) { // CHAN_0 interrupt
- *ISR_table[0].set_register = ISR_table[0].write_mask; // set X to active
- *ISR_table[1].set_register = ISR_table[1].write_mask; // set Y to active
- *ISR_table[2].set_register = ISR_table[2].write_mask; // set Z to active
- *ISR_table[3].set_register = ISR_table[3].write_mask; // set E to active
- }
- else {
- if (PWM_ISR2_STATUS & PWM_IER2_CMPM1) *ISR_table[0].clr_register = ISR_table[0].write_mask; // set X to inactive
- if (PWM_ISR2_STATUS & PWM_IER2_CMPM2) *ISR_table[1].clr_register = ISR_table[1].write_mask; // set Y to inactive
- if (PWM_ISR2_STATUS & PWM_IER2_CMPM3) *ISR_table[2].clr_register = ISR_table[2].write_mask; // set Z to inactive
- if (PWM_ISR2_STATUS & PWM_IER2_CMPM4) *ISR_table[3].clr_register = ISR_table[3].write_mask; // set E to inactive
- }
- return;
-}
-
-#endif // PRINTRBOARD_G2
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_LCD.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_LCD.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_adv.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_adv.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_post.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/Conditionals_post.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h
deleted file mode 100644
index b32b05ea..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
-
-#if PIO_PLATFORM_VERSION < 1001
- #error "nxplpc-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries. You may need to remove the platform and let it reinstall automatically."
-#endif
-#if PIO_FRAMEWORK_VERSION < 2002
- #error "framework-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries."
-#endif
-
-/**
- * Detect an old pins file by checking for old ADC pins values.
- */
-#define _OLD_TEMP_PIN(P) PIN_EXISTS(P) && _CAT(P,_PIN) <= 7 && _CAT(P,_PIN) != 2 && _CAT(P,_PIN) != 3
-#if _OLD_TEMP_PIN(TEMP_BED)
- #error "TEMP_BED_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
-#elif _OLD_TEMP_PIN(TEMP_0)
- #error "TEMP_0_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
-#elif _OLD_TEMP_PIN(TEMP_1)
- #error "TEMP_1_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
-#elif _OLD_TEMP_PIN(TEMP_2)
- #error "TEMP_2_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
-#elif _OLD_TEMP_PIN(TEMP_3)
- #error "TEMP_3_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
-#elif _OLD_TEMP_PIN(TEMP_4)
- #error "TEMP_4_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
-#elif _OLD_TEMP_PIN(TEMP_5)
- #error "TEMP_5_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
-#endif
-#undef _OLD_TEMP_PIN
-
-/**
- * Because PWM hardware channels all share the same frequency, along with the
- * fallback software channels, FAST_PWM_FAN is incompatible with Servos.
- */
-#if NUM_SERVOS > 0 && ENABLED(FAST_PWM_FAN)
- #error "BLTOUCH and Servos are incompatible with FAST_PWM_FAN on LPC176x boards."
-#endif
-
-/**
- * Test LPC176x-specific configuration values for errors at compile-time.
- */
-
-//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
-// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
-//#endif
-
-#if IS_RE_ARM_BOARD && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && HAS_DRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI)
- #error "Re-ARM with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and TMC2130 require TMC_USE_SW_SPI"
-#endif
-
-#if ENABLED(BAUD_RATE_GCODE)
- #error "BAUD_RATE_GCODE is not yet supported on LPC176x."
-#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction
deleted file mode 100644
index 0222c622..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction
+++ /dev/null
@@ -1,254 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 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 .
- *
- */
-
-/**
- * Based on U8G2 code - u8x8_byte.c
- *
- * Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
- *
- * Copyright (c) 2016, olikraus@gmail.com
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this list
- * of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this
- * list of conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Software i2c,
- * ignores ACK response (which is anyway not provided by some displays)
- * also does not allow reading from the device
- */
-
-#ifdef TARGET_LPC1768
-
-#include "../../inc/MarlinConfigPre.h"
-
-#if HAS_GRAPHICAL_LCD
-
-#include
-
-//void pinMode(int16_t pin, uint8_t mode);
-//void digitalWrite(int16_t pin, uint8_t pin_status);
-
-
-#define I2C_SLA (0x3C*2)
-//#define I2C_CMD_MODE 0x080
-#define I2C_CMD_MODE 0x000
-#define I2C_DATA_MODE 0x040
-
-//static uint8_t I2C_speed; // 3 - 400KHz, 13 - 100KHz
-//#define SPEED_400KHz 3
-//#define SPEED_100KHz 13
-
-// #define U8G_I2C_OPT_FAST 16
-
-uint8_t SCL_pin_HAL_LPC1768_sw_I2C, SCL_port_HAL_LPC1768_sw_I2C, SDA_pin_HAL_LPC1768_sw_I2C, SDA_port_HAL_LPC1768_sw_I2C;
-
-#define SPI_SPEED 2 //20: 200KHz 5:750KHz 2:3-4MHz
-
-uint8_t u8g_i2c_send_byte_sw(uint8_t data) {
- for (uint8_t i = 0; i < 9; i++) { // 1 extra bit for the ack/nak
-
- if (val & 0x80)
- for (uint8_t j = 0; j < SPI_SPEED; j++) {
- LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
- LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
- LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
- }
- else
- for (uint8_t j = 0; j < SPI_SPEED; j++) {
- LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
- LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
- LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
- }
-
- for (uint8_t j = 0; j < SPI_SPEED; j++) {
- LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
- LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
- LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
- LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
- LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
- }
-
- for (uint8_t j = 0; j < SPI_SPEED; j++) {
- LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
- LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
- }
- val <<= 1;
- }
- return 1;
-}
-
-
-uint8_t u8g_i2c_start_sw(uint8_t sla) { // assert start condition and then send slave address with write bit
- /* send the start condition, both lines go from 1 to 0 */
-
- LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
- LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
- DELAY_US(2);
- LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
- DELAY_US(2);
- LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOSET = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
- DELAY_US(2);
- LPC_GPIO(SDA_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SDA_pin_HAL_LPC1768_sw_I2C);
- DELAY_US(2);
- LPC_GPIO(SCL_port_HAL_LPC1768_sw_I2C)->FIOCLR = LPC_PIN(SCL_pin_HAL_LPC1768_sw_I2C);
-
- u8g_i2c_send_byte_sw(I2C_SLA); // send slave address with write bit
-}
-
-
-void u8g_i2c_stop_sw() { }
-
-void u8g_i2c_init_sw(uint8_t clock_option) { u8g_i2c_start(0); } // send slave address and write bit
-
-uint8_t u8g_com_ssd_I2C_start_sequence_sw(u8g_t *u8g) {
- /* are we requested to set the a0 state? */
- if (u8g->pin_list[U8G_PI_SET_A0] == 0) return 1;
-
- /* setup bus, might be a repeated start */
- if (u8g_i2c_start(I2C_SLA) == 0) return 0;
- if (u8g->pin_list[U8G_PI_A0_STATE] == 0) {
- if (u8g_i2c_send_byte(I2C_CMD_MODE) == 0) return 0;
- }
- else if (u8g_i2c_send_byte(I2C_DATA_MODE) == 0) return 0;
-
- u8g->pin_list[U8G_PI_SET_A0] = 0;
-
- return 1;
-}
-
-uint8_t u8g_com_HAL_LPC1768_ssd_sw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) {
- switch (msg) {
- case U8G_COM_MSG_INIT:
-
- #define LPC1768_PIN_PORT(pin) ((uint8_t)((pin >> 5) & 0b111))
- #define LPC1768_PIN_PIN(pin) ((uint8_t)(pin & 0b11111))
- SCL_pin_HAL_LPC1768_sw_I2C = LPC1768_PIN_PIN(u8g->pin_list[U8G_PI_SCL]);
- SCL_port_HAL_LPC1768_sw_I2C = LPC1768_PIN_PORT(u8g->pin_list[U8G_PI_SCL]);
- SDA_pin_HAL_LPC1768_sw_I2C = LPC1768_PIN_PIN(u8g->pin_list[U8G_PI_SDA]);
- SDA_port_HAL_LPC1768_sw_I2C = LPC1768_PIN_PORT(u8g->pin_list[U8G_PI_SDA]);
- // As defined by Arduino INPUT(0x0), OUTPUT(0x1), INPUT_PULLUP(0x2)
- #define OUTPUT 0x1
- u8g_SetPIOutput(u8g, U8G_PI_SCL);
- u8g_SetPIOutput(u8g, U8G_PI_SDA);
- if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_CS]) u8g_SetPIOutput(u8g, U8G_PI_CS);
- if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_A0]) u8g_SetPIOutput(u8g, U8G_PI_A0);
- if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_RESET]) u8g_SetPIOutput(u8g, U8G_PI_RESET);
-
- //u8g_com_arduino_digital_write(u8g, U8G_PI_SCL, HIGH);
- //u8g_com_arduino_digital_write(u8g, U8G_PI_SDA, HIGH);
- //u8g->pin_list[U8G_PI_A0_STATE] = 0; /* initial RS state: unknown mode */
-
- u8g_i2c_init_sw(u8g->pin_list[U8G_PI_I2C_OPTION]);
- u8g_com_ssd_I2C_start_sequence_sw(u8g);
- break;
-
- case U8G_COM_MSG_STOP: break;
-
- case U8G_COM_MSG_RESET: break;
-
- case U8G_COM_MSG_CHIP_SELECT:
- u8g->pin_list[U8G_PI_A0_STATE] = 0;
- u8g->pin_list[U8G_PI_SET_A0] = 1; /* force a0 to set again, also forces start condition */
- if (arg_val == 0) {
- /* disable chip, send stop condition */
- u8g_i2c_stop_sw();
- }
- else {
- /* enable, do nothing: any byte writing will trigger the i2c start */
- }
- break;
-
- case U8G_COM_MSG_WRITE_BYTE:
- //u8g->pin_list[U8G_PI_SET_A0] = 1;
- //if (u8g_com_arduino_ssd_start_sequence(u8g) == 0)
- // return u8g_i2c_stop(), 0;
- if (u8g_i2c_send_byte_sw(arg_val) == 0)
- return u8g_i2c_stop_sw(), 0;
- // u8g_i2c_stop();
- break;
-
- case U8G_COM_MSG_WRITE_SEQ: {
- //u8g->pin_list[U8G_PI_SET_A0] = 1;
- if (u8g_com_ssd_I2C_start_sequence_sw(u8g) == 0)
- return u8g_i2c_stop_sw(), 0;
-
- uint8_t *ptr = (uint8_t *)arg_ptr;
- while (arg_val > 0) {
- if (u8g_i2c_send_byte_sw(*ptr++) == 0)
- return u8g_i2c_stop_sw(), 0;
- arg_val--;
- }
- }
- // u8g_i2c_stop();
- break;
-
- case U8G_COM_MSG_WRITE_SEQ_P: {
- //u8g->pin_list[U8G_PI_SET_A0] = 1;
- if (u8g_com_ssd_I2C_start_sequence_sw(u8g) == 0)
- return u8g_i2c_stop_sw(), 0;
-
- uint8_t *ptr = (uint8_t *)arg_ptr;
- while (arg_val > 0) {
- if (u8g_i2c_send_byte_sw(u8g_pgm_read(ptr)) == 0) return 0;
- ptr++;
- arg_val--;
- }
- }
- // u8g_i2c_stop();
- break;
-
- case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */
- u8g->pin_list[U8G_PI_A0_STATE] = arg_val;
- u8g->pin_list[U8G_PI_SET_A0] = 1; /* force a0 to set again */
- u8g_i2c_start_sw(0); // send slave address and write bit
- u8g_i2c_send_byte_sw(arg_val ? 0x40 : 0x80); // Write to ? Graphics DRAM mode : Command mode
- break;
- }
- return 1;
-}
-
-#endif // HAS_GRAPHICAL_LCD
-
-#endif // TARGET_LPC1768
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
deleted file mode 100644
index b3ab5902..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
+++ /dev/null
@@ -1,144 +0,0 @@
-#
-# sets output_port
-# if target_filename is found then that drive is used
-# else if target_drive is found then that drive is used
-#
-from __future__ import print_function
-
-target_filename = "FIRMWARE.CUR"
-target_drive = "REARM"
-
-import os
-import platform
-current_OS = platform.system()
-Import("env")
-
-def print_error(e):
- print('\nUnable to find destination disk (' + e + ')\n' \
- 'Please select it in platformio.ini using the upload_port keyword ' \
- '(https://docs.platformio.org/en/latest/projectconf/section_env_upload.html) ' \
- 'or copy the firmware (.pio/build/' + env.get('PIOENV') + '/firmware.bin) manually to the appropriate disk\n')
-
-try:
- if current_OS == 'Windows':
- #
- # platformio.ini will accept this for a Windows upload port designation: 'upload_port = L:'
- # Windows - doesn't care about the disk's name, only cares about the drive letter
- #
-
- #
- # get all drives on this computer
- #
- import subprocess
- # typical result (string): 'Drives: C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\'
- driveStr = str(subprocess.check_output("fsutil fsinfo drives"))
- # typical result (string): 'C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\'
- # driveStr = driveStr.strip().lstrip('Drives: ') <- Doesn't work in other Languages as English. In German is "Drives:" = "Laufwerke:"
- FirstFound = driveStr.find(':',0,-1) # Find the first ":" and
- driveStr = driveStr[FirstFound + 1 : -1] # truncate to the rest
- # typical result (array of stings): ['C:\\', 'D:\\', 'E:\\', 'F:\\',
- # 'G:\\', 'H:\\', 'I:\\', 'J:\\', 'K:\\', 'L:\\', 'M:\\', 'Y:\\', 'Z:\\']
- drives = driveStr.split()
-
- upload_disk = 'Disk not found'
- target_file_found = False
- target_drive_found = False
- for drive in drives:
- final_drive_name = drive.strip().rstrip('\\') # typical result (string): 'C:'
- try:
- volume_info = str(subprocess.check_output('cmd /C dir ' + final_drive_name, stderr=subprocess.STDOUT))
- except Exception as e:
- continue
- else:
- if target_drive in volume_info and target_file_found == False: # set upload if not found target file yet
- target_drive_found = True
- upload_disk = final_drive_name
- if target_filename in volume_info:
- if target_file_found == False:
- upload_disk = final_drive_name
- target_file_found = True
-
- #
- # set upload_port to drive if found
- #
-
- if target_file_found == True or target_drive_found == True:
- env.Replace(
- UPLOAD_PORT=upload_disk
- )
- print('upload disk: ', upload_disk)
- else:
- print_error('Autodetect Error')
-
- elif current_OS == 'Linux':
- #
- # platformio.ini will accept this for a Linux upload port designation: 'upload_port = /media/media_name/drive'
- #
- upload_disk = 'Disk not found'
- target_file_found = False
- target_drive_found = False
- medias = os.listdir('/media') #
- for media in medias:
- drives = os.listdir('/media/' + media) #
- if target_drive in drives and target_file_found == False: # set upload if not found target file yet
- target_drive_found = True
- upload_disk = '/media/' + media + '/' + target_drive + '/'
- for drive in drives:
- try:
- files = os.listdir('/media/' + media + '/' + drive)
- except:
- continue
- else:
- if target_filename in files:
- if target_file_found == False:
- upload_disk = '/media/' + media + '/' + drive + '/'
- target_file_found = True
-
- #
- # set upload_port to drive if found
- #
-
- if target_file_found == True or target_drive_found == True:
- env.Replace(
- UPLOAD_FLAGS="-P$UPLOAD_PORT",
- UPLOAD_PORT=upload_disk
- )
- print('upload disk: ', upload_disk)
- else:
- print_error('Autodetect Error')
-
- elif current_OS == 'Darwin': # MAC
- #
- # platformio.ini will accept this for a OSX upload port designation: 'upload_port = /media/media_name/drive'
- #
- upload_disk = 'Disk not found'
- drives = os.listdir('/Volumes') # human readable names
- target_file_found = False
- target_drive_found = False
- if target_drive in drives and target_file_found == False: # set upload if not found target file yet
- target_drive_found = True
- upload_disk = '/Volumes/' + target_drive + '/'
- for drive in drives:
- try:
- filenames = os.listdir('/Volumes/' + drive + '/') # will get an error if the drive is protected
- except:
- continue
- else:
- if target_filename in filenames:
- if target_file_found == False:
- upload_disk = '/Volumes/' + drive + '/'
- target_file_found = True
- #
- # set upload_port to drive if found
- #
-
- if target_file_found == True or target_drive_found == True:
- env.Replace(
- UPLOAD_PORT=upload_disk
- )
- print('\nupload disk: ', upload_disk, '\n')
- else:
- print_error('Autodetect Error')
-
-except Exception as e:
- print_error(str(e))
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_LCD.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_adv.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_adv.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp
deleted file mode 100644
index e41dd85c..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- *
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
- *
- * 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 .
- *
- */
-
-#ifdef __SAMD51__
-
-#include "../../inc/MarlinConfig.h"
-
-#if ENABLED(EEPROM_SETTINGS)
-
-#include "../shared/persistent_store_api.h"
-
-#if NONE(SPI_EEPROM, I2C_EEPROM)
- #define NVMCTRL_CMD(c) do{ \
- SYNC(!NVMCTRL->STATUS.bit.READY); \
- NVMCTRL->INTFLAG.bit.DONE = true; \
- NVMCTRL->CTRLB.reg = c | NVMCTRL_CTRLB_CMDEX_KEY; \
- SYNC(NVMCTRL->INTFLAG.bit.DONE); \
- }while(0)
- #define NVMCTRL_FLUSH() do{ \
- if (NVMCTRL->SEESTAT.bit.LOAD) \
- NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_SEEFLUSH); \
- }while(0)
-#endif
-
-bool PersistentStore::access_start() {
- #if NONE(SPI_EEPROM, I2C_EEPROM)
- NVMCTRL->SEECFG.reg = NVMCTRL_SEECFG_WMODE_BUFFERED; // Buffered mode and segment reallocation active
- #endif
-
- return true;
-}
-
-bool PersistentStore::access_finish() {
- #if NONE(SPI_EEPROM, I2C_EEPROM)
- NVMCTRL_FLUSH();
- if (!NVMCTRL->SEESTAT.bit.LOCK)
- NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_LSEE); // Lock E2P data write access
- #endif
-
- return true;
-}
-
-bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
- #if NONE(SPI_EEPROM, I2C_EEPROM)
- if (NVMCTRL->SEESTAT.bit.RLOCK)
- NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE); // Unlock E2P data write access
- #endif
-
- while (size--) {
- const uint8_t v = *value;
- #if ANY(SPI_EEPROM, I2C_EEPROM)
- uint8_t * const p = (uint8_t * const)pos;
- if (v != eeprom_read_byte(p)) {
- eeprom_write_byte(p, v);
- delay(2);
- if (eeprom_read_byte(p) != v) {
- SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
- return true;
- }
- }
- #else
- SYNC(NVMCTRL->SEESTAT.bit.BUSY);
- if (NVMCTRL->INTFLAG.bit.SEESFULL)
- NVMCTRL_FLUSH(); // Next write will trigger a sector reallocation. I need to flush 'pagebuffer'
- ((volatile uint8_t *)SEEPROM_ADDR)[pos] = v;
- SYNC(!NVMCTRL->INTFLAG.bit.SEEWRC);
- #endif
- crc16(crc, &v, 1);
- pos++;
- value++;
- }
- return false;
-}
-
-bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
- while (size--) {
- uint8_t c;
- #if ANY(SPI_EEPROM, I2C_EEPROM)
- c = eeprom_read_byte((uint8_t*)pos);
- #else
- SYNC(NVMCTRL->SEESTAT.bit.BUSY);
- c = ((volatile uint8_t *)SEEPROM_ADDR)[pos];
- #endif
- if (writing) *value = c;
- crc16(crc, &c, 1);
- pos++;
- value++;
- }
- return false;
-}
-
-size_t PersistentStore::capacity() {
- #if ANY(SPI_EEPROM, I2C_EEPROM)
- return E2END + 1;
- #else
- const uint8_t psz = NVMCTRL->SEESTAT.bit.PSZ,
- sblk = NVMCTRL->SEESTAT.bit.SBLK;
-
- if (!psz && !sblk) return 0;
- else if (psz <= 2) return (0x200 << psz);
- else if (sblk == 1 || psz == 3) return 4096;
- else if (sblk == 2 || psz == 4) return 8192;
- else if (sblk <= 4 || psz == 5) return 16384;
- else if (sblk >= 9 && psz == 7) return 65536;
- else return 32768;
- #endif
-}
-
-#endif // EEPROM_SETTINGS
-
-#endif // __SAMD51__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/timers.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/timers.cpp
deleted file mode 100644
index 24340439..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/timers.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- *
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
- *
- * 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 .
- *
- */
-
-#ifdef __SAMD51__
-
-// --------------------------------------------------------------------------
-// Includes
-// --------------------------------------------------------------------------
-#include "../../inc/MarlinConfig.h"
-#include "timers.h"
-
-// --------------------------------------------------------------------------
-// Local defines
-// --------------------------------------------------------------------------
-
-#define NUM_HARDWARE_TIMERS 8
-
-// --------------------------------------------------------------------------
-// Private Variables
-// --------------------------------------------------------------------------
-
-const tTimerConfig TimerConfig[NUM_HARDWARE_TIMERS] = {
- { TC0, TC0_IRQn, TC_PRIORITY(0) },
- { TC1, TC1_IRQn, TC_PRIORITY(1) },
- { TC2, TC2_IRQn, TC_PRIORITY(2) }, // Reserved by framework tone function
- { TC3, TC3_IRQn, TC_PRIORITY(3) }, // Reserved by servo library
- { TC4, TC4_IRQn, TC_PRIORITY(4) },
- { TC5, TC5_IRQn, TC_PRIORITY(5) },
- { TC6, TC6_IRQn, TC_PRIORITY(6) },
- { TC7, TC7_IRQn, TC_PRIORITY(7) }
-};
-
-// --------------------------------------------------------------------------
-// Private functions
-// --------------------------------------------------------------------------
-
-FORCE_INLINE void Disable_Irq(IRQn_Type irq) {
- NVIC_DisableIRQ(irq);
-
- // We NEED memory barriers to ensure Interrupts are actually disabled!
- // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the )
- __DSB();
- __ISB();
-}
-
-// --------------------------------------------------------------------------
-// Public functions
-// --------------------------------------------------------------------------
-
-void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
- Tc * const tc = TimerConfig[timer_num].pTimer;
- IRQn_Type irq = TimerConfig[timer_num].IRQ_Id;
-
- // Disable interrupt, just in case it was already enabled
- Disable_Irq(irq);
-
- // Disable timer interrupt
- tc->COUNT32.INTENCLR.reg = TC_INTENCLR_OVF; // disable overflow interrupt
-
- // TCn clock setup
- const uint8_t clockID = GCLK_CLKCTRL_IDs[TCC_INST_NUM + timer_num];
- GCLK->PCHCTRL[clockID].bit.CHEN = false;
- SYNC(GCLK->PCHCTRL[clockID].bit.CHEN);
- GCLK->PCHCTRL[clockID].reg = GCLK_PCHCTRL_GEN_GCLK0 | GCLK_PCHCTRL_CHEN; // 120MHz startup code programmed
- SYNC(!GCLK->PCHCTRL[clockID].bit.CHEN);
-
- // Stop timer, just in case, to be able to reconfigure it
- tc->COUNT32.CTRLA.bit.ENABLE = false;
- SYNC(tc->COUNT32.SYNCBUSY.bit.ENABLE);
-
- // Reset timer
- tc->COUNT32.CTRLA.bit.SWRST = true;
- SYNC(tc->COUNT32.SYNCBUSY.bit.SWRST);
-
- NVIC_SetPriority(irq, TimerConfig[timer_num].priority);
-
- // Wave mode, reset counter on overflow on 0 (I use count down to prevent double buffer use)
- tc->COUNT32.WAVE.reg = TC_WAVE_WAVEGEN_MFRQ;
- tc->COUNT32.CTRLA.reg = TC_CTRLA_MODE_COUNT32 | TC_CTRLA_PRESCALER_DIV1;
- tc->COUNT32.CTRLBSET.reg = TC_CTRLBCLR_DIR;
- SYNC(tc->COUNT32.SYNCBUSY.bit.CTRLB);
-
- // Set compare value
- tc->COUNT32.COUNT.reg = tc->COUNT32.CC[0].reg = (HAL_TIMER_RATE) / frequency;
-
- // And start timer
- tc->COUNT32.CTRLA.bit.ENABLE = true;
- SYNC(tc->COUNT32.SYNCBUSY.bit.ENABLE);
-
- // Enable interrupt on RC compare
- tc->COUNT32.INTENSET.reg = TC_INTENCLR_OVF; // enable overflow interrupt
-
- // Finally, enable IRQ
- NVIC_EnableIRQ(irq);
-}
-
-void HAL_timer_enable_interrupt(const uint8_t timer_num) {
- IRQn_Type irq = TimerConfig[timer_num].IRQ_Id;
- NVIC_EnableIRQ(irq);
-}
-
-void HAL_timer_disable_interrupt(const uint8_t timer_num) {
- IRQn_Type irq = TimerConfig[timer_num].IRQ_Id;
- Disable_Irq(irq);
-}
-
-// missing from CMSIS: Check if interrupt is enabled or not
-static bool NVIC_GetEnabledIRQ(IRQn_Type IRQn) {
- return (NVIC->ISER[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F))) != 0;
-}
-
-bool HAL_timer_interrupt_enabled(const uint8_t timer_num) {
- IRQn_Type irq = TimerConfig[timer_num].IRQ_Id;
- return NVIC_GetEnabledIRQ(irq);
-}
-
-#endif // __SAMD51__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp
deleted file mode 100644
index 82cae9b7..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- * Copyright (c) 2017 Victor Perez
- *
- * 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 .
- *
- */
-#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
-
-#include "../../inc/MarlinConfig.h"
-
-#include
-
-// ------------------------
-// Public Variables
-// ------------------------
-
-static SPISettings spiConfig;
-
-// ------------------------
-// Public functions
-// ------------------------
-
-#if ENABLED(SOFTWARE_SPI)
- // ------------------------
- // Software SPI
- // ------------------------
- #error "Software SPI not supported for STM32. Use Hardware SPI."
-
-#else
-
-// ------------------------
-// Hardware SPI
-// ------------------------
-
-/**
- * VGPV SPI speed start and PCLK2/2, by default 108/2 = 54Mhz
- */
-
-/**
- * @brief Begin SPI port setup
- *
- * @return Nothing
- *
- * @details Only configures SS pin since stm32duino creates and initialize the SPI object
- */
-void spiBegin() {
- #if !PIN_EXISTS(SS)
- #error "SS_PIN not defined!"
- #endif
-
- OUT_WRITE(SS_PIN, HIGH);
-}
-
-/** Configure SPI for specified SPI speed */
-void spiInit(uint8_t spiRate) {
- // Use datarates Marlin uses
- uint32_t clock;
- switch (spiRate) {
- case SPI_FULL_SPEED: clock = 20000000; break; // 13.9mhz=20000000 6.75mhz=10000000 3.38mhz=5000000 .833mhz=1000000
- case SPI_HALF_SPEED: clock = 5000000; break;
- case SPI_QUARTER_SPEED: clock = 2500000; break;
- case SPI_EIGHTH_SPEED: clock = 1250000; break;
- case SPI_SPEED_5: clock = 625000; break;
- case SPI_SPEED_6: clock = 300000; break;
- default:
- clock = 4000000; // Default from the SPI library
- }
- spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0);
-
- #if ENABLED(CUSTOM_SPI_PINS)
- SPI.setMISO(MISO_PIN);
- SPI.setMOSI(MOSI_PIN);
- SPI.setSCLK(SCK_PIN);
- SPI.setSSEL(SS_PIN);
- #endif
-
- SPI.begin();
-}
-
-/**
- * @brief Receives a single byte from the SPI port.
- *
- * @return Byte received
- *
- * @details
- */
-uint8_t spiRec() {
- SPI.beginTransaction(spiConfig);
- uint8_t returnByte = SPI.transfer(0xFF);
- SPI.endTransaction();
- return returnByte;
-}
-
-/**
- * @brief Receives a number of bytes from the SPI port to a buffer
- *
- * @param buf Pointer to starting address of buffer to write to.
- * @param nbyte Number of bytes to receive.
- * @return Nothing
- *
- * @details Uses DMA
- */
-void spiRead(uint8_t* buf, uint16_t nbyte) {
- if (nbyte == 0) return;
- memset(buf, 0xFF, nbyte);
- SPI.beginTransaction(spiConfig);
- SPI.transfer(buf, nbyte);
- SPI.endTransaction();
-}
-
-/**
- * @brief Sends a single byte on SPI port
- *
- * @param b Byte to send
- *
- * @details
- */
-void spiSend(uint8_t b) {
- SPI.beginTransaction(spiConfig);
- SPI.transfer(b);
- SPI.endTransaction();
-}
-
-/**
- * @brief Write token and then write from 512 byte buffer to SPI (for SD card)
- *
- * @param buf Pointer with buffer start address
- * @return Nothing
- *
- * @details Use DMA
- */
-void spiSendBlock(uint8_t token, const uint8_t* buf) {
- uint8_t rxBuf[512];
- SPI.beginTransaction(spiConfig);
- SPI.transfer(token);
- SPI.transfer((uint8_t*)buf, &rxBuf, 512);
- SPI.endTransaction();
-}
-
-#endif // SOFTWARE_SPI
-
-#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/Servo.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/Servo.cpp
deleted file mode 100644
index 9af8ba61..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/Servo.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- * Copyright (c) 2017 Victor Perez
- *
- * 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 .
- *
- */
-#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
-
-#include "../../inc/MarlinConfig.h"
-
-#if HAS_SERVOS
-
-#include "Servo.h"
-
-static uint_fast8_t servoCount = 0;
-constexpr millis_t servoDelay[] = SERVO_DELAY;
-static_assert(COUNT(servoDelay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
-
-libServo::libServo()
-: delay(servoDelay[servoCount++])
-{}
-
-int8_t libServo::attach(const int pin) {
- if (servoCount >= MAX_SERVOS) return -1;
- if (pin > 0) servo_pin = pin;
- return super::attach(servo_pin);
-}
-
-int8_t libServo::attach(const int pin, const int min, const int max) {
- if (servoCount >= MAX_SERVOS) return -1;
- if (pin > 0) servo_pin = pin;
- return super::attach(servo_pin, min, max);
-}
-
-void libServo::move(const int value) {
- if (attach(0) >= 0) {
- write(value);
- safe_delay(delay);
- #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- detach();
- #endif
- }
-}
-#endif // HAS_SERVOS
-
-#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h
deleted file mode 100644
index d0aa731e..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- * Copyright (c) 2017 Victor Perez
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
-
-#include "../../module/endstops.h"
-
-// One ISR for all EXT-Interrupts
-void endstop_ISR() { endstops.update(); }
-
-void setup_endstop_interrupts() {
- #if HAS_X_MAX
- attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_X_MIN
- attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Y_MAX
- attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Y_MIN
- attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z_MAX
- attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z_MIN
- attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z2_MAX
- attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z2_MIN
- attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z3_MAX
- attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z3_MIN
- attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z_MIN_PROBE_PIN
- attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);
- #endif
-}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/inc/Conditionals_LCD.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/inc/Conditionals_LCD.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/inc/Conditionals_adv.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/inc/Conditionals_adv.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/inc/Conditionals_post.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/inc/Conditionals_post.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp
deleted file mode 100644
index 44f01cb8..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- *
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
- * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
- * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
- *
- * 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 .
- *
- */
-#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
-
-#include "../../inc/MarlinConfig.h"
-
-#if ENABLED(EEPROM_SETTINGS) && ANY(SRAM_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM)
-
-#include "../shared/persistent_store_api.h"
-
-bool PersistentStore::access_start() {
- return true;
-}
-
-bool PersistentStore::access_finish() {
- return true;
-}
-
-bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
- while (size--) {
- uint8_t v = *value;
-
- // Save to either external EEPROM, program flash or Backup SRAM
- #if EITHER(SPI_EEPROM, I2C_EEPROM)
- // EEPROM has only ~100,000 write cycles,
- // so only write bytes that have changed!
- uint8_t * const p = (uint8_t * const)pos;
- if (v != eeprom_read_byte(p)) {
- eeprom_write_byte(p, v);
- if (eeprom_read_byte(p) != v) {
- SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
- return true;
- }
- }
- #else
- *(__IO uint8_t *)(BKPSRAM_BASE + (uint8_t * const)pos) = v;
- #endif
-
- crc16(crc, &v, 1);
- pos++;
- value++;
- };
-
- return false;
-}
-
-bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
- do {
- // Read from either external EEPROM, program flash or Backup SRAM
- const uint8_t c = (
- #if EITHER(SPI_EEPROM, I2C_EEPROM)
- eeprom_read_byte((uint8_t*)pos)
- #else
- (*(__IO uint8_t *)(BKPSRAM_BASE + ((uint8_t*)pos)))
- #endif
- );
-
- if (writing) *value = c;
- crc16(crc, &c, 1);
- pos++;
- value++;
- } while (--size);
- return false;
-}
-
-size_t PersistentStore::capacity() {
- return (
- #if ENABLED(SRAM_EEPROM_EMULATION)
- 4096 // 4kB
- #else
- E2END + 1
- #endif
- );
-}
-
-#endif // EEPROM_SETTINGS && (SRAM_EEPROM_EMULATION || SPI_EEPROM || I2C_EEPROM)
-#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/persistent_store_sdcard.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/persistent_store_sdcard.cpp
deleted file mode 100644
index 6ce63073..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/persistent_store_sdcard.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 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 .
- *
- */
-
-/**
- * Implementation of EEPROM settings in SD Card
- */
-
-#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
-
-#include "../../inc/MarlinConfig.h"
-
-#if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM)
-
-#include "../shared/persistent_store_api.h"
-
-#ifndef E2END
- #define E2END 0xFFF // 4KB
-#endif
-#define HAL_EEPROM_SIZE int(E2END + 1)
-
-#define _ALIGN(x) __attribute__ ((aligned(x)))
-static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE];
-
-#if ENABLED(SDSUPPORT)
-
- #include "../../sd/cardreader.h"
-
- #define EEPROM_FILENAME "eeprom.dat"
-
- bool PersistentStore::access_start() {
- if (!card.isMounted()) return false;
-
- SdFile file, root = card.getroot();
- if (!file.open(&root, EEPROM_FILENAME, O_RDONLY))
- return true;
-
- int bytes_read = file.read(HAL_eeprom_data, HAL_EEPROM_SIZE);
- if (bytes_read < 0) return false;
- for (; bytes_read < HAL_EEPROM_SIZE; bytes_read++)
- HAL_eeprom_data[bytes_read] = 0xFF;
- file.close();
- return true;
- }
-
- bool PersistentStore::access_finish() {
- if (!card.isMounted()) return false;
-
- SdFile file, root = card.getroot();
- int bytes_written = 0;
- if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) {
- bytes_written = file.write(HAL_eeprom_data, HAL_EEPROM_SIZE);
- file.close();
- }
- return (bytes_written == HAL_EEPROM_SIZE);
- }
-
-#else // !SDSUPPORT
-
- #error "Please define an EEPROM, a SDCARD or disable EEPROM_SETTINGS."
-
-#endif // !SDSUPPORT
-
-bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
- for (size_t i = 0; i < size; i++)
- HAL_eeprom_data[pos + i] = value[i];
- crc16(crc, value, size);
- pos += size;
- return false;
-}
-
-bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
- for (size_t i = 0; i < size; i++) {
- uint8_t c = HAL_eeprom_data[pos + i];
- if (writing) value[i] = c;
- crc16(crc, &c, 1);
- }
- pos += size;
- return false;
-}
-
-size_t PersistentStore::capacity() { return HAL_EEPROM_SIZE; }
-
-#endif // EEPROM_SETTINGS
-#endif // STM32
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_LCD.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_LCD.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_adv.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_adv.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_post.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/inc/Conditionals_post.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/endstop_interrupts.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/endstop_interrupts.h
deleted file mode 100644
index d0aa731e..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/endstop_interrupts.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- * Copyright (c) 2017 Victor Perez
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
-
-#include "../../module/endstops.h"
-
-// One ISR for all EXT-Interrupts
-void endstop_ISR() { endstops.update(); }
-
-void setup_endstop_interrupts() {
- #if HAS_X_MAX
- attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_X_MIN
- attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Y_MAX
- attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Y_MIN
- attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z_MAX
- attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z_MIN
- attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z2_MAX
- attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z2_MIN
- attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z3_MAX
- attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z3_MIN
- attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z_MIN_PROBE_PIN
- attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);
- #endif
-}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_LCD.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_LCD.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_adv.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_adv.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_LCD.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_LCD.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_adv.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_adv.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_LCD.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_LCD.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_adv.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_adv.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h
deleted file mode 100644
index 85f26f40..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/HAL.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/HAL.cpp
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/HAL.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/HAL.cpp
index 316f6b45..d7d7c2d2 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/HAL.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/HAL.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __PLAT_LINUX__
#include "../../inc/MarlinConfig.h"
@@ -55,7 +54,7 @@ void HAL_adc_init() {
}
-void HAL_adc_enable_channel(int ch) {
+void HAL_adc_enable_channel(const uint8_t ch) {
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/HAL.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/HAL.h
similarity index 76%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/HAL.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/HAL.h
index 37b3b479..96e121d9 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/HAL.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/HAL.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
*
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -56,7 +56,6 @@ uint8_t _getc();
#include "../shared/HAL_SPI.h"
#include "fastio.h"
#include "watchdog.h"
-#include "timers.h"
#include "serial.h"
#define SHARED_SERVOS HAS_SERVOS
@@ -72,8 +71,8 @@ extern HalSerial usb_serial;
//
// Interrupts
//
-#define CRITICAL_SECTION_START
-#define CRITICAL_SECTION_END
+#define CRITICAL_SECTION_START()
+#define CRITICAL_SECTION_END()
#define ISRS_ENABLED()
#define ENABLE_ISRS()
#define DISABLE_ISRS()
@@ -87,15 +86,16 @@ int freeMemory();
#pragma GCC diagnostic pop
// ADC
-#define HAL_ANALOG_SELECT(pin) HAL_adc_enable_channel(pin)
-#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
-#define HAL_ADC_RESOLUTION 10
-#define HAL_READ_ADC() HAL_adc_get_result()
-#define HAL_ADC_READY() true
+#define HAL_ADC_VREF 5.0
+#define HAL_ADC_RESOLUTION 10
+#define HAL_ANALOG_SELECT(ch) HAL_adc_enable_channel(ch)
+#define HAL_START_ADC(ch) HAL_adc_start_conversion(ch)
+#define HAL_READ_ADC() HAL_adc_get_result()
+#define HAL_ADC_READY() true
void HAL_adc_init();
-void HAL_adc_enable_channel(int pin);
-void HAL_adc_start_conversion(const uint8_t adc_pin);
+void HAL_adc_enable_channel(const uint8_t ch);
+void HAL_adc_start_conversion(const uint8_t ch);
uint16_t HAL_adc_get_result();
// Reset source
@@ -106,3 +106,8 @@ inline uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; }
FORCE_INLINE static void DELAY_CYCLES(uint64_t x) {
Clock::delayCycles(x);
}
+
+// Add strcmp_P if missing
+#ifndef strcmp_P
+ #define strcmp_P(a, b) strcmp((a), (b))
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/arduino.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/arduino.cpp
similarity index 83%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/arduino.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/arduino.cpp
index 88128dd9..4b56d02a 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/arduino.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/arduino.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __PLAT_LINUX__
#include
@@ -76,20 +75,6 @@ uint16_t analogRead(pin_t adc_pin) {
return Gpio::get(DIGITAL_PIN_TO_ANALOG_PIN(adc_pin));
}
-// **************************
-// Persistent Config Storage
-// **************************
-
-void eeprom_write_byte(unsigned char *pos, unsigned char value) {
-
-}
-
-unsigned char eeprom_read_byte(uint8_t * pos) { return '\0'; }
-
-void eeprom_read_block(void *__dst, const void *__src, size_t __n) { }
-
-void eeprom_update_block(const void *__src, void *__dst, size_t __n) { }
-
char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s) {
char format_string[20];
snprintf(format_string, 20, "%%%d.%df", __width, __prec);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/persistent_store_impl.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/eeprom.cpp
similarity index 83%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/persistent_store_impl.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/eeprom.cpp
index c4965d90..967ca851 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/persistent_store_impl.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/eeprom.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,23 +16,27 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __PLAT_LINUX__
#include "../../inc/MarlinConfig.h"
#if ENABLED(EEPROM_SETTINGS)
-#include "../shared/persistent_store_api.h"
+#include "../shared/eeprom_api.h"
#include
-#define LINUX_EEPROM_SIZE (E2END + 1)
-uint8_t buffer[LINUX_EEPROM_SIZE];
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE 0x1000 // 4KB of Emulated EEPROM
+#endif
+
+uint8_t buffer[MARLIN_EEPROM_SIZE];
char filename[] = "eeprom.dat";
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+
bool PersistentStore::access_start() {
const char eeprom_erase_value = 0xFF;
FILE * eeprom_file = fopen(filename, "rb");
@@ -41,8 +45,8 @@ bool PersistentStore::access_start() {
fseek(eeprom_file, 0L, SEEK_END);
std::size_t file_size = ftell(eeprom_file);
- if (file_size < LINUX_EEPROM_SIZE) {
- memset(buffer + file_size, eeprom_erase_value, LINUX_EEPROM_SIZE - file_size);
+ if (file_size < MARLIN_EEPROM_SIZE) {
+ memset(buffer + file_size, eeprom_erase_value, MARLIN_EEPROM_SIZE - file_size);
}
else {
fseek(eeprom_file, 0L, SEEK_SET);
@@ -96,7 +100,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin
return bytes_read != size; // return true for any error
}
-size_t PersistentStore::capacity() { return 4096; } // 4KiB of Emulated EEPROM
-
#endif // EEPROM_SETTINGS
#endif // __PLAT_LINUX__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/fastio.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/fastio.h
similarity index 93%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/fastio.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/fastio.h
index 5c2d6fcb..4567c62a 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/fastio.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/fastio.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -44,7 +44,7 @@
*
* Now you can simply SET_OUTPUT(STEP); WRITE(STEP, HIGH); WRITE(STEP, LOW);
*
- * Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
+ * Why double up on these macros? see https://gcc.gnu.org/onlinedocs/gcc-4.8.5/cpp/Stringification.html
*/
/// Read a pin
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Clock.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Clock.cpp
similarity index 87%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Clock.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Clock.cpp
index 39dd3d1b..1984a4a4 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Clock.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Clock.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __PLAT_LINUX__
#include "../../../inc/MarlinConfig.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Clock.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Clock.h
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Clock.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Clock.h
index e61051a0..072eacfd 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Clock.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Clock.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Gpio.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Gpio.cpp
similarity index 86%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Gpio.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Gpio.cpp
index aced7281..61a7be7d 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Gpio.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Gpio.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __PLAT_LINUX__
#include "Gpio.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Gpio.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Gpio.h
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Gpio.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Gpio.h
index 37f3bc7a..9255ec1d 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Gpio.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Gpio.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Heater.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Heater.cpp
similarity index 91%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Heater.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Heater.cpp
index 59da64d3..70df8161 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Heater.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Heater.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __PLAT_LINUX__
#include "Clock.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Heater.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Heater.h
similarity index 89%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Heater.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Heater.h
index e0c250f6..b17078d0 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Heater.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Heater.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/IOLoggerCSV.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/IOLoggerCSV.cpp
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/IOLoggerCSV.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/IOLoggerCSV.cpp
index 675afd4a..c11fd1f5 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/IOLoggerCSV.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/IOLoggerCSV.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __PLAT_LINUX__
#include "IOLoggerCSV.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/IOLoggerCSV.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/IOLoggerCSV.h
similarity index 88%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/IOLoggerCSV.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/IOLoggerCSV.h
index afc21259..d8fe7383 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/IOLoggerCSV.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/IOLoggerCSV.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/LinearAxis.cpp
similarity index 93%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/LinearAxis.cpp
index df133e9e..c5b3ccc9 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/LinearAxis.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __PLAT_LINUX__
#include
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/LinearAxis.h
similarity index 89%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/LinearAxis.h
index 1e8e887d..34541e79 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/LinearAxis.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Timer.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Timer.cpp
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Timer.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Timer.cpp
index 1c930cfc..9f0d6a8f 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Timer.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Timer.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __PLAT_LINUX__
#include "Timer.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Timer.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Timer.h
similarity index 94%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Timer.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Timer.h
index 740d8ef4..757efdcd 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/hardware/Timer.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/hardware/Timer.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/inc/Conditionals_LCD.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/inc/Conditionals_LCD.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/inc/Conditionals_LCD.h
index 85f26f40..5f1c4b16 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_DUE/inc/Conditionals_LCD.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/inc/Conditionals_LCD.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/inc/Conditionals_adv.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_adv.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/inc/Conditionals_adv.h
index 85f26f40..5f1c4b16 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_adv.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/inc/Conditionals_adv.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/inc/Conditionals_post.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/inc/Conditionals_post.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/inc/Conditionals_post.h
index 85f26f40..5f1c4b16 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_AVR/inc/Conditionals_post.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/inc/Conditionals_post.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/inc/SanityCheck.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/inc/SanityCheck.h
similarity index 82%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/inc/SanityCheck.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/inc/SanityCheck.h
index 776fa2f1..8d23cdab 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/inc/SanityCheck.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/inc/SanityCheck.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -33,3 +33,7 @@
#if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform."
#endif
+
+#if HAS_TMC_SW_SERIAL
+ #error "TMC220x Software Serial is not supported on this platform."
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/include/Arduino.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/include/Arduino.h
similarity index 88%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/include/Arduino.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/include/Arduino.h
index 13a8206e..e28b474e 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/include/Arduino.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/include/Arduino.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -106,12 +106,6 @@ bool digitalRead(pin_t);
void analogWrite(pin_t, int);
uint16_t analogRead(pin_t);
-// EEPROM
-void eeprom_write_byte(unsigned char *pos, unsigned char value);
-unsigned char eeprom_read_byte(unsigned char *pos);
-void eeprom_read_block(void *__dst, const void *__src, size_t __n);
-void eeprom_update_block(const void *__src, void *__dst, size_t __n);
-
int32_t random(int32_t);
int32_t random(int32_t, int32_t);
void randomSeed(uint32_t);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/include/pinmapping.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/include/pinmapping.cpp
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/include/pinmapping.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/include/pinmapping.cpp
index a4ddb1b1..870ab3a9 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/include/pinmapping.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/include/pinmapping.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __PLAT_LINUX__
#include
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/include/pinmapping.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/include/pinmapping.h
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/include/pinmapping.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/include/pinmapping.h
index a24f0b3e..98f4b812 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/include/pinmapping.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/include/pinmapping.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/include/serial.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/include/serial.h
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/include/serial.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/include/serial.h
index c6da82ad..154e95ae 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/include/serial.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/include/serial.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,14 +16,14 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(EMERGENCY_PARSER)
- #include "../../../feature/emergency_parser.h"
+ #include "../../../feature/e_parser.h"
#endif
#include
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/main.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/main.cpp
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/main.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/main.cpp
index 4231affb..4eeef318 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/main.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/main.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -14,10 +14,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __PLAT_LINUX__
extern void setup();
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/pinsDebug.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/pinsDebug.h
similarity index 93%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/pinsDebug.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/pinsDebug.h
index a28d2b60..a93ceddc 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/pinsDebug.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/pinsDebug.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/servo_private.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/servo_private.h
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/servo_private.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/servo_private.h
index 2aba9a37..122cfef3 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/servo_private.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/servo_private.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/spi_pins.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/spi_pins.h
similarity index 85%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/spi_pins.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/spi_pins.h
index fdd09b1c..a444196f 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/spi_pins.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/spi_pins.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -24,7 +24,7 @@
#include "../../core/macros.h"
#include "../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_LCD && ENABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
+#if BOTH(HAS_GRAPHICAL_LCD, SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
#define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode required for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/timers.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/timers.cpp
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/timers.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/timers.cpp
index f293d7f4..66d80f25 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/timers.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/timers.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
*
@@ -16,16 +16,14 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __PLAT_LINUX__
#include "hardware/Timer.h"
#include "../../inc/MarlinConfig.h"
-#include "timers.h"
/**
* Use POSIX signals to attempt to emulate Interrupts
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/timers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/timers.h
similarity index 83%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/timers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/timers.h
index 8022aabd..1beaea95 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/timers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/timers.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -37,9 +37,15 @@ typedef uint32_t hal_timer_t;
#define HAL_TIMER_RATE ((SystemCoreClock) / 4) // frequency of timers peripherals
-#define STEP_TIMER_NUM 0 // Timer Index for Stepper
-#define TEMP_TIMER_NUM 1 // Timer Index for Temperature
-#define PULSE_TIMER_NUM STEP_TIMER_NUM
+#ifndef STEP_TIMER_NUM
+ #define STEP_TIMER_NUM 0 // Timer Index for Stepper
+#endif
+#ifndef PULSE_TIMER_NUM
+ #define PULSE_TIMER_NUM STEP_TIMER_NUM
+#endif
+#ifndef TEMP_TIMER_NUM
+ #define TEMP_TIMER_NUM 1 // Timer Index for Temperature
+#endif
#define TEMP_TIMER_RATE 1000000
#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
@@ -59,8 +65,12 @@ typedef uint32_t hal_timer_t;
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
-#define HAL_STEP_TIMER_ISR() extern "C" void TIMER0_IRQHandler()
-#define HAL_TEMP_TIMER_ISR() extern "C" void TIMER1_IRQHandler()
+#ifndef HAL_STEP_TIMER_ISR
+ #define HAL_STEP_TIMER_ISR() extern "C" void TIMER0_IRQHandler()
+#endif
+#ifndef HAL_TEMP_TIMER_ISR
+ #define HAL_TEMP_TIMER_ISR() extern "C" void TIMER1_IRQHandler()
+#endif
// PWM timer
#define HAL_PWM_TIMER
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/watchdog.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/watchdog.cpp
similarity index 86%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/watchdog.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/watchdog.cpp
index 6338ea3b..c15b0e31 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/watchdog.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/watchdog.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __PLAT_LINUX__
#include "../../inc/MarlinConfig.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/watchdog.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/watchdog.h
similarity index 85%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/watchdog.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/watchdog.h
index 51d30c84..472624cc 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/watchdog.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LINUX/watchdog.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/DebugMonitor.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/DebugMonitor.cpp
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/DebugMonitor.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/DebugMonitor.cpp
index fefee386..783b10cf 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/DebugMonitor.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/DebugMonitor.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef TARGET_LPC1768
#include "../../core/macros.h"
@@ -199,14 +198,19 @@ void HardFault_HandlerC(unsigned long *sp, unsigned long lr, unsigned long cause
// Clear cause of reset to prevent entering smoothie bootstrap
HAL_clear_reset_source();
+
// Restart watchdog
- //WDT_Restart(WDT);
- watchdog_init();
+ #if ENABLED(USE_WATCHDOG)
+ //WDT_Restart(WDT);
+ watchdog_init();
+ #endif
// Reset controller
NVIC_SystemReset();
- for (;;) watchdog_init();
+ // Nothing below here is compiled because NVIC_SystemReset loops forever
+
+ for (;;) { TERN_(USE_WATCHDOG, watchdog_init()); }
}
extern "C" {
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/HAL.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/HAL.cpp
similarity index 88%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/HAL.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/HAL.cpp
index 4da55c2f..939f1e8a 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/HAL.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/HAL.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef TARGET_LPC1768
#include "../../inc/MarlinConfig.h"
@@ -67,14 +66,10 @@ int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) {
return ind > -1 ? ind : dval;
}
-void flashFirmware(int16_t value) {
- NVIC_SystemReset();
-}
+void flashFirmware(const int16_t) { NVIC_SystemReset(); }
void HAL_clear_reset_source(void) {
- #if ENABLED(USE_WATCHDOG)
- watchdog_clear_timeout_flag();
- #endif
+ TERN_(USE_WATCHDOG, watchdog_clear_timeout_flag());
}
uint8_t HAL_get_reset_source(void) {
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/HAL.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/HAL.h
similarity index 77%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/HAL.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/HAL.h
index 16489054..0153bacf 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/HAL.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/HAL.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
*
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -41,13 +41,15 @@ extern "C" volatile uint32_t _millis;
#include "../shared/HAL_SPI.h"
#include "fastio.h"
#include "watchdog.h"
-#include "timers.h"
#include "MarlinSerial.h"
#include
#include
#include
+// i2c uses 8-bit shifted address
+#define I2C_ADDRESS(A) uint8_t((A) << 1)
+
//
// Default graphical display delays
//
@@ -61,10 +63,6 @@ extern "C" volatile uint32_t _millis;
#define ST7920_DELAY_3 DELAY_NS(750)
#endif
-#if !WITHIN(SERIAL_PORT, -1, 3)
- #error "SERIAL_PORT must be from -1 to 3"
-#endif
-
#if SERIAL_PORT == -1
#define MYSERIAL0 UsbSerial
#elif SERIAL_PORT == 0
@@ -75,16 +73,14 @@ extern "C" volatile uint32_t _millis;
#define MYSERIAL0 MSerial2
#elif SERIAL_PORT == 3
#define MYSERIAL0 MSerial3
+#else
+ #error "SERIAL_PORT must be from -1 to 3. Please update your configuration."
#endif
#ifdef SERIAL_PORT_2
- #if !WITHIN(SERIAL_PORT_2, -1, 3)
- #error "SERIAL_PORT_2 must be from -1 to 3"
- #elif SERIAL_PORT_2 == SERIAL_PORT
- #error "SERIAL_PORT_2 must be different than SERIAL_PORT"
- #endif
- #define NUM_SERIAL 2
- #if SERIAL_PORT_2 == -1
+ #if SERIAL_PORT_2 == SERIAL_PORT
+ #error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
+ #elif SERIAL_PORT_2 == -1
#define MYSERIAL1 UsbSerial
#elif SERIAL_PORT_2 == 0
#define MYSERIAL1 MSerial
@@ -94,16 +90,39 @@ extern "C" volatile uint32_t _millis;
#define MYSERIAL1 MSerial2
#elif SERIAL_PORT_2 == 3
#define MYSERIAL1 MSerial3
+ #else
+ #error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
#endif
+ #define NUM_SERIAL 2
#else
#define NUM_SERIAL 1
#endif
+#ifdef DGUS_SERIAL_PORT
+ #if DGUS_SERIAL_PORT == SERIAL_PORT
+ #error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
+ #elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
+ #error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
+ #elif DGUS_SERIAL_PORT == -1
+ #define DGUS_SERIAL UsbSerial
+ #elif DGUS_SERIAL_PORT == 0
+ #define DGUS_SERIAL MSerial
+ #elif DGUS_SERIAL_PORT == 1
+ #define DGUS_SERIAL MSerial1
+ #elif DGUS_SERIAL_PORT == 2
+ #define DGUS_SERIAL MSerial2
+ #elif DGUS_SERIAL_PORT == 3
+ #define DGUS_SERIAL MSerial3
+ #else
+ #error "DGUS_SERIAL_PORT must be from -1 to 3. Please update your configuration."
+ #endif
+#endif
+
//
// Interrupts
//
-#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq()
-#define CRITICAL_SECTION_END if (!primask) __enable_irq()
+#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq()
+#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
#define ISRS_ENABLED() (!__get_PRIMASK())
#define ENABLE_ISRS() __enable_irq()
#define DISABLE_ISRS() __disable_irq()
@@ -131,6 +150,8 @@ int freeMemory();
// K = 6, 565 samples, 500Hz sample rate, 1.13s convergence on full range step
// Memory usage per ADC channel (bytes): 4 (32 Bytes for 8 channels)
+#define HAL_ADC_VREF 3.3 // ADC voltage reference
+
#define HAL_ADC_RESOLUTION 12 // 15 bit maximum, raw temperature is stored as int16_t
#define HAL_ADC_FILTERED // Disable oversampling done in Marlin as ADC values already filtered in HAL
@@ -178,7 +199,9 @@ int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);
void HAL_idletask();
#define PLATFORM_M997_SUPPORT
-void flashFirmware(int16_t value);
+void flashFirmware(const int16_t);
+
+#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment
/**
* set_pwm_frequency
@@ -199,3 +222,8 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255,
// Reset source
void HAL_clear_reset_source(void);
uint8_t HAL_get_reset_source(void);
+
+// Add strcmp_P if missing
+#ifndef strcmp_P
+ #define strcmp_P(a, b) strcmp((a), (b))
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/HAL_SPI.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/HAL_SPI.cpp
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/HAL_SPI.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/HAL_SPI.cpp
index 5f32c787..e34a1020 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/HAL_SPI.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/HAL_SPI.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -209,11 +209,11 @@
}
-#endif // ENABLED(LPC_SOFTWARE_SPI)
+#endif // LPC_SOFTWARE_SPI
void SPIClass::begin() { spiBegin(); }
-void SPIClass::beginTransaction(SPISettings cfg) {
+void SPIClass::beginTransaction(const SPISettings &cfg) {
uint8_t spiRate;
switch (cfg.spiRate()) {
case 8000000: spiRate = 0; break;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/MarlinSerial.cpp
similarity index 74%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/MarlinSerial.cpp
index a8778f74..c3fb3bd0 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/MarlinSerial.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,37 +16,36 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef TARGET_LPC1768
#include "../../inc/MarlinConfigPre.h"
#include "MarlinSerial.h"
-#if (defined(SERIAL_PORT) && SERIAL_PORT == 0) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 0)
+#if (defined(SERIAL_PORT) && SERIAL_PORT == 0) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 0) || (defined(DGUS_SERIAL_PORT) && DGUS_SERIAL_PORT == 0)
MarlinSerial MSerial(LPC_UART0);
extern "C" void UART0_IRQHandler() {
MSerial.IRQHandler();
}
#endif
-#if (defined(SERIAL_PORT) && SERIAL_PORT == 1) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 1)
+#if SERIAL_PORT == 1 || SERIAL_PORT_2 == 1 || DGUS_SERIAL_PORT == 1
MarlinSerial MSerial1((LPC_UART_TypeDef *) LPC_UART1);
extern "C" void UART1_IRQHandler() {
MSerial1.IRQHandler();
}
#endif
-#if (defined(SERIAL_PORT) && SERIAL_PORT == 2) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 2)
+#if SERIAL_PORT == 2 || SERIAL_PORT_2 == 2 || DGUS_SERIAL_PORT == 2
MarlinSerial MSerial2(LPC_UART2);
extern "C" void UART2_IRQHandler() {
MSerial2.IRQHandler();
}
#endif
-#if (defined(SERIAL_PORT) && SERIAL_PORT == 3) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 3)
+#if SERIAL_PORT == 3 || SERIAL_PORT_2 == 3 || DGUS_SERIAL_PORT == 3
MarlinSerial MSerial3(LPC_UART3);
extern "C" void UART3_IRQHandler() {
MSerial3.IRQHandler();
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/MarlinSerial.h
similarity index 86%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/MarlinSerial.h
index 80506855..98ce73d3 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/MarlinSerial.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -26,7 +26,7 @@
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(EMERGENCY_PARSER)
- #include "../../feature/emergency_parser.h"
+ #include "../../feature/e_parser.h"
#endif
#ifndef SERIAL_PORT
@@ -44,10 +44,9 @@ class MarlinSerial : public HardwareSerial {
MarlinSerial(LPC_UART_TypeDef *UARTx) :
HardwareSerial(UARTx)
#if ENABLED(EMERGENCY_PARSER)
- , emergency_state(EmergencyParser::State::EP_RESET)
+ , emergency_state(EmergencyParser::State::EP_RESET)
#endif
- {
- }
+ { }
void end() {}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/Servo.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/Servo.h
similarity index 91%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/Servo.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/Servo.h
index 1bbf84c7..e953cb92 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/Servo.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/Servo.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -60,9 +60,7 @@ class libServo: public Servo {
if (attach(servo_info[servoIndex].Pin.nbr) >= 0) { // try to reattach
write(value);
safe_delay(servo_delay[servoIndex]); // delay to allow servo to reach position
- #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- detach();
- #endif
+ TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
}
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/eeprom_flash.cpp
similarity index 80%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/eeprom_flash.cpp
index 3de02022..25584863 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/eeprom_flash.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#ifdef TARGET_LPC1768
@@ -36,31 +36,33 @@
* 16Kb I/O buffers (intended to hold DMA USB and Ethernet data, but currently
* unused).
*/
-#include "../../inc/MarlinConfigPre.h"
-
-#if ENABLED(EEPROM_SETTINGS)
-
-#include "persistent_store_api.h"
#include "../../inc/MarlinConfig.h"
#if ENABLED(FLASH_EEPROM_EMULATION)
+#include "../shared/eeprom_api.h"
+
extern "C" {
#include
}
-#define SECTOR_START(sector) ((sector < 16) ? (sector * 0x1000) : ((sector - 14) * 0x8000))
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE 0x1000 // 4KB
+#endif
+
+#define SECTOR_START(sector) ((sector < 16) ? (sector << 12) : ((sector - 14) << 15))
#define EEPROM_SECTOR 29
-#define EEPROM_SIZE (4096)
-#define SECTOR_SIZE (32768)
-#define EEPROM_SLOTS (SECTOR_SIZE/EEPROM_SIZE)
-#define EEPROM_ERASE (0xFF)
-#define SLOT_ADDRESS(sector, slot) (((uint8_t *)SECTOR_START(sector)) + slot * EEPROM_SIZE)
+#define SECTOR_SIZE 32768
+#define EEPROM_SLOTS ((SECTOR_SIZE)/(MARLIN_EEPROM_SIZE))
+#define EEPROM_ERASE 0xFF
+#define SLOT_ADDRESS(sector, slot) (((uint8_t *)SECTOR_START(sector)) + slot * (MARLIN_EEPROM_SIZE))
-static uint8_t ram_eeprom[EEPROM_SIZE] __attribute__((aligned(4))) = {0};
+static uint8_t ram_eeprom[MARLIN_EEPROM_SIZE] __attribute__((aligned(4))) = {0};
static bool eeprom_dirty = false;
static int current_slot = 0;
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+
bool PersistentStore::access_start() {
uint32_t first_nblank_loc, first_nblank_val;
IAP_STATUS_CODE status;
@@ -72,15 +74,15 @@ bool PersistentStore::access_start() {
if (status == CMD_SUCCESS) {
// sector is blank so nothing stored yet
- for (int i = 0; i < EEPROM_SIZE; i++) ram_eeprom[i] = EEPROM_ERASE;
+ for (int i = 0; i < MARLIN_EEPROM_SIZE; i++) ram_eeprom[i] = EEPROM_ERASE;
current_slot = EEPROM_SLOTS;
}
else {
// current slot is the first non blank one
- current_slot = first_nblank_loc / EEPROM_SIZE;
+ current_slot = first_nblank_loc / (MARLIN_EEPROM_SIZE);
uint8_t *eeprom_data = SLOT_ADDRESS(EEPROM_SECTOR, current_slot);
// load current settings
- for (int i = 0; i < EEPROM_SIZE; i++) ram_eeprom[i] = eeprom_data[i];
+ for (int i = 0; i < MARLIN_EEPROM_SIZE; i++) ram_eeprom[i] = eeprom_data[i];
}
eeprom_dirty = false;
@@ -125,8 +127,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false; // return true for any error
}
-size_t PersistentStore::capacity() { return EEPROM_SIZE; }
-
#endif // FLASH_EEPROM_EMULATION
-#endif // EEPROM_SETTINGS
#endif // TARGET_LPC1768
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp
similarity index 88%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp
index 2454dea1..9f2475f4 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
@@ -17,19 +17,16 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#ifdef TARGET_LPC1768
-#include "../../inc/MarlinConfigPre.h"
-
-#if ENABLED(EEPROM_SETTINGS)
-
#include "../../inc/MarlinConfig.h"
-#include "persistent_store_api.h"
-#if DISABLED(FLASH_EEPROM_EMULATION)
+#if ENABLED(SDCARD_EEPROM_EMULATION)
+
+#include "../shared/eeprom_api.h"
#include
#include
@@ -41,6 +38,11 @@ FATFS fat_fs;
FIL eeprom_file;
bool eeprom_file_open = false;
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE size_t(0x1000) // 4KiB of Emulated EEPROM
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+
bool PersistentStore::access_start() {
const char eeprom_erase_value = 0xFF;
MSC_Aquire_Lock();
@@ -82,21 +84,16 @@ static void debug_rw(const bool write, int &pos, const uint8_t *value, const siz
PGM_P const rw_str = write ? PSTR("write") : PSTR("read");
SERIAL_CHAR(' ');
serialprintPGM(rw_str);
- SERIAL_ECHOPAIR("_data(", pos);
- SERIAL_ECHOPAIR(",", (int)value);
- SERIAL_ECHOPAIR(",", (int)size);
- SERIAL_ECHOLNPGM(", ...)");
+ SERIAL_ECHOLNPAIR("_data(", pos, ",", int(value), ",", int(size), ", ...)");
if (total) {
SERIAL_ECHOPGM(" f_");
serialprintPGM(rw_str);
- SERIAL_ECHOPAIR("()=", (int)s);
- SERIAL_ECHOPAIR("\n size=", size);
- SERIAL_ECHOPGM("\n bytes_");
+ SERIAL_ECHOPAIR("()=", int(s), "\n size=", int(size), "\n bytes_");
serialprintPGM(write ? PSTR("written=") : PSTR("read="));
SERIAL_ECHOLN(total);
}
else
- SERIAL_ECHOLNPAIR(" f_lseek()=", (int)s);
+ SERIAL_ECHOLNPAIR(" f_lseek()=", int(s));
}
// File function return codes for type FRESULT. This goes away soon, but
@@ -176,8 +173,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin
return bytes_read != size; // return true for any error
}
-size_t PersistentStore::capacity() { return 4096; } // 4KiB of Emulated EEPROM
-
-#endif // !FLASH_EEPROM_EMULATION
-#endif // EEPROM_SETTINGS
+#endif // SDCARD_EEPROM_EMULATION
#endif // TARGET_LPC1768
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/eeprom_wired.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/eeprom_wired.cpp
new file mode 100644
index 00000000..16c15eaf
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/eeprom_wired.cpp
@@ -0,0 +1,81 @@
+/**
+ * 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 .
+ *
+ */
+#ifdef TARGET_LPC1768
+
+#include "../../inc/MarlinConfig.h"
+
+#if USE_WIRED_EEPROM
+
+/**
+ * PersistentStore for Arduino-style EEPROM interface
+ * with implementations supplied by the framework.
+ */
+
+#include "../shared/eeprom_if.h"
+#include "../shared/eeprom_api.h"
+
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE 0x8000 // 32KB
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+
+bool PersistentStore::access_start() { eeprom_init(); return true; }
+bool PersistentStore::access_finish() { return true; }
+
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
+ while (size--) {
+ uint8_t v = *value;
+
+ // EEPROM has only ~100,000 write cycles,
+ // so only write bytes that have changed!
+ uint8_t * const p = (uint8_t * const)pos;
+ if (v != eeprom_read_byte(p)) {
+ eeprom_write_byte(p, v);
+ if (eeprom_read_byte(p) != v) {
+ SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
+ return true;
+ }
+ }
+
+ crc16(crc, &v, 1);
+ pos++;
+ value++;
+ };
+
+ return false;
+}
+
+bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
+ do {
+ // Read from external EEPROM
+ const uint8_t c = eeprom_read_byte((uint8_t*)pos);
+
+ if (writing) *value = c;
+ crc16(crc, &c, 1);
+ pos++;
+ value++;
+ } while (--size);
+ return false;
+}
+
+#endif // USE_WIRED_EEPROM
+#endif // TARGET_LPC1768
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/endstop_interrupts.h
similarity index 87%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/endstop_interrupts.h
index f1d4fc75..b0d0c0ec 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/endstop_interrupts.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -93,7 +93,7 @@ void setup_endstop_interrupts() {
_ATTACH(Z2_MIN_PIN);
#endif
#if HAS_Z3_MAX
- #if !LPC1768_PIN_INTERRUPT_M(Z3_MIN_PIN)
+ #if !LPC1768_PIN_INTERRUPT_M(Z3_MAX_PIN)
#error "Z3_MIN_PIN is not INTERRUPT-capable."
#endif
_ATTACH(Z3_MAX_PIN);
@@ -104,6 +104,18 @@ void setup_endstop_interrupts() {
#endif
_ATTACH(Z3_MIN_PIN);
#endif
+ #if HAS_Z4_MAX
+ #if !LPC1768_PIN_INTERRUPT_M(Z4_MAX_PIN)
+ #error "Z4_MIN_PIN is not INTERRUPT-capable."
+ #endif
+ _ATTACH(Z4_MAX_PIN);
+ #endif
+ #if HAS_Z4_MIN
+ #if !LPC1768_PIN_INTERRUPT_M(Z4_MIN_PIN)
+ #error "Z4_MIN_PIN is not INTERRUPT-capable."
+ #endif
+ _ATTACH(Z4_MIN_PIN);
+ #endif
#if HAS_Z_MIN_PROBE_PIN
#if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PROBE_PIN)
#error "Z_MIN_PROBE_PIN is not INTERRUPT-capable."
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/fast_pwm.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/fast_pwm.cpp
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/fast_pwm.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/fast_pwm.cpp
index 6c7de9bb..46507ac0 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/fast_pwm.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/fast_pwm.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,15 +16,14 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef TARGET_LPC1768
#include "../../inc/MarlinConfigPre.h"
-#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_PWM
+#if NEEDS_HARDWARE_PWM // Specific meta-flag for features that mandate PWM
#include
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/fastio.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/fastio.h
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/fastio.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/fastio.h
index 8b90ec20..c553ffb1 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/fastio.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/fastio.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -56,7 +56,7 @@
*
* Now you can simply SET_OUTPUT(STEP); WRITE(STEP, HIGH); WRITE(STEP, LOW);
*
- * Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
+ * Why double up on these macros? see https://gcc.gnu.org/onlinedocs/gcc-4.8.5/cpp/Stringification.html
*/
/// Read a pin
@@ -104,7 +104,7 @@
/// set pin as output wrapper - reads the pin and sets the output to that value
#define SET_OUTPUT(IO) do{ _WRITE(IO, _READ(IO)); _SET_OUTPUT(IO); }while(0)
// set pin as PWM
-#define SET_PWM(IO) SET_OUTPUT(IO)
+#define SET_PWM SET_OUTPUT
/// check if pin is an input wrapper
#define IS_INPUT(IO) _IS_INPUT(IO)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/Conditionals_LCD.h
new file mode 100644
index 00000000..5f1c4b16
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/Conditionals_LCD.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/Conditionals_adv.h
new file mode 100644
index 00000000..5f1c4b16
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/Conditionals_adv.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/Conditionals_post.h
new file mode 100644
index 00000000..ce6d3fdd
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/Conditionals_post.h
@@ -0,0 +1,28 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#if USE_FALLBACK_EEPROM
+ #define FLASH_EEPROM_EMULATION
+#elif EITHER(I2C_EEPROM, SPI_EEPROM)
+ #define USE_SHARED_EEPROM 1
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/SanityCheck.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/SanityCheck.h
new file mode 100644
index 00000000..96453896
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/inc/SanityCheck.h
@@ -0,0 +1,259 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#if PIO_PLATFORM_VERSION < 1001
+ #error "nxplpc-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries. You may need to remove the platform and let it reinstall automatically."
+#endif
+#if PIO_FRAMEWORK_VERSION < 2002
+ #error "framework-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries."
+#endif
+
+/**
+ * Detect an old pins file by checking for old ADC pins values.
+ */
+#define _OLD_TEMP_PIN(P) PIN_EXISTS(P) && _CAT(P,_PIN) <= 7 && _CAT(P,_PIN) != 2 && _CAT(P,_PIN) != 3
+#if _OLD_TEMP_PIN(TEMP_BED)
+ #error "TEMP_BED_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
+#elif _OLD_TEMP_PIN(TEMP_0)
+ #error "TEMP_0_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
+#elif _OLD_TEMP_PIN(TEMP_1)
+ #error "TEMP_1_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
+#elif _OLD_TEMP_PIN(TEMP_2)
+ #error "TEMP_2_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
+#elif _OLD_TEMP_PIN(TEMP_3)
+ #error "TEMP_3_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
+#elif _OLD_TEMP_PIN(TEMP_4)
+ #error "TEMP_4_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
+#elif _OLD_TEMP_PIN(TEMP_5)
+ #error "TEMP_5_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
+#elif _OLD_TEMP_PIN(TEMP_6)
+ #error "TEMP_6_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
+#elif _OLD_TEMP_PIN(TEMP_7)
+ #error "TEMP_7_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
+#endif
+#undef _OLD_TEMP_PIN
+
+/**
+ * Because PWM hardware channels all share the same frequency, along with the
+ * fallback software channels, FAST_PWM_FAN is incompatible with Servos.
+ */
+static_assert(!(NUM_SERVOS && ENABLED(FAST_PWM_FAN)), "BLTOUCH and Servos are incompatible with FAST_PWM_FAN on LPC176x boards.");
+
+/**
+ * Test LPC176x-specific configuration values for errors at compile-time.
+ */
+
+//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
+// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
+//#endif
+
+#if MB(RAMPS_14_RE_ARM_EFB, RAMPS_14_RE_ARM_EEB, RAMPS_14_RE_ARM_EFF, RAMPS_14_RE_ARM_EEF, RAMPS_14_RE_ARM_SF)
+ #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && HAS_DRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI)
+ #error "Re-ARM with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and TMC2130 requires TMC_USE_SW_SPI."
+ #endif
+#endif
+
+static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported on LPC176x.");
+
+/**
+ * Flag any serial port conflicts
+ *
+ * Port | TX | RX |
+ * --- | --- | --- |
+ * Serial | P0_02 | P0_03 |
+ * Serial1 | P0_15 | P0_16 |
+ * Serial2 | P0_10 | P0_11 |
+ * Serial3 | P0_00 | P0_01 |
+ */
+#if (defined(SERIAL_PORT) && SERIAL_PORT == 0) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 0) || (defined(DGUS_SERIAL_PORT) && DGUS_SERIAL_PORT == 0)
+ #define IS_TX0(P) (P == P0_02)
+ #define IS_RX0(P) (P == P0_03)
+ #if IS_TX0(TMC_SW_MISO) || IS_RX0(TMC_SW_MOSI)
+ #error "Serial port pins (0) conflict with Trinamic SPI pins!"
+ #elif ENABLED(MK2_MULTIPLEXER) && (IS_TX0(E_MUX1_PIN) || IS_RX0(E_MUX0_PIN))
+ #error "Serial port pins (0) conflict with MK2 multiplexer pins!"
+ #elif (AXIS_HAS_SPI(X) && IS_TX0(X_CS_PIN)) || (AXIS_HAS_SPI(Y) && IS_RX0(Y_CS_PIN))
+ #error "Serial port pins (0) conflict with X/Y axis SPI pins!"
+ #endif
+ #undef IS_TX0
+ #undef IS_RX0
+#endif
+
+#if SERIAL_PORT == 1 || SERIAL_PORT_2 == 1 || DGUS_SERIAL_PORT == 1
+ #define IS_TX1(P) (P == P0_15)
+ #define IS_RX1(P) (P == P0_16)
+ #if IS_TX1(TMC_SW_SCK)
+ #error "Serial port pins (1) conflict with other pins!"
+ #elif HAS_SPI_LCD
+ #if IS_TX1(BTN_EN2) || IS_RX1(BTN_EN1)
+ #error "Serial port pins (1) conflict with Encoder Buttons!"
+ #elif IS_TX1(SCK_PIN) || IS_TX1(LCD_PINS_D4) || IS_TX1(DOGLCD_SCK) || IS_TX1(LCD_RESET_PIN) || IS_TX1(LCD_PINS_RS) || IS_TX1(SHIFT_CLK) \
+ || IS_RX1(LCD_SDSS) || IS_RX1(LCD_PINS_RS) || IS_RX1(MISO_PIN) || IS_RX1(DOGLCD_A0) || IS_RX1(SS_PIN) || IS_RX1(LCD_SDSS) || IS_RX1(DOGLCD_CS) || IS_RX1(LCD_RESET_PIN) || IS_RX1(LCD_BACKLIGHT_PIN)
+ #error "Serial port pins (1) conflict with LCD pins!"
+ #endif
+ #endif
+ #undef IS_TX1
+ #undef IS_RX1
+#endif
+
+#if SERIAL_PORT == 2 || SERIAL_PORT_2 == 2 || DGUS_SERIAL_PORT == 2
+ #define IS_TX2(P) (P == P0_10)
+ #define IS_RX2(P) (P == P0_11)
+ #if IS_TX2(X2_ENABLE_PIN) || IS_RX2(X2_DIR_PIN) || IS_RX2(X2_STEP_PIN) || (AXIS_HAS_SPI(X2) && IS_TX2(X2_CS_PIN))
+ #error "Serial port pins (2) conflict with X2 pins!"
+ #elif IS_TX2(Y2_ENABLE_PIN) || IS_RX2(Y2_DIR_PIN) || IS_RX2(Y2_STEP_PIN) || (AXIS_HAS_SPI(Y2) && IS_TX2(Y2_CS_PIN))
+ #error "Serial port pins (2) conflict with Y2 pins!"
+ #elif IS_TX2(Z2_ENABLE_PIN) || IS_RX2(Z2_DIR_PIN) || IS_RX2(Z2_STEP_PIN) || (AXIS_HAS_SPI(Z2) && IS_TX2(Z2_CS_PIN))
+ #error "Serial port pins (2) conflict with Z2 pins!"
+ #elif IS_TX2(Z3_ENABLE_PIN) || IS_RX2(Z3_DIR_PIN) || IS_RX2(Z3_STEP_PIN) || (AXIS_HAS_SPI(Z3) && IS_TX2(Z3_CS_PIN))
+ #error "Serial port pins (2) conflict with Z3 pins!"
+ #elif IS_TX2(Z4_ENABLE_PIN) || IS_RX2(Z4_DIR_PIN) || IS_RX2(Z4_STEP_PIN) || (AXIS_HAS_SPI(Z4) && IS_TX2(Z4_CS_PIN))
+ #error "Serial port pins (2) conflict with Z4 pins!"
+ #elif IS_RX2(X_DIR_PIN) || IS_RX2(Y_DIR_PIN)
+ #error "Serial port pins (2) conflict with other pins!"
+ #elif Y_HOME_DIR < 0 && IS_TX2(Y_STOP_PIN)
+ #error "Serial port pins (2) conflict with Y endstop pin!"
+ #elif HAS_CUSTOM_PROBE_PIN && IS_TX2(Z_MIN_PROBE_PIN)
+ #error "Serial port pins (2) conflict with probe pin!"
+ #elif IS_TX2(X_ENABLE_PIN) || IS_RX2(X_DIR_PIN) || IS_TX2(Y_ENABLE_PIN) || IS_RX2(Y_DIR_PIN)
+ #error "Serial port pins (2) conflict with X/Y stepper pins!"
+ #elif EXTRUDERS > 1 && (IS_TX2(E1_ENABLE_PIN) || (AXIS_HAS_SPI(E1) && IS_TX2(E1_CS_PIN)))
+ #error "Serial port pins (2) conflict with E1 stepper pins!"
+ #elif EXTRUDERS && (IS_RX2(E0_DIR_PIN) || IS_RX2(E0_STEP_PIN))
+ #error "Serial port pins (2) conflict with E stepper pins!"
+ #endif
+ #undef IS_TX2
+ #undef IS_RX2
+#endif
+
+#if SERIAL_PORT == 3 || SERIAL_PORT_2 == 3 || DGUS_SERIAL_PORT == 3
+ #define PIN_IS_TX3(P) (PIN_EXISTS(P) && P##_PIN == P0_00)
+ #define PIN_IS_RX3(P) (P##_PIN == P0_01)
+ #if PIN_IS_TX3(X_MIN) || PIN_IS_RX3(X_MAX)
+ #error "Serial port pins (3) conflict with X endstop pins!"
+ #elif PIN_IS_TX3(Y_SERIAL_TX) || PIN_IS_TX3(Y_SERIAL_RX) \
+ || PIN_IS_RX3(X_SERIAL_TX) || PIN_IS_RX3(X_SERIAL_RX)
+ #error "Serial port pins (3) conflict with X/Y axis UART pins!"
+ #elif PIN_IS_TX3(X2_DIR) || PIN_IS_RX3(X2_STEP)
+ #error "Serial port pins (3) conflict with X2 pins!"
+ #elif PIN_IS_TX3(Y2_DIR) || PIN_IS_RX3(Y2_STEP)
+ #error "Serial port pins (3) conflict with Y2 pins!"
+ #elif PIN_IS_TX3(Z2_DIR) || PIN_IS_RX3(Z2_STEP)
+ #error "Serial port pins (3) conflict with Z2 pins!"
+ #elif PIN_IS_TX3(Z3_DIR) || PIN_IS_RX3(Z3_STEP)
+ #error "Serial port pins (3) conflict with Z3 pins!"
+ #elif PIN_IS_TX3(Z4_DIR) || PIN_IS_RX3(Z4_STEP)
+ #error "Serial port pins (3) conflict with Z4 pins!"
+ #elif EXTRUDERS > 1 && (PIN_IS_TX3(E1_DIR) || PIN_IS_RX3(E1_STEP))
+ #error "Serial port pins (3) conflict with E1 pins!"
+ #endif
+ #undef PIN_IS_TX3
+ #undef PIN_IS_RX3
+#endif
+
+//
+// Flag any i2c pin conflicts
+//
+#if ANY(HAS_I2C_DIGIPOT, DAC_STEPPER_CURRENT, EXPERIMENTAL_I2CBUS, I2C_POSITION_ENCODERS, PCA9632, I2C_EEPROM)
+ #define USEDI2CDEV_M 1 // /Wire.cpp
+
+ #if USEDI2CDEV_M == 0 // P0_27 [D57] (AUX-1) .......... P0_28 [D58] (AUX-1)
+ #define PIN_IS_SDA0(P) (P##_PIN == P0_27)
+ #define IS_SCL0(P) (P == P0_28)
+ #if ENABLED(SDSUPPORT) && PIN_IS_SDA0(SD_DETECT)
+ #error "SDA0 overlaps with SD_DETECT_PIN!"
+ #elif PIN_IS_SDA0(E0_AUTO_FAN)
+ #error "SDA0 overlaps with E0_AUTO_FAN_PIN!"
+ #elif PIN_IS_SDA0(BEEPER)
+ #error "SDA0 overlaps with BEEPER_PIN!"
+ #elif IS_SCL0(BTN_ENC)
+ #error "SCL0 overlaps with Encoder Button!"
+ #elif IS_SCL0(SS_PIN)
+ #error "SCL0 overlaps with SS_PIN!"
+ #elif IS_SCL0(LCD_SDSS)
+ #error "SCL0 overlaps with LCD_SDSS!"
+ #endif
+ #undef PIN_IS_SDA0
+ #undef IS_SCL0
+ #elif USEDI2CDEV_M == 1 // P0_00 [D20] (SCA) ............ P0_01 [D21] (SCL)
+ #define PIN_IS_SDA1(P) (PIN_EXISTS(P) && P##_PIN == P0_00)
+ #define PIN_IS_SCL1(P) (P##_PIN == P0_01)
+ #if PIN_IS_SDA1(X_MIN) || PIN_IS_SCL1(X_MAX)
+ #error "One or more i2c (1) pins overlaps with X endstop pins! Disable i2c peripherals."
+ #elif PIN_IS_SDA1(X2_DIR) || PIN_IS_SCL1(X2_STEP)
+ #error "One or more i2c (1) pins overlaps with X2 pins! Disable i2c peripherals."
+ #elif PIN_IS_SDA1(Y2_DIR) || PIN_IS_SCL1(Y2_STEP)
+ #error "One or more i2c (1) pins overlaps with Y2 pins! Disable i2c peripherals."
+ #elif PIN_IS_SDA1(Z2_DIR) || PIN_IS_SCL1(Z2_STEP)
+ #error "One or more i2c (1) pins overlaps with Z2 pins! Disable i2c peripherals."
+ #elif PIN_IS_SDA1(Z3_DIR) || PIN_IS_SCL1(Z3_STEP)
+ #error "One or more i2c (1) pins overlaps with Z3 pins! Disable i2c peripherals."
+ #elif PIN_IS_SDA1(Z4_DIR) || PIN_IS_SCL1(Z4_STEP)
+ #error "One or more i2c (1) pins overlaps with Z4 pins! Disable i2c peripherals."
+ #elif EXTRUDERS > 1 && (PIN_IS_SDA1(E1_DIR) || PIN_IS_SCL1(E1_STEP))
+ #error "One or more i2c (1) pins overlaps with E1 pins! Disable i2c peripherals."
+ #endif
+ #undef PIN_IS_SDA1
+ #undef PIN_IS_SCL1
+ #elif USEDI2CDEV_M == 2 // P0_10 [D38] (X_ENABLE_PIN) ... P0_11 [D55] (X_DIR_PIN)
+ #define PIN_IS_SDA2(P) (P##_PIN == P0_10)
+ #define PIN_IS_SCL2(P) (P##_PIN == P0_11)
+ #if PIN_IS_SDA2(Y_STOP)
+ #error "i2c SDA2 overlaps with Y endstop pin!"
+ #elif HAS_CUSTOM_PROBE_PIN && PIN_IS_SDA2(Z_MIN_PROBE)
+ #error "i2c SDA2 overlaps with Z probe pin!"
+ #elif PIN_IS_SDA2(X_ENABLE) || PIN_IS_SDA2(Y_ENABLE)
+ #error "i2c SDA2 overlaps with X/Y ENABLE pin!"
+ #elif AXIS_HAS_SPI(X) && PIN_IS_SDA2(X_CS)
+ #error "i2c SDA2 overlaps with X CS pin!"
+ #elif PIN_IS_SDA2(X2_ENABLE)
+ #error "i2c SDA2 overlaps with X2 enable pin! Disable i2c peripherals."
+ #elif PIN_IS_SDA2(Y2_ENABLE)
+ #error "i2c SDA2 overlaps with Y2 enable pin! Disable i2c peripherals."
+ #elif PIN_IS_SDA2(Z2_ENABLE)
+ #error "i2c SDA2 overlaps with Z2 enable pin! Disable i2c peripherals."
+ #elif PIN_IS_SDA2(Z3_ENABLE)
+ #error "i2c SDA2 overlaps with Z3 enable pin! Disable i2c peripherals."
+ #elif PIN_IS_SDA2(Z4_ENABLE)
+ #error "i2c SDA2 overlaps with Z4 enable pin! Disable i2c peripherals."
+ #elif EXTRUDERS > 1 && PIN_IS_SDA2(E1_ENABLE)
+ #error "i2c SDA2 overlaps with E1 enable pin! Disable i2c peripherals."
+ #elif EXTRUDERS > 1 && AXIS_HAS_SPI(E1) && PIN_IS_SDA2(E1_CS)
+ #error "i2c SDA2 overlaps with E1 CS pin! Disable i2c peripherals."
+ #elif EXTRUDERS && (PIN_IS_SDA2(E0_STEP) || PIN_IS_SDA2(E0_DIR))
+ #error "i2c SCL2 overlaps with E0 STEP/DIR pin! Disable i2c peripherals."
+ #elif PIN_IS_SDA2(X_DIR) || PIN_IS_SDA2(Y_DIR)
+ #error "One or more i2c pins overlaps with X/Y DIR pin! Disable i2c peripherals."
+ #endif
+ #undef PIN_IS_SDA2
+ #undef PIN_IS_SCL2
+ #endif
+
+ #undef USEDI2CDEV_M
+#endif
+
+#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
+ #error "SERIAL_STATS_MAX_RX_QUEUED is not supported on this platform."
+#elif ENABLED(SERIAL_STATS_DROPPED_RX)
+ #error "SERIAL_STATS_DROPPED_RX is not supported on this platform."
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/include/SPI.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/SPI.h
similarity index 82%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/include/SPI.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/SPI.h
index 559759ea..4acd9e70 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/include/SPI.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/SPI.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -31,7 +31,7 @@
class SPISettings {
public:
SPISettings(uint32_t speed, int, int) : spi_speed(speed) {};
- uint32_t spiRate() { return spi_speed; }
+ uint32_t spiRate() const { return spi_speed; }
private:
uint32_t spi_speed;
};
@@ -39,7 +39,7 @@ class SPISettings {
class SPIClass {
public:
void begin();
- void beginTransaction(SPISettings);
+ void beginTransaction(const SPISettings&);
void endTransaction() {};
uint8_t transfer(uint8_t data);
uint16_t transfer16(uint16_t data);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.c
similarity index 72%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.c
index 3ad1aff0..f442ab71 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.c
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,12 +16,14 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-// adapted from I2C/master/master.c example
-// https://www-users.cs.york.ac.uk/~pcc/MCP/HAPR-Course-web/CMSIS/examples/html/master_8c_source.html
+/**
+ * digipot_mcp4451_I2C_routines.c
+ * Adapted from https://www-users.cs.york.ac.uk/~pcc/MCP/HAPR-Course-web/CMSIS/examples/html/master_8c_source.html
+ */
#ifdef TARGET_LPC1768
@@ -29,12 +31,12 @@
#if MB(MKS_SBASE)
-#include "digipot_mcp4451_I2C_routines.h"
-
#ifdef __cplusplus
extern "C" {
#endif
+#include "digipot_mcp4451_I2C_routines.h"
+
// These two routines are exact copies of the lpc17xx_i2c.c routines. Couldn't link to
// to the lpc17xx_i2c.c routines so had to copy them into this file & rename them.
@@ -60,7 +62,6 @@ static void _I2C_Stop(LPC_I2C_TypeDef *I2Cx) {
I2Cx->I2CONCLR = I2C_I2CONCLR_SIC;
}
-PINSEL_CFG_Type PinCfg;
I2C_M_SETUP_Type transferMCfg;
#define I2C_status (LPC_I2C1->I2STAT & I2C_STAT_CODE_BITMASK)
@@ -89,41 +90,6 @@ uint8_t digipot_mcp4451_start(uint8_t sla) { // send slave address and write bi
return 1;
}
-void digipot_mcp4451_init() {
- /**
- * Init I2C pin connect
- */
- PinCfg.OpenDrain = 0;
- PinCfg.Pinmode = 0;
- #if USEDI2CDEV_M == 0
- PinCfg.Funcnum = 1;
- PinCfg.Pinnum = 27;
- PinCfg.Portnum = 0;
- PINSEL_ConfigPin(&PinCfg); // SDA0 / D57 AUX-1
- PinCfg.Pinnum = 28;
- PINSEL_ConfigPin(&PinCfg); // SCL0 / D58 AUX-1
- #elif USEDI2CDEV_M == 1
- PinCfg.Funcnum = 3;
- PinCfg.Pinnum = 0;
- PinCfg.Portnum = 0;
- PINSEL_ConfigPin(&PinCfg); // SDA1 / D20 SCA
- PinCfg.Pinnum = 1;
- PINSEL_ConfigPin(&PinCfg); // SCL1 / D21 SCL
- #elif USEDI2CDEV_M == 2
- PinCfg.Funcnum = 2;
- PinCfg.Pinnum = 10;
- PinCfg.Portnum = 0;
- PINSEL_ConfigPin(&PinCfg); // SDA2 / D38 X_ENABLE_PIN
- PinCfg.Pinnum = 11;
- PINSEL_ConfigPin(&PinCfg); // SCL2 / D55 X_DIR_PIN
- #endif
- // Initialize I2C peripheral
- I2C_Init(I2CDEV_M, 400000); // hardwired to 400KHz bit rate, 100KHz is the other option
-
- // Enable Master I2C operation
- I2C_Cmd(I2CDEV_M, I2C_MASTER_MODE, ENABLE);
-}
-
uint8_t digipot_mcp4451_send_byte(uint8_t data) {
LPC_I2C1->I2DAT = data & I2C_I2DAT_BITMASK; // transmit data
LPC_I2C1->I2CONSET = I2C_I2CONSET_AA;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.h
new file mode 100644
index 00000000..9b6c62b0
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/digipot_mcp4451_I2C_routines.h
@@ -0,0 +1,43 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+/**
+ * digipot_mcp4451_I2C_routines.h
+ * Adapted from https://www-users.cs.york.ac.uk/~pcc/MCP/HAPR-Course-web/CMSIS/examples/html/master_8c_source.html
+ */
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#include
+#include
+#include
+#include "i2c_util.h"
+
+uint8_t digipot_mcp4451_start(uint8_t sla);
+uint8_t digipot_mcp4451_send_byte(uint8_t data);
+
+#ifdef __cplusplus
+ }
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/i2c_util.c b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/i2c_util.c
new file mode 100644
index 00000000..e52fb7c4
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/i2c_util.c
@@ -0,0 +1,70 @@
+/**
+ * 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 .
+ *
+ */
+
+/**
+ * HAL_LPC1768/include/i2c_util.c
+ */
+
+#ifdef TARGET_LPC1768
+
+#include "i2c_util.h"
+
+#define U8G_I2C_OPT_FAST 16 // from u8g.h
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+void configure_i2c(const uint8_t clock_option) {
+ /**
+ * Init I2C pin connect
+ */
+ PINSEL_CFG_Type PinCfg;
+ PinCfg.OpenDrain = 0;
+ PinCfg.Pinmode = 0;
+ PinCfg.Portnum = 0;
+ #if I2C_MASTER_ID == 0
+ PinCfg.Funcnum = 1;
+ PinCfg.Pinnum = 27; // SDA0 / D57 AUX-1 ... SCL0 / D58 AUX-1
+ #elif I2C_MASTER_ID == 1
+ PinCfg.Funcnum = 3;
+ PinCfg.Pinnum = 0; // SDA1 / D20 SCA ... SCL1 / D21 SCL
+ #elif I2C_MASTER_ID == 2
+ PinCfg.Funcnum = 2;
+ PinCfg.Pinnum = 10; // SDA2 / D38 X_ENABLE_PIN ... SCL2 / D55 X_DIR_PIN
+ #endif
+ PINSEL_ConfigPin(&PinCfg);
+ PinCfg.Pinnum += 1;
+ PINSEL_ConfigPin(&PinCfg);
+
+ // Initialize I2C peripheral
+ I2C_Init(I2CDEV_M, (clock_option & U8G_I2C_OPT_FAST) ? 400000: 100000); // LCD data rates
+
+ // Enable Master I2C operation
+ I2C_Cmd(I2CDEV_M, I2C_MASTER_MODE, ENABLE);
+}
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif // TARGET_LPC1768
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/i2c_util.h
similarity index 66%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/i2c_util.h
index d7e4b0dc..a57f68a4 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/include/i2c_util.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,37 +16,40 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
-// adapted from I2C/master/master.c example
-// https://www-users.cs.york.ac.uk/~pcc/MCP/HAPR-Course-web/CMSIS/examples/html/master_8c_source.html
+/**
+ * HAL_LPC1768/include/i2c_util.h
+ */
+
+#include "../../../inc/MarlinConfigPre.h"
-#define USEDI2CDEV_M 1 // use I2C1 controller
+#ifndef I2C_MASTER_ID
+ #define I2C_MASTER_ID 1
+#endif
-#if USEDI2CDEV_M == 0
+#if I2C_MASTER_ID == 0
#define I2CDEV_M LPC_I2C0
-#elif USEDI2CDEV_M == 1
+#elif I2C_MASTER_ID == 1
#define I2CDEV_M LPC_I2C1
-#elif USEDI2CDEV_M == 2
+#elif I2C_MASTER_ID == 2
#define I2CDEV_M LPC_I2C2
#else
#error "Master I2C device not defined!"
#endif
-#ifdef __cplusplus
- extern "C" {
-#endif
-
#include
#include
#include
-uint8_t digipot_mcp4451_start(uint8_t sla);
-void digipot_mcp4451_init();
-uint8_t digipot_mcp4451_send_byte(uint8_t data);
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+void configure_i2c(const uint8_t clock_option);
#ifdef __cplusplus
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/main.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/main.cpp
similarity index 86%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/main.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/main.cpp
index b20841bd..0b4045cb 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/main.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/main.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#ifdef TARGET_LPC1768
@@ -37,8 +37,7 @@ extern "C" {
#include "../../sd/cardreader.h"
#include "../../inc/MarlinConfig.h"
-#include "HAL.h"
-#include "timers.h"
+#include "../../core/millis_t.h"
extern uint32_t MSC_SD_Init(uint8_t pdrv);
extern "C" int isLPC1769();
@@ -66,7 +65,7 @@ void HAL_init() {
#endif
// Flash status LED 3 times to indicate Marlin has started booting
- for (uint8_t i = 0; i < 6; ++i) {
+ LOOP_L_N(i, 6) {
TOGGLE(LED_PIN);
delay(100);
}
@@ -89,7 +88,7 @@ void HAL_init() {
//debug_frmwrk_init();
//_DBG("\n\nDebug running\n");
- // Initialise the SD card chip select pins as soon as possible
+ // Initialize the SD card chip select pins as soon as possible
#if PIN_EXISTS(SS)
OUT_WRITE(SS_PIN, HIGH);
#endif
@@ -123,7 +122,7 @@ void HAL_init() {
delay(1000); // Give OS time to notice
USB_Connect(TRUE);
- #if !BOTH(SHARED_SD_CARD, INIT_SDCARD_ON_BOOT) && DISABLED(NO_SD_HOST_DRIVE)
+ #if DISABLED(NO_SD_HOST_DRIVE)
MSC_SD_Init(0); // Enable USB SD card access
#endif
@@ -136,21 +135,12 @@ void HAL_init() {
#endif
}
- #if NUM_SERIAL > 0
- MYSERIAL0.begin(BAUDRATE);
- #if NUM_SERIAL > 1
- MYSERIAL1.begin(BAUDRATE);
- #endif
- SERIAL_PRINTF("\n\necho:%s (%dMhz) Initialized\n", isLPC1769() ? "LPC1769" : "LPC1768", SystemCoreClock / 1000000);
- SERIAL_FLUSHTX();
- #endif
-
HAL_timer_init();
}
// HAL idle task
void HAL_idletask() {
- #if ENABLED(SHARED_SD_CARD)
+ #if HAS_SHARED_MEDIA
// If Marlin is using the SD card we need to lock it to prevent access from
// a PC via USB.
// Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/pinsDebug.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/pinsDebug.h
similarity index 93%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/pinsDebug.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/pinsDebug.h
index 133cd11b..f8055160 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/pinsDebug.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/pinsDebug.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/spi_pins.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/spi_pins.h
similarity index 85%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/spi_pins.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/spi_pins.h
index acf991a9..2e6749bf 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/spi_pins.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/spi_pins.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,14 +16,14 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
#include "../../core/macros.h"
-#if ENABLED(SDSUPPORT) && HAS_GRAPHICAL_LCD && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
+#if BOTH(SDSUPPORT, HAS_GRAPHICAL_LCD) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
#define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode required for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/timers.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/timers.cpp
similarity index 93%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/timers.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/timers.cpp
index 7bf7ff38..a7a40584 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/timers.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/timers.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
*
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -29,7 +29,6 @@
#ifdef TARGET_LPC1768
#include "../../inc/MarlinConfig.h"
-#include "timers.h"
void HAL_timer_init() {
SBI(LPC_SC->PCONP, SBIT_TIMER0); // Power ON Timer 0
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/timers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/timers.h
similarity index 77%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/timers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/timers.h
index 5f4e0626..23dc20e2 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/timers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/timers.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -61,10 +61,18 @@ typedef uint32_t hal_timer_t;
#define HAL_TIMER_RATE ((F_CPU) / 4) // frequency of timers peripherals
-#define STEP_TIMER_NUM 0 // Timer Index for Stepper
-#define TEMP_TIMER_NUM 1 // Timer Index for Temperature
-#define PULSE_TIMER_NUM STEP_TIMER_NUM
-#define PWM_TIMER_NUM 3 // Timer Index for PWM
+#ifndef STEP_TIMER_NUM
+ #define STEP_TIMER_NUM 0 // Timer Index for Stepper
+#endif
+#ifndef PULSE_TIMER_NUM
+ #define PULSE_TIMER_NUM STEP_TIMER_NUM
+#endif
+#ifndef TEMP_TIMER_NUM
+ #define TEMP_TIMER_NUM 1 // Timer Index for Temperature
+#endif
+#ifndef PWM_TIMER_NUM
+ #define PWM_TIMER_NUM 3 // Timer Index for PWM
+#endif
#define TEMP_TIMER_RATE 1000000
#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
@@ -84,12 +92,16 @@ typedef uint32_t hal_timer_t;
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
-#define HAL_STEP_TIMER_ISR() _HAL_TIMER_ISR(STEP_TIMER_NUM)
-#define HAL_TEMP_TIMER_ISR() _HAL_TIMER_ISR(TEMP_TIMER_NUM)
+#ifndef HAL_STEP_TIMER_ISR
+ #define HAL_STEP_TIMER_ISR() _HAL_TIMER_ISR(STEP_TIMER_NUM)
+#endif
+#ifndef HAL_TEMP_TIMER_ISR
+ #define HAL_TEMP_TIMER_ISR() _HAL_TIMER_ISR(TEMP_TIMER_NUM)
+#endif
// Timer references by index
-#define STEP_TIMER _HAL_TIMER(STEP_TIMER_NUM)
-#define TEMP_TIMER _HAL_TIMER(TEMP_TIMER_NUM)
+#define STEP_TIMER_PTR _HAL_TIMER(STEP_TIMER_NUM)
+#define TEMP_TIMER_PTR _HAL_TIMER(TEMP_TIMER_NUM)
// ------------------------
// Public functions
@@ -99,23 +111,23 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) {
switch (timer_num) {
- case 0: STEP_TIMER->MR0 = compare; break; // Stepper Timer Match Register 0
- case 1: TEMP_TIMER->MR0 = compare; break; // Temp Timer Match Register 0
+ case 0: STEP_TIMER_PTR->MR0 = compare; break; // Stepper Timer Match Register 0
+ case 1: TEMP_TIMER_PTR->MR0 = compare; break; // Temp Timer Match Register 0
}
}
FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) {
switch (timer_num) {
- case 0: return STEP_TIMER->MR0; // Stepper Timer Match Register 0
- case 1: return TEMP_TIMER->MR0; // Temp Timer Match Register 0
+ case 0: return STEP_TIMER_PTR->MR0; // Stepper Timer Match Register 0
+ case 1: return TEMP_TIMER_PTR->MR0; // Temp Timer Match Register 0
}
return 0;
}
FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
switch (timer_num) {
- case 0: return STEP_TIMER->TC; // Stepper Timer Count
- case 1: return TEMP_TIMER->TC; // Temp Timer Count
+ case 0: return STEP_TIMER_PTR->TC; // Stepper Timer Count
+ case 1: return TEMP_TIMER_PTR->TC; // Temp Timer Count
}
return 0;
}
@@ -154,8 +166,8 @@ FORCE_INLINE static bool HAL_timer_interrupt_enabled(const uint8_t timer_num) {
FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) {
switch (timer_num) {
- case 0: SBI(STEP_TIMER->IR, SBIT_CNTEN); break;
- case 1: SBI(TEMP_TIMER->IR, SBIT_CNTEN); break;
+ case 0: SBI(STEP_TIMER_PTR->IR, SBIT_CNTEN); break;
+ case 1: SBI(TEMP_TIMER_PTR->IR, SBIT_CNTEN); break;
}
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.cpp
similarity index 69%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.cpp
index 9a95b1b6..a48a820d 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -25,25 +25,21 @@
#ifdef TARGET_LPC1768
+#include "../include/i2c_util.h"
+#include "../../../core/millis_t.h"
+
extern int millis();
#ifdef __cplusplus
extern "C" {
#endif
-#include
-#include
-#include
-
-#include "../../../core/millis_t.h"
-
-
//////////////////////////////////////////////////////////////////////////////////////
// These two routines are exact copies of the lpc17xx_i2c.c routines. Couldn't link to
// to the lpc17xx_i2c.c routines so had to copy them into this file & rename them.
-static uint32_t _I2C_Start (LPC_I2C_TypeDef *I2Cx) {
+static uint32_t _I2C_Start(LPC_I2C_TypeDef *I2Cx) {
// Reset STA, STO, SI
I2Cx->I2CONCLR = I2C_I2CONCLR_SIC|I2C_I2CONCLR_STOC|I2C_I2CONCLR_STAC;
@@ -67,30 +63,16 @@ static void _I2C_Stop (LPC_I2C_TypeDef *I2Cx) {
//////////////////////////////////////////////////////////////////////////////////////
-#define U8G_I2C_OPT_FAST 16 // from u8g.h
-
-#define USEDI2CDEV_M 1
-
#define I2CDEV_S_ADDR 0x78 // from SSD1306 //actual address is 0x3C - shift left 1 with LSB set to 0 to indicate write
#define BUFFER_SIZE 0x1 // only do single byte transfers with LCDs
-#if (USEDI2CDEV_M == 0)
- #define I2CDEV_M LPC_I2C0
-#elif (USEDI2CDEV_M == 1)
- #define I2CDEV_M LPC_I2C1
-#elif (USEDI2CDEV_M == 2)
- #define I2CDEV_M LPC_I2C2
-#else
- #error "Master I2C device not defined!"
-#endif
-
-PINSEL_CFG_Type PinCfg;
I2C_M_SETUP_Type transferMCfg;
#define I2C_status (LPC_I2C1->I2STAT & I2C_STAT_CODE_BITMASK)
-uint8_t u8g_i2c_start(uint8_t sla) { // send slave address and write bit
+// Send slave address and write bit
+uint8_t u8g_i2c_start(const uint8_t sla) {
// Sometimes TX data ACK or NAK status is returned. That mean the start state didn't
// happen which means only the value of the slave address was send. Keep looping until
// the slave address and write bit are actually sent.
@@ -114,44 +96,9 @@ uint8_t u8g_i2c_start(uint8_t sla) { // send slave address and write bit
return 1;
}
-void u8g_i2c_init(uint8_t clock_option) {
-
- /**
- * Init I2C pin connect
- */
- PinCfg.OpenDrain = 0;
- PinCfg.Pinmode = 0;
- #if ((USEDI2CDEV_M == 0))
- PinCfg.Funcnum = 1;
- PinCfg.Pinnum = 27;
- PinCfg.Portnum = 0;
- PINSEL_ConfigPin(&PinCfg); // SDA0 / D57 AUX-1
- PinCfg.Pinnum = 28;
- PINSEL_ConfigPin(&PinCfg); // SCL0 / D58 AUX-1
- #endif
- #if ((USEDI2CDEV_M == 1))
- PinCfg.Funcnum = 3;
- PinCfg.Pinnum = 0;
- PinCfg.Portnum = 0;
- PINSEL_ConfigPin(&PinCfg); // SDA1 / D20 SCA
- PinCfg.Pinnum = 1;
- PINSEL_ConfigPin(&PinCfg); // SCL1 / D21 SCL
- #endif
- #if ((USEDI2CDEV_M == 2))
- PinCfg.Funcnum = 2;
- PinCfg.Pinnum = 10;
- PinCfg.Portnum = 0;
- PINSEL_ConfigPin(&PinCfg); // SDA2 / D38 X_ENABLE_PIN
- PinCfg.Pinnum = 11;
- PINSEL_ConfigPin(&PinCfg); // SCL2 / D55 X_DIR_PIN
- #endif
- // Initialize I2C peripheral
- I2C_Init(I2CDEV_M, (clock_option & U8G_I2C_OPT_FAST) ? 400000: 100000); // LCD data rates
-
- // Enable Master I2C operation
- I2C_Cmd(I2CDEV_M, I2C_MASTER_MODE, ENABLE);
-
- u8g_i2c_start(0); // send slave address and write bit
+void u8g_i2c_init(const uint8_t clock_option) {
+ configure_i2c(clock_option);
+ u8g_i2c_start(0); // Send slave address and write bit
}
uint8_t u8g_i2c_send_byte(uint8_t data) {
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.h
similarity index 77%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.h
index 9dd594cd..2d976c92 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_I2C_routines.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,13 +16,13 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
-void u8g_i2c_init(uint8_t options);
-uint8_t u8g_i2c_wait(uint8_t mask, uint8_t pos);
+void u8g_i2c_init(const uint8_t clock_options);
+//uint8_t u8g_i2c_wait(uint8_t mask, uint8_t pos);
uint8_t u8g_i2c_start(uint8_t sla);
uint8_t u8g_i2c_send_byte(uint8_t data);
void u8g_i2c_stop();
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_defines.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_defines.h
similarity index 93%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_defines.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_defines.h
index 1153329d..d2260037 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_defines.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_defines.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_delay.h
similarity index 79%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_delay.h
index 8806e874..0b9e2b4f 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_delay.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -26,8 +26,8 @@
*
* These are based on the LPC1768 routines.
*
- * Couldn't just call exact copies because the overhead resulted in the
- * one microsecond delay being about 4uS.
+ * Couldn't just call exact copies because the overhead
+ * results in a one microsecond delay taking about 4µS.
*/
#ifdef __cplusplus
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.c b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.c
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.c
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.c
index d441b7b4..466fc802 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.c
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.c
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.h
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.h
index 569706b4..d60d93da 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/LCD_pin_routines.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp
index 057a1374..befc348f 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp
index b624b24d..f03be9ab 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -86,8 +86,6 @@
#define I2C_CMD_MODE 0x000
#define I2C_DATA_MODE 0x040
-//#define U8G_I2C_OPT_FAST 16
-
uint8_t u8g_com_ssd_I2C_start_sequence(u8g_t *u8g) {
/* are we requested to set the a0 state? */
if (u8g->pin_list[U8G_PI_SET_A0] == 0) return 1;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp
index ac289c1a..1500c22a 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp
index 0a1bd848..10d84941 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp
index 7b655714..4f52f7dd 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -73,7 +73,7 @@
uint8_t swSpiTransfer_mode_0(uint8_t b, const uint8_t spi_speed, const pin_t sck_pin, const pin_t miso_pin, const pin_t mosi_pin ) {
- for (uint8_t i = 0; i < 8; i++) {
+ LOOP_L_N(i, 8) {
if (spi_speed == 0) {
LPC176x::gpio_set(mosi_pin, !!(b & 0x80));
LPC176x::gpio_set(sck_pin, HIGH);
@@ -83,16 +83,16 @@ uint8_t swSpiTransfer_mode_0(uint8_t b, const uint8_t spi_speed, const pin_t sck
}
else {
const uint8_t state = (b & 0x80) ? HIGH : LOW;
- for (uint8_t j = 0; j < spi_speed; j++)
+ LOOP_L_N(j, spi_speed)
LPC176x::gpio_set(mosi_pin, state);
- for (uint8_t j = 0; j < spi_speed + (miso_pin >= 0 ? 0 : 1); j++)
+ LOOP_L_N(j, spi_speed + (miso_pin >= 0 ? 0 : 1))
LPC176x::gpio_set(sck_pin, HIGH);
b <<= 1;
if (miso_pin >= 0 && LPC176x::gpio_get(miso_pin)) b |= 1;
- for (uint8_t j = 0; j < spi_speed; j++)
+ LOOP_L_N(j, spi_speed)
LPC176x::gpio_set(sck_pin, LOW);
}
}
@@ -102,7 +102,7 @@ uint8_t swSpiTransfer_mode_0(uint8_t b, const uint8_t spi_speed, const pin_t sck
uint8_t swSpiTransfer_mode_3(uint8_t b, const uint8_t spi_speed, const pin_t sck_pin, const pin_t miso_pin, const pin_t mosi_pin ) {
- for (uint8_t i = 0; i < 8; i++) {
+ LOOP_L_N(i, 8) {
const uint8_t state = (b & 0x80) ? HIGH : LOW;
if (spi_speed == 0) {
LPC176x::gpio_set(sck_pin, LOW);
@@ -111,13 +111,13 @@ uint8_t swSpiTransfer_mode_3(uint8_t b, const uint8_t spi_speed, const pin_t sck
LPC176x::gpio_set(sck_pin, HIGH);
}
else {
- for (uint8_t j = 0; j < spi_speed + (miso_pin >= 0 ? 0 : 1); j++)
+ LOOP_L_N(j, spi_speed + (miso_pin >= 0 ? 0 : 1))
LPC176x::gpio_set(sck_pin, LOW);
- for (uint8_t j = 0; j < spi_speed; j++)
+ LOOP_L_N(j, spi_speed)
LPC176x::gpio_set(mosi_pin, state);
- for (uint8_t j = 0; j < spi_speed; j++)
+ LOOP_L_N(j, spi_speed)
LPC176x::gpio_set(sck_pin, HIGH);
}
b <<= 1;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/upload_extra_script.py b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/upload_extra_script.py
new file mode 100644
index 00000000..9b0d0617
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/upload_extra_script.py
@@ -0,0 +1,145 @@
+#
+# sets output_port
+# if target_filename is found then that drive is used
+# else if target_drive is found then that drive is used
+#
+from __future__ import print_function
+
+target_filename = "FIRMWARE.CUR"
+target_drive = "REARM"
+
+import os
+import getpass
+import platform
+
+current_OS = platform.system()
+Import("env")
+
+def print_error(e):
+ print('\nUnable to find destination disk (%s)\n' \
+ 'Please select it in platformio.ini using the upload_port keyword ' \
+ '(https://docs.platformio.org/en/latest/projectconf/section_env_upload.html) ' \
+ 'or copy the firmware (.pio/build/%s/firmware.bin) manually to the appropriate disk\n' \
+ %(e, env.get('PIOENV')))
+
+try:
+ if current_OS == 'Windows':
+ #
+ # platformio.ini will accept this for a Windows upload port designation: 'upload_port = L:'
+ # Windows - doesn't care about the disk's name, only cares about the drive letter
+ #
+
+ #
+ # get all drives on this computer
+ #
+ import subprocess
+ # typical result (string): 'Drives: C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\'
+ driveStr = str(subprocess.check_output("fsutil fsinfo drives"))
+ # typical result (string): 'C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\'
+ # driveStr = driveStr.strip().lstrip('Drives: ') <- Doesn't work in other Languages as English. In German is "Drives:" = "Laufwerke:"
+ FirstFound = driveStr.find(':',0,-1) # Find the first ":" and
+ driveStr = driveStr[FirstFound + 1 : -1] # truncate to the rest
+ # typical result (array of stings): ['C:\\', 'D:\\', 'E:\\', 'F:\\',
+ # 'G:\\', 'H:\\', 'I:\\', 'J:\\', 'K:\\', 'L:\\', 'M:\\', 'Y:\\', 'Z:\\']
+ drives = driveStr.split()
+
+ upload_disk = 'Disk not found'
+ target_file_found = False
+ target_drive_found = False
+ for drive in drives:
+ final_drive_name = drive.strip().rstrip('\\') # typical result (string): 'C:'
+ try:
+ volume_info = str(subprocess.check_output('cmd /C dir ' + final_drive_name, stderr=subprocess.STDOUT))
+ except Exception as e:
+ continue
+ else:
+ if target_drive in volume_info and target_file_found == False: # set upload if not found target file yet
+ target_drive_found = True
+ upload_disk = final_drive_name
+ if target_filename in volume_info:
+ if target_file_found == False:
+ upload_disk = final_drive_name
+ target_file_found = True
+
+ #
+ # set upload_port to drive if found
+ #
+
+ if target_file_found == True or target_drive_found == True:
+ env.Replace(
+ UPLOAD_PORT=upload_disk
+ )
+ print('upload disk: ', upload_disk)
+ else:
+ print_error('Autodetect Error')
+
+ elif current_OS == 'Linux':
+ #
+ # platformio.ini will accept this for a Linux upload port designation: 'upload_port = /media/media_name/drive'
+ #
+ upload_disk = 'Disk not found'
+ target_file_found = False
+ target_drive_found = False
+ drives = os.listdir(os.path.join(os.sep, 'media', getpass.getuser()))
+ if target_drive in drives: # If target drive is found, use it.
+ target_drive_found = True
+ upload_disk = os.path.join(os.sep, 'media', getpass.getuser(), target_drive) + os.sep
+ else:
+ for drive in drives:
+ try:
+ files = os.listdir(os.path.join(os.sep, 'media', getpass.getuser(), drive))
+ except:
+ continue
+ else:
+ if target_filename in files:
+ upload_disk = os.path.join(os.sep, 'media', getpass.getuser(), drive) + os.sep
+ target_file_found = True
+ break
+ #
+ # set upload_port to drive if found
+ #
+
+ if target_file_found or target_drive_found:
+ env.Replace(
+ UPLOAD_FLAGS="-P$UPLOAD_PORT",
+ UPLOAD_PORT=upload_disk
+ )
+ print('upload disk: ', upload_disk)
+ else:
+ print_error('Autodetect Error')
+
+ elif current_OS == 'Darwin': # MAC
+ #
+ # platformio.ini will accept this for a OSX upload port designation: 'upload_port = /media/media_name/drive'
+ #
+ upload_disk = 'Disk not found'
+ drives = os.listdir('/Volumes') # human readable names
+ target_file_found = False
+ target_drive_found = False
+ if target_drive in drives and target_file_found == False: # set upload if not found target file yet
+ target_drive_found = True
+ upload_disk = '/Volumes/' + target_drive + '/'
+ for drive in drives:
+ try:
+ filenames = os.listdir('/Volumes/' + drive + '/') # will get an error if the drive is protected
+ except:
+ continue
+ else:
+ if target_filename in filenames:
+ if target_file_found == False:
+ upload_disk = '/Volumes/' + drive + '/'
+ target_file_found = True
+ #
+ # set upload_port to drive if found
+ #
+
+ if target_file_found == True or target_drive_found == True:
+ env.Replace(
+ UPLOAD_PORT=upload_disk
+ )
+ print('\nupload disk: ', upload_disk, '\n')
+ else:
+ print_error('Autodetect Error')
+
+except Exception as e:
+ print_error(str(e))
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/usb_serial.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/usb_serial.cpp
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/usb_serial.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/usb_serial.cpp
index c8393174..63a570ef 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/usb_serial.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/usb_serial.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,17 +16,16 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef TARGET_LPC1768
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(EMERGENCY_PARSER)
-#include "../../feature/emergency_parser.h"
+#include "../../feature/e_parser.h"
EmergencyParser::State emergency_state;
bool CDC_RecvCallback(const char buffer) {
emergency_parser.update(emergency_state, buffer);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/watchdog.cpp
similarity index 93%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/watchdog.cpp
index 6d0200e9..3cd22d66 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/watchdog.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef TARGET_LPC1768
#include "../../inc/MarlinConfig.h"
@@ -68,5 +67,4 @@ bool watchdog_timed_out() { return TEST(WDT_ReadTimeOutFlag(), 0); }
void watchdog_clear_timeout_flag() { WDT_ClrTimeOutFlag(); }
#endif // USE_WATCHDOG
-
#endif // TARGET_LPC1768
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/watchdog.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/watchdog.h
similarity index 86%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/watchdog.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/watchdog.h
index dd6617ea..cc170881 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/watchdog.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/watchdog.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/win_usb_driver/lpc176x_usb_driver.inf b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/win_usb_driver/lpc176x_usb_driver.inf
similarity index 100%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LPC1768/win_usb_driver/lpc176x_usb_driver.inf
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/LPC1768/win_usb_driver/lpc176x_usb_driver.inf
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/HAL.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/HAL.cpp
similarity index 77%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/HAL.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/HAL.cpp
index 1c53042f..9f24d300 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/HAL.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/HAL.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,10 +15,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __SAMD51__
#include "../../inc/MarlinConfig.h"
@@ -29,79 +28,46 @@
// Local defines
// ------------------------
-#if HAS_TEMP_ADC_0
- #define GET_TEMP_0_ADC() PIN_TO_ADC(TEMP_0_PIN)
-#else
- #define GET_TEMP_0_ADC() -1
-#endif
-#if HAS_TEMP_ADC_1
- #define GET_TEMP_1_ADC() PIN_TO_ADC(TEMP_1_PIN)
-#else
- #define GET_TEMP_1_ADC() -1
-#endif
-#if HAS_TEMP_ADC_2
- #define GET_TEMP_2_ADC() PIN_TO_ADC(TEMP_2_PIN)
-#else
- #define GET_TEMP_2_ADC() -1
-#endif
-#if HAS_TEMP_ADC_3
- #define GET_TEMP_3_ADC() PIN_TO_ADC(TEMP_3_PIN)
-#else
- #define GET_TEMP_3_ADC() -1
-#endif
-#if HAS_TEMP_ADC_4
- #define GET_TEMP_4_ADC() PIN_TO_ADC(TEMP_4_PIN)
-#else
- #define GET_TEMP_4_ADC() -1
-#endif
-#if HAS_TEMP_ADC_5
- #define GET_TEMP_5_ADC() PIN_TO_ADC(TEMP_5_PIN)
-#else
- #define GET_TEMP_5_ADC() -1
-#endif
-#if HAS_TEMP_ADC_BED
- #define GET_BED_ADC() PIN_TO_ADC(TEMP_BED_PIN)
-#else
- #define GET_BED_ADC() -1
-#endif
-#if HAS_TEMP_ADC_CHAMBER
- #define GET_CHAMBER_ADC() PIN_TO_ADC(TEMP_CHAMBER_PIN)
-#else
- #define GET_CHAMBER_ADC() -1
-#endif
-#if ENABLED(FILAMENT_WIDTH_SENSOR)
- #define GET_FILAMENT_WIDTH_ADC() PIN_TO_ADC(FILWIDTH_PIN)
-#else
- #define GET_FILAMENT_WIDTH_ADC() -1
-#endif
-#if HAS_ADC_BUTTONS
- #define GET_BUTTONS_ADC() PIN_TO_ADC(ADC_KEYPAD_PIN)
-#else
- #define GET_BUTTONS_ADC() -1
-#endif
-
-#define IS_ADC_REQUIRED(n) (GET_TEMP_0_ADC() == n || GET_TEMP_1_ADC() == n || GET_TEMP_2_ADC() == n \
- || GET_TEMP_3_ADC() == n || GET_TEMP_4_ADC() == n || GET_TEMP_5_ADC() == n \
- || GET_BED_ADC() == n \
- || GET_CHAMBER_ADC() == n \
- || GET_FILAMENT_WIDTH_ADC() == n \
- || GET_BUTTONS_ADC() == n)
-
-#define ADC0_IS_REQUIRED IS_ADC_REQUIRED(0)
-#define ADC1_IS_REQUIRED IS_ADC_REQUIRED(1)
-#define ADC_IS_REQUIRED (ADC0_IS_REQUIRED || ADC1_IS_REQUIRED)
-#if ADC0_IS_REQUIRED
+#define GET_TEMP_0_ADC() TERN(HAS_TEMP_ADC_0, PIN_TO_ADC(TEMP_0_PIN), -1)
+#define GET_TEMP_1_ADC() TERN(HAS_TEMP_ADC_1, PIN_TO_ADC(TEMP_1_PIN), -1)
+#define GET_TEMP_2_ADC() TERN(HAS_TEMP_ADC_2, PIN_TO_ADC(TEMP_2_PIN), -1)
+#define GET_TEMP_3_ADC() TERN(HAS_TEMP_ADC_3, PIN_TO_ADC(TEMP_3_PIN), -1)
+#define GET_TEMP_4_ADC() TERN(HAS_TEMP_ADC_4, PIN_TO_ADC(TEMP_4_PIN), -1)
+#define GET_TEMP_5_ADC() TERN(HAS_TEMP_ADC_5, PIN_TO_ADC(TEMP_5_PIN), -1)
+#define GET_TEMP_6_ADC() TERN(HAS_TEMP_ADC_6, PIN_TO_ADC(TEMP_6_PIN), -1)
+#define GET_TEMP_7_ADC() TERN(HAS_TEMP_ADC_7, PIN_TO_ADC(TEMP_7_PIN), -1)
+#define GET_PROBE_ADC() TERN(HAS_TEMP_PROBE, PIN_TO_ADC(TEMP_PROBE_PIN), -1)
+#define GET_BED_ADC() TERN(HAS_TEMP_ADC_BED, PIN_TO_ADC(TEMP_BED_PIN), -1)
+#define GET_CHAMBER_ADC() TERN(HAS_TEMP_ADC_CHAMBER, PIN_TO_ADC(TEMP_CHAMBER_PIN), -1)
+#define GET_FILAMENT_WIDTH_ADC() TERN(FILAMENT_WIDTH_SENSOR, PIN_TO_ADC(FILWIDTH_PIN), -1)
+#define GET_BUTTONS_ADC() TERN(HAS_ADC_BUTTONS, PIN_TO_ADC(ADC_KEYPAD_PIN), -1)
+
+#define IS_ADC_REQUIRED(n) ( \
+ GET_TEMP_0_ADC() == n || GET_TEMP_1_ADC() == n || GET_TEMP_2_ADC() == n || GET_TEMP_3_ADC() == n \
+ || GET_TEMP_4_ADC() == n || GET_TEMP_5_ADC() == n || GET_TEMP_6_ADC() == n || GET_TEMP_7_ADC() == n \
+ || GET_PROBE_ADC() == n \
+ || GET_BED_ADC() == n \
+ || GET_CHAMBER_ADC() == n \
+ || GET_FILAMENT_WIDTH_ADC() == n \
+ || GET_BUTTONS_ADC() == n \
+)
+
+#if IS_ADC_REQUIRED(0)
+ #define ADC0_IS_REQUIRED 1
#define FIRST_ADC 0
#else
#define FIRST_ADC 1
#endif
-#if ADC1_IS_REQUIRED
+#if IS_ADC_REQUIRED(1)
+ #define ADC1_IS_REQUIRED 1
#define LAST_ADC 1
#else
#define LAST_ADC 0
#endif
-
-#define DMA_IS_REQUIRED ADC_IS_REQUIRED
+#if ADC0_IS_REQUIRED || ADC1_IS_REQUIRED
+ #define ADC_IS_REQUIRED 1
+ #define DMA_IS_REQUIRED 1
+#endif
// ------------------------
// Types
@@ -145,6 +111,15 @@ uint16_t HAL_adc_result;
#if GET_TEMP_5_ADC() == 0
TEMP_5_PIN,
#endif
+ #if GET_TEMP_6_ADC() == 0
+ TEMP_6_PIN,
+ #endif
+ #if GET_TEMP_7_ADC() == 0
+ TEMP_7_PIN,
+ #endif
+ #if GET_PROBE_ADC() == 0
+ TEMP_PROBE_PIN,
+ #endif
#if GET_BED_ADC() == 0
TEMP_BED_PIN,
#endif
@@ -176,6 +151,15 @@ uint16_t HAL_adc_result;
#if GET_TEMP_5_ADC() == 1
TEMP_5_PIN,
#endif
+ #if GET_TEMP_6_ADC() == 1
+ TEMP_6_PIN,
+ #endif
+ #if GET_TEMP_7_ADC() == 1
+ TEMP_7_PIN,
+ #endif
+ #if GET_PROBE_ADC() == 1
+ TEMP_PROBE_PIN,
+ #endif
#if GET_BED_ADC() == 1
TEMP_BED_PIN,
#endif
@@ -215,6 +199,15 @@ uint16_t HAL_adc_result;
#if GET_TEMP_5_ADC() == 0
{ PIN_TO_INPUTCTRL(TEMP_5_PIN) },
#endif
+ #if GET_TEMP_6_ADC() == 0
+ { PIN_TO_INPUTCTRL(TEMP_6_PIN) },
+ #endif
+ #if GET_TEMP_7_ADC() == 0
+ { PIN_TO_INPUTCTRL(TEMP_7_PIN) },
+ #endif
+ #if GET_PROBE_ADC() == 0
+ { PIN_TO_INPUTCTRL(TEMP_PROBE_PIN) },
+ #endif
#if GET_BED_ADC() == 0
{ PIN_TO_INPUTCTRL(TEMP_BED_PIN) },
#endif
@@ -255,6 +248,15 @@ uint16_t HAL_adc_result;
#if GET_TEMP_5_ADC() == 1
{ PIN_TO_INPUTCTRL(TEMP_5_PIN) },
#endif
+ #if GET_TEMP_6_ADC() == 1
+ { PIN_TO_INPUTCTRL(TEMP_6_PIN) },
+ #endif
+ #if GET_TEMP_7_ADC() == 1
+ { PIN_TO_INPUTCTRL(TEMP_7_PIN) },
+ #endif
+ #if GET_PROBE_ADC() == 1
+ { PIN_TO_INPUTCTRL(TEMP_PROBE_PIN) },
+ #endif
#if GET_BED_ADC() == 1
{ PIN_TO_INPUTCTRL(TEMP_BED_PIN) },
#endif
@@ -369,11 +371,8 @@ uint16_t HAL_adc_result;
// HAL initialization task
void HAL_init() {
- #if DMA_IS_REQUIRED
- dma_init();
- #endif
+ TERN_(DMA_IS_REQUIRED, dma_init());
#if ENABLED(SDSUPPORT)
- // SD_DETECT_PIN may be removed if NO_SD_HOST_DRIVE is not defined in Configuration_adv.h
#if SD_CONNECTION_IS(ONBOARD) && PIN_EXISTS(SD_DETECT)
SET_INPUT_PULLUP(SD_DETECT_PIN);
#endif
@@ -425,10 +424,10 @@ void HAL_adc_init() {
#if ADC_IS_REQUIRED
memset(HAL_adc_results, 0xFF, sizeof(HAL_adc_results)); // Fill result with invalid values
- for (uint8_t pi = 0; pi < COUNT(adc_pins); ++pi)
- pinPeripheral(adc_pins[pi], PIO_ANALOG);
+ LOOP_L_N(pi, COUNT(adc_pins))
+ pinPeripheral(adc_pins[pi], PIO_ANALOG);
- for (uint8_t ai = FIRST_ADC; ai <= LAST_ADC; ++ai) {
+ LOOP_S_LE_N(ai, FIRST_ADC, LAST_ADC) {
Adc* adc = ((Adc*[])ADC_INSTS)[ai];
// ADC clock setup
@@ -442,14 +441,14 @@ void HAL_adc_init() {
// Preloaded data (fixed for all ADC instances hence not loaded by DMA)
adc->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_AREFA_Val; // VRefA pin
SYNC(adc->SYNCBUSY.bit.REFCTRL);
- adc->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_12BIT_Val;
+ adc->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_10BIT_Val; // ... ADC_CTRLB_RESSEL_16BIT_Val
SYNC(adc->SYNCBUSY.bit.CTRLB);
adc->SAMPCTRL.bit.SAMPLEN = (6 - 1); // Sampling clocks
- adc->AVGCTRL.reg = ADC_AVGCTRL_SAMPLENUM_16 | ADC_AVGCTRL_ADJRES(4); // 16 Accumulated conversions and shift 4 to get oversampled 12 bits result
- SYNC(adc->SYNCBUSY.bit.AVGCTRL);
+ //adc->AVGCTRL.reg = ADC_AVGCTRL_SAMPLENUM_16 | ADC_AVGCTRL_ADJRES(4); // 16 Accumulated conversions and shift 4 to get oversampled 12 bits result
+ //SYNC(adc->SYNCBUSY.bit.AVGCTRL);
+
// Registers loaded by DMA
adc->DSEQCTRL.bit.INPUTCTRL = true;
-
adc->DSEQCTRL.bit.AUTOSTART = true; // Start conversion after DMA sequence
adc->CTRLA.bit.ENABLE = true; // Enable ADC
@@ -460,7 +459,7 @@ void HAL_adc_init() {
void HAL_adc_start_conversion(const uint8_t adc_pin) {
#if ADC_IS_REQUIRED
- for (uint8_t pi = 0; pi < COUNT(adc_pins); ++pi) {
+ LOOP_L_N(pi, COUNT(adc_pins)) {
if (adc_pin == adc_pins[pi]) {
HAL_adc_result = HAL_adc_results[pi];
return;
@@ -471,8 +470,4 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
HAL_adc_result = 0xFFFF;
}
-uint16_t HAL_adc_get_result() {
- return HAL_adc_result;
-}
-
#endif // __SAMD51__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/HAL.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/HAL.h
similarity index 65%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/HAL.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/HAL.h
index dea84da5..ea0f694c 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/HAL.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/HAL.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -27,17 +27,14 @@
#include "../shared/HAL_SPI.h"
#include "fastio.h"
#include "watchdog.h"
-#include "timers.h"
#ifdef ADAFRUIT_GRAND_CENTRAL_M4
#include "MarlinSerial_AGCM4.h"
// Serial ports
- #if !WITHIN(SERIAL_PORT, -1, 3)
- #error "SERIAL_PORT must be from -1 to 3"
- #endif
// MYSERIAL0 required before MarlinSerial includes!
+
#if SERIAL_PORT == -1
#define MYSERIAL0 Serial
#elif SERIAL_PORT == 0
@@ -46,18 +43,16 @@
#define MYSERIAL0 Serial2
#elif SERIAL_PORT == 2
#define MYSERIAL0 Serial3
- #else
+ #elif SERIAL_PORT == 3
#define MYSERIAL0 Serial4
+ #else
+ #error "SERIAL_PORT must be from -1 to 3. Please update your configuration."
#endif
#ifdef SERIAL_PORT_2
- #if !WITHIN(SERIAL_PORT_2, -1, 3)
- #error "SERIAL_PORT_2 must be from -1 to 3"
- #elif SERIAL_PORT_2 == SERIAL_PORT
- #error "SERIAL_PORT_2 must be different than SERIAL_PORT"
- #endif
- #define NUM_SERIAL 2
- #if SERIAL_PORT_2 == -1
+ #if SERIAL_PORT_2 == SERIAL_PORT
+ #error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
+ #elif SERIAL_PORT_2 == -1
#define MYSERIAL1 Serial
#elif SERIAL_PORT_2 == 0
#define MYSERIAL1 Serial1
@@ -65,13 +60,36 @@
#define MYSERIAL1 Serial2
#elif SERIAL_PORT_2 == 2
#define MYSERIAL1 Serial3
- #else
+ #elif SERIAL_PORT_2 == 3
#define MYSERIAL1 Serial4
+ #else
+ #error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
#endif
+ #define NUM_SERIAL 2
#else
#define NUM_SERIAL 1
#endif
+ #ifdef DGUS_SERIAL_PORT
+ #if DGUS_SERIAL_PORT == SERIAL_PORT
+ #error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
+ #elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
+ #error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
+ #elif DGUS_SERIAL_PORT == -1
+ #define DGUS_SERIAL Serial
+ #elif DGUS_SERIAL_PORT == 0
+ #define DGUS_SERIAL Serial1
+ #elif DGUS_SERIAL_PORT == 1
+ #define DGUS_SERIAL Serial2
+ #elif DGUS_SERIAL_PORT == 2
+ #define DGUS_SERIAL Serial3
+ #elif DGUS_SERIAL_PORT == 2
+ #define DGUS_SERIAL Serial4
+ #else
+ #error "DGUS_SERIAL_PORT must be from -1 to 3. Please update your configuration."
+ #endif
+ #endif
+
#endif // ADAFRUIT_GRAND_CENTRAL_M4
typedef int8_t pin_t;
@@ -82,8 +100,8 @@ typedef int8_t pin_t;
//
// Interrupts
//
-#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq()
-#define CRITICAL_SECTION_END if (!primask) __enable_irq()
+#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq()
+#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
#define ISRS_ENABLED() (!__get_PRIMASK())
#define ENABLE_ISRS() __enable_irq()
#define DISABLE_ISRS() __disable_irq()
@@ -94,29 +112,23 @@ typedef int8_t pin_t;
void HAL_clear_reset_source(); // clear reset reason
uint8_t HAL_get_reset_source(); // get reset reason
-//
-// EEPROM
-//
-void eeprom_write_byte(uint8_t *pos, unsigned char value);
-uint8_t eeprom_read_byte(uint8_t *pos);
-
//
// ADC
//
-extern uint16_t HAL_adc_result; // result of last ADC conversion
+extern uint16_t HAL_adc_result; // Most recent ADC conversion
#define HAL_ANALOG_SELECT(pin)
void HAL_adc_init();
-#define HAL_ADC_FILTERED // Disable oversampling done in Marlin as ADC values already filtered in HAL
-#define HAL_ADC_RESOLUTION 12
+//#define HAL_ADC_FILTERED // Disable Marlin's oversampling. The HAL filters ADC values.
+#define HAL_ADC_VREF 3.3
+#define HAL_ADC_RESOLUTION 10 // ... 12
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
#define HAL_READ_ADC() HAL_adc_result
#define HAL_ADC_READY() true
void HAL_adc_start_conversion(const uint8_t adc_pin);
-uint16_t HAL_adc_get_result();
//
// Pin Map
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/HAL_SPI.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/HAL_SPI.cpp
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/HAL_SPI.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/HAL_SPI.cpp
index bbd12912..c3acd382 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/HAL_SPI.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/HAL_SPI.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -46,9 +46,6 @@
// ------------------------
#error "Software SPI not supported for SAMD51. Use Hardware SPI."
- #if SD_CONNECTION_IS(ONBOARD)
- #endif
-
#else // !SOFTWARE_SPI
#ifdef ADAFRUIT_GRAND_CENTRAL_M4
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.cpp
similarity index 93%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.cpp
index 2da4d8c0..abc5f3ac 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,10 +15,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef ADAFRUIT_GRAND_CENTRAL_M4
/**
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.h
index 0768d8a0..f3821d8d 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/MarlinSerial_AGCM4.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/MarlinSerial_AGCM4.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/QSPIFlash.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/QSPIFlash.cpp
new file mode 100644
index 00000000..161c0408
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/QSPIFlash.cpp
@@ -0,0 +1,78 @@
+/**
+ * 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 .
+ *
+ */
+
+#include "../../inc/MarlinConfig.h"
+
+#if ENABLED(QSPI_EEPROM)
+
+#include "QSPIFlash.h"
+
+#define INVALID_ADDR 0xffffffff
+#define SECTOR_OF(a) (a & ~(SFLASH_SECTOR_SIZE - 1))
+#define OFFSET_OF(a) (a & (SFLASH_SECTOR_SIZE - 1))
+
+Adafruit_SPIFlashBase * QSPIFlash::_flashBase = nullptr;
+uint8_t QSPIFlash::_buf[SFLASH_SECTOR_SIZE];
+uint32_t QSPIFlash::_addr = INVALID_ADDR;
+
+void QSPIFlash::begin() {
+ if (_flashBase != nullptr) return;
+
+ _flashBase = new Adafruit_SPIFlashBase(new Adafruit_FlashTransport_QSPI());
+ _flashBase->begin(NULL);
+}
+
+size_t QSPIFlash::size() {
+ return _flashBase->size();
+}
+
+uint8_t QSPIFlash::readByte(const uint32_t address) {
+ if (SECTOR_OF(address) == _addr) return _buf[OFFSET_OF(address)];
+
+ return _flashBase->read8(address);
+}
+
+void QSPIFlash::writeByte(const uint32_t address, const uint8_t value) {
+ uint32_t const sector_addr = SECTOR_OF(address);
+
+ // Page changes, flush old and update new cache
+ if (sector_addr != _addr) {
+ flush();
+ _addr = sector_addr;
+
+ // read a whole page from flash
+ _flashBase->readBuffer(sector_addr, _buf, SFLASH_SECTOR_SIZE);
+ }
+
+ _buf[OFFSET_OF(address)] = value;
+}
+
+void QSPIFlash::flush() {
+ if (_addr == INVALID_ADDR) return;
+
+ _flashBase->eraseSector(_addr / SFLASH_SECTOR_SIZE);
+ _flashBase->writeBuffer(_addr, _buf, SFLASH_SECTOR_SIZE);
+
+ _addr = INVALID_ADDR;
+}
+
+#endif // QSPI_EEPROM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/QSPIFlash.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/QSPIFlash.h
new file mode 100644
index 00000000..b6f22769
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/QSPIFlash.h
@@ -0,0 +1,51 @@
+/**
+ * @file QSPIFlash.h
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2019 Ha Thach and Dean Miller for Adafruit Industries LLC
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * Derived from Adafruit_SPIFlash class with no SdFat references
+ *
+ */
+
+#pragma once
+
+#include
+
+// This class extends Adafruit_SPIFlashBase by adding caching support.
+//
+// This class will use 4096 Bytes of RAM as a block cache.
+class QSPIFlash {
+ public:
+ static void begin();
+ static size_t size();
+ static uint8_t readByte(const uint32_t address);
+ static void writeByte(const uint32_t address, const uint8_t v);
+ static void flush();
+
+ private:
+ static Adafruit_SPIFlashBase * _flashBase;
+ static uint8_t _buf[SFLASH_SECTOR_SIZE];
+ static uint32_t _addr;
+};
+
+extern QSPIFlash qspi;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/SAMD51.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/SAMD51.h
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/SAMD51.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/SAMD51.h
index d29d134c..78395614 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/SAMD51.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/SAMD51.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/Servo.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/Servo.cpp
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/Servo.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/Servo.cpp
index dbae7504..9bab8e89 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/Servo.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/Servo.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -29,11 +29,9 @@
#if HAS_SERVOS
-#include "../shared/Marduino.h"
#include "../shared/servo.h"
#include "../shared/servo_private.h"
#include "SAMD51.h"
-#include "timers.h"
#define __TC_GCLK_ID(t) TC##t##_GCLK_ID
#define _TC_GCLK_ID(t) __TC_GCLK_ID(t)
@@ -55,7 +53,7 @@
static volatile int8_t currentServoIndex[_Nbr_16timers]; // index for the servo being pulsed for each timer (or -1 if refresh interval)
FORCE_INLINE static uint16_t getTimerCount() {
- Tc * const tc = TimerConfig[SERVO_TC].pTimer;
+ Tc * const tc = TimerConfig[SERVO_TC].pTc;
tc->COUNT16.CTRLBSET.reg = TC_CTRLBCLR_CMD_READSYNC;
SYNC(tc->COUNT16.SYNCBUSY.bit.CTRLB || tc->COUNT16.SYNCBUSY.bit.COUNT);
@@ -67,7 +65,7 @@ FORCE_INLINE static uint16_t getTimerCount() {
// Interrupt handler for the TC
// ----------------------------
HAL_SERVO_TIMER_ISR() {
- Tc * const tc = TimerConfig[SERVO_TC].pTimer;
+ Tc * const tc = TimerConfig[SERVO_TC].pTc;
const timer16_Sequence_t timer =
#ifndef _useTimer1
_timer2
@@ -127,7 +125,7 @@ HAL_SERVO_TIMER_ISR() {
}
void initISR(timer16_Sequence_t timer) {
- Tc * const tc = TimerConfig[SERVO_TC].pTimer;
+ Tc * const tc = TimerConfig[SERVO_TC].pTc;
const uint8_t tcChannel = TIMER_TCCHANNEL(timer);
static bool initialized = false; // Servo TC has been initialized
@@ -204,7 +202,7 @@ void initISR(timer16_Sequence_t timer) {
}
void finISR(timer16_Sequence_t timer) {
- Tc * const tc = TimerConfig[SERVO_TC].pTimer;
+ Tc * const tc = TimerConfig[SERVO_TC].pTc;
const uint8_t tcChannel = TIMER_TCCHANNEL(timer);
// Disable the match channel interrupt request
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/ServoTimers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/ServoTimers.h
similarity index 89%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/ServoTimers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/ServoTimers.h
index 8b77d5b5..948d5153 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/ServoTimers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/ServoTimers.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/eeprom_flash.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/eeprom_flash.cpp
new file mode 100644
index 00000000..429ef1c2
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/eeprom_flash.cpp
@@ -0,0 +1,95 @@
+/**
+ * Marlin 3D Printer Firmware
+ *
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
+ *
+ * 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 .
+ *
+ */
+#ifdef __SAMD51__
+
+#include "../../inc/MarlinConfig.h"
+
+#if ENABLED(FLASH_EEPROM_EMULATION)
+
+#include "../shared/eeprom_api.h"
+
+#define NVMCTRL_CMD(c) do{ \
+ SYNC(!NVMCTRL->STATUS.bit.READY); \
+ NVMCTRL->INTFLAG.bit.DONE = true; \
+ NVMCTRL->CTRLB.reg = c | NVMCTRL_CTRLB_CMDEX_KEY; \
+ SYNC(NVMCTRL->INTFLAG.bit.DONE); \
+ }while(0)
+#define NVMCTRL_FLUSH() do{ \
+ if (NVMCTRL->SEESTAT.bit.LOAD) \
+ NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_SEEFLUSH); \
+ }while(0)
+
+size_t PersistentStore::capacity() {
+ const uint8_t psz = NVMCTRL->SEESTAT.bit.PSZ,
+ sblk = NVMCTRL->SEESTAT.bit.SBLK;
+
+ return (!psz && !sblk) ? 0
+ : (psz <= 2) ? (0x200 << psz)
+ : (sblk == 1 || psz == 3) ? 4096
+ : (sblk == 2 || psz == 4) ? 8192
+ : (sblk <= 4 || psz == 5) ? 16384
+ : (sblk >= 9 && psz == 7) ? 65536
+ : 32768;
+}
+
+bool PersistentStore::access_start() {
+ NVMCTRL->SEECFG.reg = NVMCTRL_SEECFG_WMODE_BUFFERED; // Buffered mode and segment reallocation active
+ if (NVMCTRL->SEESTAT.bit.RLOCK)
+ NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE); // Unlock E2P data write access
+ return true;
+}
+
+bool PersistentStore::access_finish() {
+ NVMCTRL_FLUSH();
+ if (!NVMCTRL->SEESTAT.bit.LOCK)
+ NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_LSEE); // Lock E2P data write access
+ return true;
+}
+
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
+ while (size--) {
+ const uint8_t v = *value;
+ SYNC(NVMCTRL->SEESTAT.bit.BUSY);
+ if (NVMCTRL->INTFLAG.bit.SEESFULL)
+ NVMCTRL_FLUSH(); // Next write will trigger a sector reallocation. I need to flush 'pagebuffer'
+ ((volatile uint8_t *)SEEPROM_ADDR)[pos] = v;
+ SYNC(!NVMCTRL->INTFLAG.bit.SEEWRC);
+ crc16(crc, &v, 1);
+ pos++;
+ value++;
+ }
+ return false;
+}
+
+bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
+ while (size--) {
+ SYNC(NVMCTRL->SEESTAT.bit.BUSY);
+ uint8_t c = ((volatile uint8_t *)SEEPROM_ADDR)[pos];
+ if (writing) *value = c;
+ crc16(crc, &c, 1);
+ pos++;
+ value++;
+ }
+ return false;
+}
+
+#endif // FLASH_EEPROM_EMULATION
+#endif // __SAMD51__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp
new file mode 100644
index 00000000..b403f793
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp
@@ -0,0 +1,71 @@
+/**
+ * Marlin 3D Printer Firmware
+ *
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
+ *
+ * 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 .
+ *
+ */
+#ifdef __SAMD51__
+
+#include "../../inc/MarlinConfig.h"
+
+#if ENABLED(QSPI_EEPROM)
+
+#include "../shared/eeprom_api.h"
+
+#include "QSPIFlash.h"
+
+static bool initialized;
+
+size_t PersistentStore::capacity() { return qspi.size(); }
+
+bool PersistentStore::access_start() {
+ if (!initialized) {
+ qspi.begin();
+ initialized = true;
+ }
+ return true;
+}
+
+bool PersistentStore::access_finish() {
+ qspi.flush();
+ return true;
+}
+
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
+ while (size--) {
+ const uint8_t v = *value;
+ qspi.writeByte(pos, v);
+ crc16(crc, &v, 1);
+ pos++;
+ value++;
+ }
+ return false;
+}
+
+bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
+ while (size--) {
+ uint8_t c = qspi.readByte(pos);
+ if (writing) *value = c;
+ crc16(crc, &c, 1);
+ pos++;
+ value++;
+ }
+ return false;
+}
+
+#endif // QSPI_EEPROM
+#endif // __SAMD51__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/eeprom_wired.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/eeprom_wired.cpp
new file mode 100644
index 00000000..32831958
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/eeprom_wired.cpp
@@ -0,0 +1,74 @@
+/**
+ * Marlin 3D Printer Firmware
+ *
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
+ *
+ * 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 .
+ *
+ */
+#ifdef __SAMD51__
+
+#include "../../inc/MarlinConfig.h"
+
+#if USE_WIRED_EEPROM
+
+/**
+ * PersistentStore for Arduino-style EEPROM interface
+ * with simple implementations supplied by Marlin.
+ */
+
+#include "../shared/eeprom_if.h"
+#include "../shared/eeprom_api.h"
+
+#ifndef MARLIN_EEPROM_SIZE
+ #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM."
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+
+bool PersistentStore::access_start() { eeprom_init(); return true; }
+bool PersistentStore::access_finish() { return true; }
+
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
+ while (size--) {
+ const uint8_t v = *value;
+ uint8_t * const p = (uint8_t * const)pos;
+ if (v != eeprom_read_byte(p)) {
+ eeprom_write_byte(p, v);
+ delay(2);
+ if (eeprom_read_byte(p) != v) {
+ SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
+ return true;
+ }
+ }
+ crc16(crc, &v, 1);
+ pos++;
+ value++;
+ }
+ return false;
+}
+
+bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
+ while (size--) {
+ uint8_t c = eeprom_read_byte((uint8_t*)pos);
+ if (writing) *value = c;
+ crc16(crc, &c, 1);
+ pos++;
+ value++;
+ }
+ return false;
+}
+
+#endif // USE_WIRED_EEPROM
+#endif // __SAMD51__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/endstop_interrupts.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/endstop_interrupts.h
similarity index 78%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/endstop_interrupts.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/endstop_interrupts.h
index 1f66e02e..03c24694 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/endstop_interrupts.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/endstop_interrupts.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -98,6 +98,16 @@
#else
#define MATCH_Z3_MIN_EILINE(P) false
#endif
+#if HAS_Z4_MAX
+ #define MATCH_Z4_MAX_EILINE(P) MATCH_EILINE(P, Z4_MAX_PIN)
+#else
+ #define MATCH_Z4_MAX_EILINE(P) false
+#endif
+#if HAS_Z4_MIN
+ #define MATCH_Z4_MIN_EILINE(P) MATCH_EILINE(P, Z4_MIN_PIN)
+#else
+ #define MATCH_Z4_MIN_EILINE(P) false
+#endif
#if HAS_Z_MIN_PROBE_PIN
#define MATCH_Z_MIN_PROBE_EILINE(P) MATCH_EILINE(P, Z_MIN_PROBE_PIN)
#else
@@ -109,6 +119,7 @@
&& !MATCH_Z_MAX_EILINE(P) && !MATCH_Z_MIN_EILINE(P) \
&& !MATCH_Z2_MAX_EILINE(P) && !MATCH_Z2_MIN_EILINE(P) \
&& !MATCH_Z3_MAX_EILINE(P) && !MATCH_Z3_MIN_EILINE(P) \
+ && !MATCH_Z4_MAX_EILINE(P) && !MATCH_Z4_MIN_EILINE(P) \
&& !MATCH_Z_MIN_PROBE_EILINE(P))
// One ISR for all EXT-Interrupts
@@ -117,67 +128,79 @@ void endstop_ISR() { endstops.update(); }
void setup_endstop_interrupts() {
#if HAS_X_MAX
#if !AVAILABLE_EILINE(X_MAX_PIN)
- static_assert(false, "X_MAX_PIN has no EXTINT line available.");
+ #error "X_MAX_PIN has no EXTINT line available."
#endif
attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_X_MIN
#if !AVAILABLE_EILINE(X_MIN_PIN)
- static_assert(false, "X_MIN_PIN has no EXTINT line available.");
+ #error "X_MIN_PIN has no EXTINT line available."
#endif
attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Y_MAX
#if !AVAILABLE_EILINE(Y_MAX_PIN)
- static_assert(false, "Y_MAX_PIN has no EXTINT line available.");
+ #error "Y_MAX_PIN has no EXTINT line available."
#endif
attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Y_MIN
#if !AVAILABLE_EILINE(Y_MIN_PIN)
- static_assert(false, "Y_MIN_PIN has no EXTINT line available.");
+ #error "Y_MIN_PIN has no EXTINT line available."
#endif
attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z_MAX
#if !AVAILABLE_EILINE(Z_MAX_PIN)
- static_assert(false, "Z_MAX_PIN has no EXTINT line available.");
+ #error "Z_MAX_PIN has no EXTINT line available."
#endif
attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z_MIN
#if !AVAILABLE_EILINE(Z_MIN_PIN)
- static_assert(false, "Z_MIN_PIN has no EXTINT line available.");
+ #error "Z_MIN_PIN has no EXTINT line available."
#endif
attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z2_MAX
#if !AVAILABLE_EILINE(Z2_MAX_PIN)
- static_assert(false, "Z2_MAX_PIN has no EXTINT line available.");
+ #error "Z2_MAX_PIN has no EXTINT line available."
#endif
attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z2_MIN
#if !AVAILABLE_EILINE(Z2_MIN_PIN)
- static_assert(false, "Z2_MIN_PIN has no EXTINT line available.");
+ #error "Z2_MIN_PIN has no EXTINT line available."
#endif
attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MAX
#if !AVAILABLE_EILINE(Z3_MAX_PIN)
- static_assert(false, "Z3_MAX_PIN has no EXTINT line available.");
+ #error "Z3_MAX_PIN has no EXTINT line available."
#endif
attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE);
#endif
#if HAS_Z3_MIN
#if !AVAILABLE_EILINE(Z3_MIN_PIN)
- static_assert(false, "Z3_MIN_PIN has no EXTINT line available.");
+ #error "Z3_MIN_PIN has no EXTINT line available."
#endif
attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE);
#endif
+ #if HAS_Z4_MAX
+ #if !AVAILABLE_EILINE(Z4_MAX_PIN)
+ #error "Z4_MAX_PIN has no EXTINT line available."
+ #endif
+ attachInterrupt(Z4_MAX_PIN, endstop_ISR, CHANGE);
+ #endif
+ #if HAS_Z4_MIN
+ #if !AVAILABLE_EILINE(Z4_MIN_PIN)
+ #error "Z4_MIN_PIN has no EXTINT line available."
+ #endif
+ attachInterrupt(Z4_MIN_PIN, endstop_ISR, CHANGE);
+ #endif
#if HAS_Z_MIN_PROBE_PIN
#if !AVAILABLE_EILINE(Z_MIN_PROBE_PIN)
- static_assert(false, "Z_MIN_PROBE_PIN has no EXTINT line available.");
+ #error "Z_MIN_PROBE_PIN has no EXTINT line available."
#endif
attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);
#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/fastio.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/fastio.h
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/fastio.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/fastio.h
index ecd9acea..c456dfce 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/fastio.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/fastio.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -37,7 +37,7 @@
/**
* Magic I/O routines
*
- * Now you can simply SET_OUTPUT(STEP); WRITE(STEP, HIGH); WRITE(STEP, LOW);
+ * Now you can simply SET_OUTPUT(IO); WRITE(IO, HIGH); WRITE(IO, LOW);
*/
// Read a pin
@@ -88,8 +88,8 @@
const EPortType port = (EPortType)GET_SAMD_PORT(IO); \
const uint32_t pin = GET_SAMD_PIN(IO); \
\
- PORT->Group[port].PINCFG[pin].reg = (uint8_t)(PORT_PINCFG_INEN); \
PORT->Group[port].DIRSET.reg = MASK(pin); \
+ PORT->Group[port].PINCFG[pin].reg = 0; \
}while(0)
// Set pin as output (open drain)
#define SET_OUTPUT_OD(IO) do{ \
@@ -100,9 +100,9 @@
PORT->Group[port].DIRCLR.reg = MASK(pin); \
}while(0)
// Set pin as PWM (push pull)
-#define SET_PWM(IO) SET_OUTPUT(IO)
+#define SET_PWM SET_OUTPUT
// Set pin as PWM (open drain)
-#define SET_PWM_OD(IO) SET_OUTPUT_OD(IO)
+#define SET_PWM_OD SET_OUTPUT_OD
// check if pin is an output
#define IS_OUTPUT(IO) ((PORT->Group[(EPortType)GET_SAMD_PORT(IO)].DIR.reg & MASK(GET_SAMD_PIN(IO))) \
@@ -245,6 +245,7 @@
#define DIO17_PIN PIN_PC23
#define DIO88_PIN PIN_PC24 // NEOPIXEL
// PORTD
+ #define DIO53_PIN PIN_PD10
#define DIO22_PIN PIN_PD12
#define DIO6_PIN PIN_PD20
#define DIO7_PIN PIN_PD21
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/inc/Conditionals_LCD.h
new file mode 100644
index 00000000..5f1c4b16
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/inc/Conditionals_LCD.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/inc/Conditionals_adv.h
new file mode 100644
index 00000000..5f1c4b16
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/inc/Conditionals_adv.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/inc/Conditionals_post.h
new file mode 100644
index 00000000..ce6d3fdd
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/inc/Conditionals_post.h
@@ -0,0 +1,28 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#if USE_FALLBACK_EEPROM
+ #define FLASH_EEPROM_EMULATION
+#elif EITHER(I2C_EEPROM, SPI_EEPROM)
+ #define USE_SHARED_EEPROM 1
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/inc/SanityCheck.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/inc/SanityCheck.h
similarity index 83%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/inc/SanityCheck.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/inc/SanityCheck.h
index 98807226..ee04e2e2 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/inc/SanityCheck.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/inc/SanityCheck.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -23,6 +23,10 @@
* Test SAMD51 specific configuration values for errors at compile-time.
*/
+#if ENABLED(FLASH_EEPROM_EMULATION)
+ #warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Manager/releases"
+#endif
+
#if defined(ADAFRUIT_GRAND_CENTRAL_M4) && SD_CONNECTION_IS(CUSTOM_CABLE)
#error "No custom SD drive cable defined for this board."
#endif
@@ -31,6 +35,10 @@
#error "OnBoard SPI BUS can't be shared with other devices."
#endif
+#if SERVO_TC == RTC_TIMER_NUM
+ #error "Servos can't use RTC timer"
+#endif
+
#if ENABLED(EMERGENCY_PARSER)
#error "EMERGENCY_PARSER is not yet implemented for SAMD51. Disable EMERGENCY_PARSER to continue."
#endif
@@ -42,7 +50,3 @@
#if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform."
#endif
-
-#if ENABLED(EEPROM_SETTINGS) && NONE(SPI_EEPROM, I2C_EEPROM)
- #warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Activator"
-#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/pinsDebug.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/pinsDebug.h
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/pinsDebug.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/pinsDebug.h
index 64f6929c..c28937d6 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/pinsDebug.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/pinsDebug.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -149,5 +149,6 @@ void pwm_details(int32_t pin) {
* 92 | PA9 | QSPI: IO1
* 93 | PA10 | QSPI: IO2
* 94 | PA11 | QSPI: IO3
+ * 95 | PB31 | SD: DETECT
*
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/spi_pins.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/spi_pins.h
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/spi_pins.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/spi_pins.h
index 3315fa08..5a9b1275 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/spi_pins.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/spi_pins.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/timers.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/timers.cpp
new file mode 100644
index 00000000..a68af2e0
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/timers.cpp
@@ -0,0 +1,168 @@
+/**
+ * Marlin 3D Printer Firmware
+ *
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
+ *
+ * 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 .
+ *
+ */
+#ifdef __SAMD51__
+
+// --------------------------------------------------------------------------
+// Includes
+// --------------------------------------------------------------------------
+
+#include "../../inc/MarlinConfig.h"
+#include "ServoTimers.h" // for SERVO_TC
+
+// --------------------------------------------------------------------------
+// Local defines
+// --------------------------------------------------------------------------
+
+#define NUM_HARDWARE_TIMERS 8
+
+// --------------------------------------------------------------------------
+// Private Variables
+// --------------------------------------------------------------------------
+
+const tTimerConfig TimerConfig[NUM_HARDWARE_TIMERS+1] = {
+ { {.pTc=TC0}, TC0_IRQn, TC_PRIORITY(0) }, // 0 - stepper (assigned priority 2)
+ { {.pTc=TC1}, TC1_IRQn, TC_PRIORITY(1) }, // 1 - stepper (needed by 32 bit timers)
+ { {.pTc=TC2}, TC2_IRQn, 5 }, // 2 - tone (reserved by framework and fixed assigned priority 5)
+ { {.pTc=TC3}, TC3_IRQn, TC_PRIORITY(3) }, // 3 - servo (assigned priority 1)
+ { {.pTc=TC4}, TC4_IRQn, TC_PRIORITY(4) }, // 4 - software serial (no interrupts used)
+ { {.pTc=TC5}, TC5_IRQn, TC_PRIORITY(5) },
+ { {.pTc=TC6}, TC6_IRQn, TC_PRIORITY(6) },
+ { {.pTc=TC7}, TC7_IRQn, TC_PRIORITY(7) },
+ { {.pRtc=RTC}, RTC_IRQn, TC_PRIORITY(8) } // 8 - temperature (assigned priority 6)
+};
+
+// --------------------------------------------------------------------------
+// Private functions
+// --------------------------------------------------------------------------
+
+FORCE_INLINE void Disable_Irq(IRQn_Type irq) {
+ NVIC_DisableIRQ(irq);
+
+ // We NEED memory barriers to ensure Interrupts are actually disabled!
+ // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the )
+ __DSB();
+ __ISB();
+}
+
+// --------------------------------------------------------------------------
+// Public functions
+// --------------------------------------------------------------------------
+
+void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
+ IRQn_Type irq = TimerConfig[timer_num].IRQ_Id;
+
+ // Disable interrupt, just in case it was already enabled
+ Disable_Irq(irq);
+
+ if (timer_num == RTC_TIMER_NUM) {
+ Rtc * const rtc = TimerConfig[timer_num].pRtc;
+
+ // Disable timer interrupt
+ rtc->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_CMP0;
+
+ // RTC clock setup
+ OSC32KCTRL->RTCCTRL.reg = OSC32KCTRL_RTCCTRL_RTCSEL_XOSC32K; // External 32.768KHz oscillator
+
+ // Stop timer, just in case, to be able to reconfigure it
+ rtc->MODE0.CTRLA.bit.ENABLE = false;
+ SYNC(rtc->MODE0.SYNCBUSY.bit.ENABLE);
+
+ // Mode, reset counter on match
+ rtc->MODE0.CTRLA.reg = RTC_MODE0_CTRLA_MODE_COUNT32 | RTC_MODE0_CTRLA_MATCHCLR;
+
+ // Set compare value
+ rtc->MODE0.COMP[0].reg = (32768 + frequency / 2) / frequency;
+ SYNC(rtc->MODE0.SYNCBUSY.bit.COMP0);
+
+ // Enable interrupt on compare
+ rtc->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0; // reset pending interrupt
+ rtc->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_CMP0; // enable compare 0 interrupt
+
+ // And start timer
+ rtc->MODE0.CTRLA.bit.ENABLE = true;
+ SYNC(rtc->MODE0.SYNCBUSY.bit.ENABLE);
+ }
+ else {
+ Tc * const tc = TimerConfig[timer_num].pTc;
+
+ // Disable timer interrupt
+ tc->COUNT32.INTENCLR.reg = TC_INTENCLR_OVF; // disable overflow interrupt
+
+ // TCn clock setup
+ const uint8_t clockID = GCLK_CLKCTRL_IDs[TCC_INST_NUM + timer_num]; // TC clock are preceeded by TCC ones
+ GCLK->PCHCTRL[clockID].bit.CHEN = false;
+ SYNC(GCLK->PCHCTRL[clockID].bit.CHEN);
+ GCLK->PCHCTRL[clockID].reg = GCLK_PCHCTRL_GEN_GCLK0 | GCLK_PCHCTRL_CHEN; // 120MHz startup code programmed
+ SYNC(!GCLK->PCHCTRL[clockID].bit.CHEN);
+
+ // Stop timer, just in case, to be able to reconfigure it
+ tc->COUNT32.CTRLA.bit.ENABLE = false;
+ SYNC(tc->COUNT32.SYNCBUSY.bit.ENABLE);
+
+ // Reset timer
+ tc->COUNT32.CTRLA.bit.SWRST = true;
+ SYNC(tc->COUNT32.SYNCBUSY.bit.SWRST);
+
+ // Wave mode, reset counter on compare match
+ tc->COUNT32.WAVE.reg = TC_WAVE_WAVEGEN_MFRQ;
+ tc->COUNT32.CTRLA.reg = TC_CTRLA_MODE_COUNT32 | TC_CTRLA_PRESCALER_DIV1;
+ tc->COUNT32.CTRLBCLR.reg = TC_CTRLBCLR_DIR;
+ SYNC(tc->COUNT32.SYNCBUSY.bit.CTRLB);
+
+ // Set compare value
+ tc->COUNT32.CC[0].reg = (HAL_TIMER_RATE) / frequency;
+ tc->COUNT32.COUNT.reg = 0;
+
+ // Enable interrupt on compare
+ tc->COUNT32.INTFLAG.reg = TC_INTFLAG_OVF; // reset pending interrupt
+ tc->COUNT32.INTENSET.reg = TC_INTENSET_OVF; // enable overflow interrupt
+
+ // And start timer
+ tc->COUNT32.CTRLA.bit.ENABLE = true;
+ SYNC(tc->COUNT32.SYNCBUSY.bit.ENABLE);
+ }
+
+ // Finally, enable IRQ
+ NVIC_SetPriority(irq, TimerConfig[timer_num].priority);
+ NVIC_EnableIRQ(irq);
+}
+
+void HAL_timer_enable_interrupt(const uint8_t timer_num) {
+ const IRQn_Type irq = TimerConfig[timer_num].IRQ_Id;
+ NVIC_EnableIRQ(irq);
+}
+
+void HAL_timer_disable_interrupt(const uint8_t timer_num) {
+ const IRQn_Type irq = TimerConfig[timer_num].IRQ_Id;
+ Disable_Irq(irq);
+}
+
+// missing from CMSIS: Check if interrupt is enabled or not
+static bool NVIC_GetEnabledIRQ(IRQn_Type IRQn) {
+ return (NVIC->ISER[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F))) != 0;
+}
+
+bool HAL_timer_interrupt_enabled(const uint8_t timer_num) {
+ const IRQn_Type irq = TimerConfig[timer_num].IRQ_Id;
+ return NVIC_GetEnabledIRQ(irq);
+}
+
+#endif // __SAMD51__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/timers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/timers.h
similarity index 62%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/timers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/timers.h
index 80c37d14..dc6e38b7 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/timers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/timers.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -25,20 +25,27 @@
// --------------------------------------------------------------------------
// Defines
// --------------------------------------------------------------------------
+#define RTC_TIMER_NUM 8 // This is not a TC but a RTC
typedef uint32_t hal_timer_t;
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF
-#define HAL_TIMER_RATE SystemCoreClock // frequency of timers peripherals
+#define HAL_TIMER_RATE F_CPU // frequency of timers peripherals
-#define STEP_TIMER_NUM 0 // index of timer to use for stepper (also +1 for 32bits counter)
-#define PULSE_TIMER_NUM STEP_TIMER_NUM
-#define TEMP_TIMER_NUM 4 // index of timer to use for temperature (also +1 for 32bits counter)
+#ifndef STEP_TIMER_NUM
+ #define STEP_TIMER_NUM 0 // Timer Index for Stepper
+#endif
+#ifndef PULSE_TIMER_NUM
+ #define PULSE_TIMER_NUM STEP_TIMER_NUM
+#endif
+#ifndef TEMP_TIMER_NUM
+ #define TEMP_TIMER_NUM RTC_TIMER_NUM // Timer Index for Temperature
+#endif
#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
#define STEPPER_TIMER_RATE HAL_TIMER_RATE // frequency of stepper timer (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE)
-#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
+#define STEPPER_TIMER_TICKS_PER_US (STEPPER_TIMER_RATE / 1000000) // stepper timer ticks per µs
#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / STEPPER_TIMER_TICKS_PER_US)
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE
@@ -52,24 +59,34 @@ typedef uint32_t hal_timer_t;
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
-#define TC_PRIORITY(t) (t == STEP_TIMER_NUM || t == PULSE_TIMER_NUM) ? 2 \
- : (t == TEMP_TIMER_NUM) ? 6 \
+#define TC_PRIORITY(t) t == SERVO_TC ? 1 \
+ : (t == STEP_TIMER_NUM || t == PULSE_TIMER_NUM) ? 2 \
+ : (t == TEMP_TIMER_NUM) ? 6 \
: 7
-#define _TC_HANDLER(t) void TC##t##_Handler()
-#define TC_HANDLER(t) _TC_HANDLER(t)
-#define HAL_STEP_TIMER_ISR() TC_HANDLER(STEP_TIMER_NUM)
+#define _TC_HANDLER(t) void TC##t##_Handler()
+#define TC_HANDLER(t) _TC_HANDLER(t)
+#ifndef HAL_STEP_TIMER_ISR
+ #define HAL_STEP_TIMER_ISR() TC_HANDLER(STEP_TIMER_NUM)
+#endif
#if STEP_TIMER_NUM != PULSE_TIMER_NUM
- #define HAL_PULSE_TIMER_ISR() TC_HANDLER(PULSE_TIMER_NUM)
+ #define HAL_PULSE_TIMER_ISR() TC_HANDLER(PULSE_TIMER_NUM)
+#endif
+#if TEMP_TIMER_NUM == RTC_TIMER_NUM
+ #define HAL_TEMP_TIMER_ISR() void RTC_Handler()
+#else
+ #define HAL_TEMP_TIMER_ISR() TC_HANDLER(TEMP_TIMER_NUM)
#endif
-#define HAL_TEMP_TIMER_ISR() TC_HANDLER(TEMP_TIMER_NUM)
// --------------------------------------------------------------------------
// Types
// --------------------------------------------------------------------------
typedef struct {
- Tc *pTimer;
+ union {
+ Tc *pTc;
+ Rtc *pRtc;
+ };
IRQn_Type IRQ_Id;
uint8_t priority;
} tTimerConfig;
@@ -87,20 +104,23 @@ extern const tTimerConfig TimerConfig[];
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) {
- Tc * const tc = TimerConfig[timer_num].pTimer;
- tc->COUNT32.CC[0].reg = HAL_TIMER_TYPE_MAX - compare;
+ // Should never be called with timer RTC_TIMER_NUM
+ Tc * const tc = TimerConfig[timer_num].pTc;
+ tc->COUNT32.CC[0].reg = compare;
}
FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) {
- Tc * const tc = TimerConfig[timer_num].pTimer;
- return (hal_timer_t)(HAL_TIMER_TYPE_MAX - tc->COUNT32.CC[0].reg);
+ // Should never be called with timer RTC_TIMER_NUM
+ Tc * const tc = TimerConfig[timer_num].pTc;
+ return (hal_timer_t)tc->COUNT32.CC[0].reg;
}
FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
- Tc * const tc = TimerConfig[timer_num].pTimer;
+ // Should never be called with timer RTC_TIMER_NUM
+ Tc * const tc = TimerConfig[timer_num].pTc;
tc->COUNT32.CTRLBSET.reg = TC_CTRLBCLR_CMD_READSYNC;
SYNC(tc->COUNT32.SYNCBUSY.bit.CTRLB || tc->COUNT32.SYNCBUSY.bit.COUNT);
- return HAL_TIMER_TYPE_MAX - tc->COUNT32.COUNT.reg;
+ return tc->COUNT32.COUNT.reg;
}
void HAL_timer_enable_interrupt(const uint8_t timer_num);
@@ -108,9 +128,16 @@ void HAL_timer_disable_interrupt(const uint8_t timer_num);
bool HAL_timer_interrupt_enabled(const uint8_t timer_num);
FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) {
- Tc * const tc = TimerConfig[timer_num].pTimer;
- // Clear interrupt flag
- tc->COUNT32.INTFLAG.reg = TC_INTFLAG_OVF;
+ if (timer_num == RTC_TIMER_NUM) {
+ Rtc * const rtc = TimerConfig[timer_num].pRtc;
+ // Clear interrupt flag
+ rtc->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0;
+ }
+ else {
+ Tc * const tc = TimerConfig[timer_num].pTc;
+ // Clear interrupt flag
+ tc->COUNT32.INTFLAG.reg = TC_INTFLAG_OVF;
+ }
}
#define HAL_timer_isr_epilogue(timer_num)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/watchdog.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/watchdog.cpp
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/watchdog.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/watchdog.cpp
index 69a6de4e..ebc8dffe 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/watchdog.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/watchdog.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,10 +15,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __SAMD51__
#include "../../inc/MarlinConfig.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/watchdog.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/watchdog.h
similarity index 89%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/watchdog.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/watchdog.h
index b626b0b0..2cd47882 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_SAMD51/watchdog.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/SAMD51/watchdog.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
*
* This program is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/HAL.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/HAL.cpp
similarity index 65%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/HAL.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/HAL.cpp
index 4fbfa729..b1b727ce 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/HAL.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/HAL.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2017 Victor Perez
@@ -17,27 +17,17 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
#include "HAL.h"
+#include "usb_serial.h"
#include "../../inc/MarlinConfig.h"
#include "../shared/Delay.h"
-#if (__cplusplus == 201703L) && defined(__has_include)
- #define HAS_SWSERIAL __has_include()
-#else
- #define HAS_SWSERIAL HAS_TMC220x
-#endif
-
-#if HAS_SWSERIAL
- #include "SoftwareSerial.h"
-#endif
-
#if ENABLED(SRAM_EEPROM_EMULATION)
#if STM32F7xx
#include
@@ -73,7 +63,7 @@ uint16_t HAL_adc_result;
void HAL_init() {
FastIO_init();
- #if ENABLED(SDSUPPORT)
+ #if ENABLED(SDSUPPORT) && DISABLED(SDIO_SUPPORT)
OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
#endif
@@ -82,30 +72,42 @@ void HAL_init() {
#endif
#if ENABLED(SRAM_EEPROM_EMULATION)
- // Enable access to backup SRAM
- __HAL_RCC_PWR_CLK_ENABLE();
- HAL_PWR_EnableBkUpAccess();
- __HAL_RCC_BKPSRAM_CLK_ENABLE();
-
- // Enable backup regulator
- LL_PWR_EnableBkUpRegulator();
- // Wait until backup regulator is initialized
- while (!LL_PWR_IsActiveFlag_BRR());
- #endif // EEPROM_EMULATED_SRAM
-
- #if HAS_SWSERIAL
- SoftwareSerial::setInterruptPriority(SWSERIAL_TIMER_IRQ_PRIO, 0);
+ __HAL_RCC_PWR_CLK_ENABLE();
+ HAL_PWR_EnableBkUpAccess(); // Enable access to backup SRAM
+ __HAL_RCC_BKPSRAM_CLK_ENABLE();
+ LL_PWR_EnableBkUpRegulator(); // Enable backup regulator
+ while (!LL_PWR_IsActiveFlag_BRR()); // Wait until backup regulator is initialized
#endif
+
+ SetTimerInterruptPriorities();
+
+ TERN_(EMERGENCY_PARSER, USB_Hook_init());
}
void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); }
uint8_t HAL_get_reset_source() {
- if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET) return RST_WATCHDOG;
- if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) != RESET) return RST_SOFTWARE;
- if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) != RESET) return RST_EXTERNAL;
- if (__HAL_RCC_GET_FLAG(RCC_FLAG_PORRST) != RESET) return RST_POWER_ON;
- return 0;
+ return
+ #ifdef RCC_FLAG_IWDGRST // Some sources may not exist...
+ RESET != __HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) ? RST_WATCHDOG :
+ #endif
+ #ifdef RCC_FLAG_IWDG1RST
+ RESET != __HAL_RCC_GET_FLAG(RCC_FLAG_IWDG1RST) ? RST_WATCHDOG :
+ #endif
+ #ifdef RCC_FLAG_IWDG2RST
+ RESET != __HAL_RCC_GET_FLAG(RCC_FLAG_IWDG2RST) ? RST_WATCHDOG :
+ #endif
+ #ifdef RCC_FLAG_SFTRST
+ RESET != __HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) ? RST_SOFTWARE :
+ #endif
+ #ifdef RCC_FLAG_PINRST
+ RESET != __HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) ? RST_EXTERNAL :
+ #endif
+ #ifdef RCC_FLAG_PORRST
+ RESET != __HAL_RCC_GET_FLAG(RCC_FLAG_PORRST) ? RST_POWER_ON :
+ #endif
+ 0
+ ;
}
void _delay_ms(const int delay_ms) { delay(delay_ms); }
@@ -123,6 +125,6 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRe
uint16_t HAL_adc_get_result() { return HAL_adc_result; }
-void flashFirmware(int16_t) { NVIC_SystemReset(); }
+void flashFirmware(const int16_t) { NVIC_SystemReset(); }
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/HAL.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/HAL.h
similarity index 61%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/HAL.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/HAL.h
index 910d437b..730ada96 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/HAL.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/HAL.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2017 Victor Perez
@@ -17,7 +17,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -30,6 +30,7 @@
#include "../shared/HAL_SPI.h"
#include "fastio.h"
#include "watchdog.h"
+#include "MarlinSerial.h"
#include "../../inc/MarlinConfigPre.h"
@@ -44,59 +45,80 @@
// ------------------------
#if SERIAL_PORT == 0
- #error "Serial port 0 does not exist"
-#endif
-
-#if !WITHIN(SERIAL_PORT, -1, 6)
- #error "SERIAL_PORT must be from -1 to 6"
-#endif
-#if SERIAL_PORT == -1
+ #error "SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
+#elif SERIAL_PORT == -1
#define MYSERIAL0 SerialUSB
#elif SERIAL_PORT == 1
- #define MYSERIAL0 Serial1
+ #define MYSERIAL0 MSerial1
#elif SERIAL_PORT == 2
- #define MYSERIAL0 Serial2
+ #define MYSERIAL0 MSerial2
#elif SERIAL_PORT == 3
- #define MYSERIAL0 Serial3
+ #define MYSERIAL0 MSerial3
#elif SERIAL_PORT == 4
- #define MYSERIAL0 Serial4
+ #define MYSERIAL0 MSerial4
#elif SERIAL_PORT == 5
- #define MYSERIAL0 Serial5
+ #define MYSERIAL0 MSerial5
#elif SERIAL_PORT == 6
- #define MYSERIAL0 Serial6
+ #define MYSERIAL0 MSerial6
+#else
+ #error "SERIAL_PORT must be from -1 to 6. Please update your configuration."
#endif
#ifdef SERIAL_PORT_2
+ #define NUM_SERIAL 2
#if SERIAL_PORT_2 == 0
- #error "Serial port 0 does not exist"
- #endif
-
- #if !WITHIN(SERIAL_PORT_2, -1, 6)
- #error "SERIAL_PORT_2 must be from -1 to 6"
+ #error "SERIAL_PORT_2 cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif SERIAL_PORT_2 == SERIAL_PORT
- #error "SERIAL_PORT_2 must be different than SERIAL_PORT"
- #endif
- #define NUM_SERIAL 2
- #if SERIAL_PORT_2 == -1
+ #error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
+ #elif SERIAL_PORT_2 == -1
#define MYSERIAL1 SerialUSB
#elif SERIAL_PORT_2 == 1
- #define MYSERIAL1 Serial1
+ #define MYSERIAL1 MSerial1
#elif SERIAL_PORT_2 == 2
- #define MYSERIAL1 Serial2
+ #define MYSERIAL1 MSerial2
#elif SERIAL_PORT_2 == 3
- #define MYSERIAL1 Serial3
+ #define MYSERIAL1 MSerial3
#elif SERIAL_PORT_2 == 4
- #define MYSERIAL1 Serial4
+ #define MYSERIAL1 MSerial4
#elif SERIAL_PORT_2 == 5
- #define MYSERIAL1 Serial5
+ #define MYSERIAL1 MSerial5
#elif SERIAL_PORT_2 == 6
- #define MYSERIAL1 Serial6
+ #define MYSERIAL1 MSerial6
+ #else
+ #error "SERIAL_PORT_2 must be from -1 to 6. Please update your configuration."
#endif
#else
#define NUM_SERIAL 1
#endif
-#include "timers.h"
+#if HAS_DGUS_LCD
+ #if DGUS_SERIAL_PORT == 0
+ #error "DGUS_SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
+ #elif DGUS_SERIAL_PORT == SERIAL_PORT
+ #error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
+ #elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
+ #error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
+ #elif DGUS_SERIAL_PORT == -1
+ #define DGUS_SERIAL SerialUSB
+ #elif DGUS_SERIAL_PORT == 1
+ #define DGUS_SERIAL MSerial1
+ #elif DGUS_SERIAL_PORT == 2
+ #define DGUS_SERIAL MSerial2
+ #elif DGUS_SERIAL_PORT == 3
+ #define DGUS_SERIAL MSerial3
+ #elif DGUS_SERIAL_PORT == 4
+ #define DGUS_SERIAL MSerial4
+ #elif DGUS_SERIAL_PORT == 5
+ #define DGUS_SERIAL MSerial5
+ #elif DGUS_SERIAL_PORT == 6
+ #define DGUS_SERIAL MSerial6
+ #else
+ #error "DGUS_SERIAL_PORT must be from -1 to 6. Please update your configuration."
+ #endif
+
+ #define DGUS_SERIAL_GET_TX_BUFFER_FREE DGUS_SERIAL.availableForWrite
+#endif
+
/**
* TODO: review this to return 1 for pins that are not analog input
@@ -105,8 +127,8 @@
#define analogInputToDigitalPin(p) (p)
#endif
-#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq()
-#define CRITICAL_SECTION_END if (!primask) __enable_irq()
+#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq()
+#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
#define ISRS_ENABLED() (!__get_PRIMASK())
#define ENABLE_ISRS() __enable_irq()
#define DISABLE_ISRS() __disable_irq()
@@ -169,16 +191,6 @@ static inline int freeMemory() {
#pragma GCC diagnostic pop
-//
-// EEPROM
-//
-
-// Wire library should work for i2c EEPROMs
-void eeprom_write_byte(uint8_t *pos, unsigned char value);
-uint8_t eeprom_read_byte(uint8_t *pos);
-void eeprom_read_block(void *__dst, const void *__src, size_t __n);
-void eeprom_update_block(const void *__src, void *__dst, size_t __n);
-
//
// ADC
//
@@ -187,8 +199,9 @@ void eeprom_update_block(const void *__src, void *__dst, size_t __n);
inline void HAL_adc_init() {}
-#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
+#define HAL_ADC_VREF 3.3
#define HAL_ADC_RESOLUTION 10
+#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
#define HAL_READ_ADC() HAL_adc_result
#define HAL_ADC_READY() true
@@ -201,4 +214,4 @@ uint16_t HAL_adc_get_result();
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
#define PLATFORM_M997_SUPPORT
-void flashFirmware(int16_t value);
+void flashFirmware(const int16_t);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/HAL_SPI.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/HAL_SPI.cpp
new file mode 100644
index 00000000..202442a7
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/HAL_SPI.cpp
@@ -0,0 +1,230 @@
+/**
+ * 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
+ * Copyright (c) 2017 Victor Perez
+ *
+ * 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 .
+ *
+ */
+#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
+
+#include "../../inc/MarlinConfig.h"
+
+#include
+
+// ------------------------
+// Public Variables
+// ------------------------
+
+static SPISettings spiConfig;
+
+// ------------------------
+// Public functions
+// ------------------------
+
+#if ENABLED(SOFTWARE_SPI)
+
+ // ------------------------
+ // Software SPI
+ // ------------------------
+
+ #include "../shared/Delay.h"
+
+ void spiBegin(void) {
+ OUT_WRITE(SS_PIN, HIGH);
+ OUT_WRITE(SCK_PIN, HIGH);
+ SET_INPUT(MISO_PIN);
+ OUT_WRITE(MOSI_PIN, HIGH);
+ }
+
+ static uint16_t delay_STM32_soft_spi;
+
+ void spiInit(uint8_t spiRate) {
+ // Use datarates Marlin uses
+ switch (spiRate) {
+ case SPI_FULL_SPEED: delay_STM32_soft_spi = 125; break; // desired: 8,000,000 actual: ~1.1M
+ case SPI_HALF_SPEED: delay_STM32_soft_spi = 125; break; // desired: 4,000,000 actual: ~1.1M
+ case SPI_QUARTER_SPEED:delay_STM32_soft_spi = 250; break; // desired: 2,000,000 actual: ~890K
+ case SPI_EIGHTH_SPEED: delay_STM32_soft_spi = 500; break; // desired: 1,000,000 actual: ~590K
+ case SPI_SPEED_5: delay_STM32_soft_spi = 1000; break; // desired: 500,000 actual: ~360K
+ case SPI_SPEED_6: delay_STM32_soft_spi = 2000; break; // desired: 250,000 actual: ~210K
+ default: delay_STM32_soft_spi = 4000; break; // desired: 125,000 actual: ~123K
+ }
+ SPI.begin();
+ }
+
+ // Begin SPI transaction, set clock, bit order, data mode
+ void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { /* do nothing */ }
+
+ uint8_t HAL_SPI_STM32_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3
+ for (uint8_t bits = 8; bits--;) {
+ WRITE(SCK_PIN, LOW);
+ WRITE(MOSI_PIN, b & 0x80);
+
+ DELAY_NS(delay_STM32_soft_spi);
+ WRITE(SCK_PIN, HIGH);
+ DELAY_NS(delay_STM32_soft_spi);
+
+ b <<= 1; // little setup time
+ b |= (READ(MISO_PIN) != 0);
+ }
+ DELAY_NS(125);
+ return b;
+ }
+
+ // Soft SPI receive byte
+ uint8_t spiRec() {
+ DISABLE_ISRS(); // No interrupts during byte receive
+ const uint8_t data = HAL_SPI_STM32_SpiTransfer_Mode_3(0xFF);
+ ENABLE_ISRS(); // Enable interrupts
+ return data;
+ }
+
+ // Soft SPI read data
+ void spiRead(uint8_t *buf, uint16_t nbyte) {
+ for (uint16_t i = 0; i < nbyte; i++)
+ buf[i] = spiRec();
+ }
+
+ // Soft SPI send byte
+ void spiSend(uint8_t data) {
+ DISABLE_ISRS(); // No interrupts during byte send
+ HAL_SPI_STM32_SpiTransfer_Mode_3(data); // Don't care what is received
+ ENABLE_ISRS(); // Enable interrupts
+ }
+
+ // Soft SPI send block
+ void spiSendBlock(uint8_t token, const uint8_t *buf) {
+ spiSend(token);
+ for (uint16_t i = 0; i < 512; i++)
+ spiSend(buf[i]);
+ }
+
+#else
+
+ // ------------------------
+ // Hardware SPI
+ // ------------------------
+
+ /**
+ * VGPV SPI speed start and PCLK2/2, by default 108/2 = 54Mhz
+ */
+
+ /**
+ * @brief Begin SPI port setup
+ *
+ * @return Nothing
+ *
+ * @details Only configures SS pin since stm32duino creates and initialize the SPI object
+ */
+ void spiBegin() {
+ #if !PIN_EXISTS(SS)
+ #error "SS_PIN not defined!"
+ #endif
+
+ OUT_WRITE(SS_PIN, HIGH);
+ }
+
+ // Configure SPI for specified SPI speed
+ void spiInit(uint8_t spiRate) {
+ // Use datarates Marlin uses
+ uint32_t clock;
+ switch (spiRate) {
+ case SPI_FULL_SPEED: clock = 20000000; break; // 13.9mhz=20000000 6.75mhz=10000000 3.38mhz=5000000 .833mhz=1000000
+ case SPI_HALF_SPEED: clock = 5000000; break;
+ case SPI_QUARTER_SPEED: clock = 2500000; break;
+ case SPI_EIGHTH_SPEED: clock = 1250000; break;
+ case SPI_SPEED_5: clock = 625000; break;
+ case SPI_SPEED_6: clock = 300000; break;
+ default:
+ clock = 4000000; // Default from the SPI library
+ }
+ spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0);
+
+ #if ENABLED(CUSTOM_SPI_PINS)
+ SPI.setMISO(MISO_PIN);
+ SPI.setMOSI(MOSI_PIN);
+ SPI.setSCLK(SCK_PIN);
+ SPI.setSSEL(SS_PIN);
+ #endif
+
+ SPI.begin();
+ }
+
+ /**
+ * @brief Receives a single byte from the SPI port.
+ *
+ * @return Byte received
+ *
+ * @details
+ */
+ uint8_t spiRec() {
+ SPI.beginTransaction(spiConfig);
+ uint8_t returnByte = SPI.transfer(0xFF);
+ SPI.endTransaction();
+ return returnByte;
+ }
+
+ /**
+ * @brief Receive a number of bytes from the SPI port to a buffer
+ *
+ * @param buf Pointer to starting address of buffer to write to.
+ * @param nbyte Number of bytes to receive.
+ * @return Nothing
+ *
+ * @details Uses DMA
+ */
+ void spiRead(uint8_t* buf, uint16_t nbyte) {
+ if (nbyte == 0) return;
+ memset(buf, 0xFF, nbyte);
+ SPI.beginTransaction(spiConfig);
+ SPI.transfer(buf, nbyte);
+ SPI.endTransaction();
+ }
+
+ /**
+ * @brief Send a single byte on SPI port
+ *
+ * @param b Byte to send
+ *
+ * @details
+ */
+ void spiSend(uint8_t b) {
+ SPI.beginTransaction(spiConfig);
+ SPI.transfer(b);
+ SPI.endTransaction();
+ }
+
+ /**
+ * @brief Write token and then write from 512 byte buffer to SPI (for SD card)
+ *
+ * @param buf Pointer with buffer start address
+ * @return Nothing
+ *
+ * @details Use DMA
+ */
+ void spiSendBlock(uint8_t token, const uint8_t* buf) {
+ uint8_t rxBuf[512];
+ SPI.beginTransaction(spiConfig);
+ SPI.transfer(token);
+ SPI.transfer((uint8_t*)buf, &rxBuf, 512);
+ SPI.endTransaction();
+ }
+
+#endif // SOFTWARE_SPI
+
+#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/MarlinSerial.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/MarlinSerial.cpp
new file mode 100644
index 00000000..8d99ab78
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/MarlinSerial.cpp
@@ -0,0 +1,88 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * 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 .
+ *
+ */
+
+#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
+
+#include "../../inc/MarlinConfig.h"
+#include "MarlinSerial.h"
+
+#if ENABLED(EMERGENCY_PARSER)
+ #include "../../feature/e_parser.h"
+#endif
+
+#ifndef USART4
+ #define USART4 UART4
+#endif
+
+#ifndef USART5
+ #define USART5 UART5
+#endif
+
+#define DECLARE_SERIAL_PORT(ser_num) \
+ void _rx_complete_irq_ ## ser_num (serial_t * obj); \
+ MarlinSerial MSerial ## ser_num (USART ## ser_num, &_rx_complete_irq_ ## ser_num); \
+ void _rx_complete_irq_ ## ser_num (serial_t * obj) { MSerial ## ser_num ._rx_complete_irq(obj); }
+
+#define DECLARE_SERIAL_PORT_EXP(ser_num) DECLARE_SERIAL_PORT(ser_num)
+
+#if defined(SERIAL_PORT) && SERIAL_PORT >= 0
+ DECLARE_SERIAL_PORT_EXP(SERIAL_PORT)
+#endif
+
+#if defined(SERIAL_PORT_2) && SERIAL_PORT_2 >= 0
+ DECLARE_SERIAL_PORT_EXP(SERIAL_PORT_2)
+#endif
+
+#if defined(DGUS_SERIAL_PORT) && DGUS_SERIAL_PORT >= 0
+ DECLARE_SERIAL_PORT_EXP(DGUS_SERIAL_PORT)
+#endif
+
+void MarlinSerial::begin(unsigned long baud, uint8_t config) {
+ HardwareSerial::begin(baud, config);
+ // replace the IRQ callback with the one we have defined
+ #if ENABLED(EMERGENCY_PARSER)
+ _serial.rx_callback = _rx_callback;
+ #endif
+}
+
+// This function is Copyright (c) 2006 Nicholas Zambetti.
+void MarlinSerial::_rx_complete_irq(serial_t *obj) {
+ // No Parity error, read byte and store it in the buffer if there is room
+ unsigned char c;
+
+ if (uart_getc(obj, &c) == 0) {
+
+ rx_buffer_index_t i = (unsigned int)(obj->rx_head + 1) % SERIAL_RX_BUFFER_SIZE;
+
+ // if we should be storing the received character into the location
+ // just before the tail (meaning that the head would advance to the
+ // current location of the tail), we're about to overflow the buffer
+ // and so we don't write the character or advance the head.
+ if (i != obj->rx_tail) {
+ obj->rx_buff[obj->rx_head] = c;
+ obj->rx_head = i;
+ }
+
+ #if ENABLED(EMERGENCY_PARSER)
+ emergency_parser.update(emergency_state, c);
+ #endif
+ }
+}
+
+#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/MarlinSerial.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/MarlinSerial.h
new file mode 100644
index 00000000..5ab97ff3
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/MarlinSerial.h
@@ -0,0 +1,60 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#include "../../inc/MarlinConfigPre.h"
+
+#if ENABLED(EMERGENCY_PARSER)
+ #include "../../feature/e_parser.h"
+#endif
+
+typedef void (*usart_rx_callback_t)(serial_t * obj);
+
+class MarlinSerial : public HardwareSerial {
+public:
+ MarlinSerial(void* peripheral, usart_rx_callback_t rx_callback) :
+ HardwareSerial(peripheral), _rx_callback(rx_callback)
+ #if ENABLED(EMERGENCY_PARSER)
+ , emergency_state(EmergencyParser::State::EP_RESET)
+ #endif
+ { }
+
+ void begin(unsigned long baud, uint8_t config);
+ inline void begin(unsigned long baud) { begin(baud, SERIAL_8N1); }
+
+ void _rx_complete_irq(serial_t* obj);
+
+protected:
+ usart_rx_callback_t _rx_callback;
+ #if ENABLED(EMERGENCY_PARSER)
+ EmergencyParser::State emergency_state;
+ #endif
+};
+
+extern MarlinSerial MSerial1;
+extern MarlinSerial MSerial2;
+extern MarlinSerial MSerial3;
+extern MarlinSerial MSerial4;
+extern MarlinSerial MSerial5;
+extern MarlinSerial MSerial6;
+extern MarlinSerial MSerial7;
+extern MarlinSerial MSerial8;
+extern MarlinSerial MSerial9;
+extern MarlinSerial MSerial10;
+extern MarlinSerial MSerialLP1;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/README.md b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/README.md
similarity index 100%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/README.md
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/README.md
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp
new file mode 100644
index 00000000..9d32b342
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp
@@ -0,0 +1,286 @@
+/**
+ * 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 .
+ *
+ */
+
+#include "../../inc/MarlinConfig.h"
+
+#if ENABLED(SDIO_SUPPORT) && !defined(STM32GENERIC)
+
+#include
+#include
+
+#if NONE(STM32F103xE, STM32F103xG, STM32F4xx, STM32F7xx)
+ #error "ERROR - Only STM32F103xE, STM32F103xG, STM32F4xx or STM32F7xx CPUs supported"
+#endif
+
+#ifdef USBD_USE_CDC_COMPOSITE
+
+ // use USB drivers
+
+ extern "C" { int8_t SD_MSC_Read(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len);
+ int8_t SD_MSC_Write(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len);
+ extern SD_HandleTypeDef hsd;
+ }
+
+ bool SDIO_Init() {
+ return hsd.State == HAL_SD_STATE_READY; // return pass/fail status
+ }
+
+ bool SDIO_ReadBlock(uint32_t block, uint8_t *src) {
+ int8_t status = SD_MSC_Read(0, (uint8_t*)src, block, 1); // read one 512 byte block
+ return (bool) status;
+ }
+
+ bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
+ int8_t status = SD_MSC_Write(0, (uint8_t*)src, block, 1); // write one 512 byte block
+ return (bool) status;
+ }
+
+#else // !USBD_USE_CDC_COMPOSITE
+
+ // use local drivers
+ #if defined(STM32F103xE) || defined(STM32F103xG)
+ #include
+ #include
+ #elif defined(STM32F4xx)
+ #include
+ #include
+ #include
+ #include
+ #elif defined(STM32F7xx)
+ #include
+ #include
+ #include
+ #include
+ #else
+ #error "ERROR - Only STM32F103xE, STM32F103xG, STM32F4xx or STM32F7xx CPUs supported"
+ #endif
+
+ SD_HandleTypeDef hsd; // create SDIO structure
+
+ #define TRANSFER_CLOCK_DIV (uint8_t(SDIO_INIT_CLK_DIV) / 40)
+
+ #ifndef USBD_OK
+ #define USBD_OK 0
+ #endif
+
+ void go_to_transfer_speed() {
+ SD_InitTypeDef Init;
+
+ /* Default SDIO peripheral configuration for SD card initialization */
+ Init.ClockEdge = hsd.Init.ClockEdge;
+ Init.ClockBypass = hsd.Init.ClockBypass;
+ Init.ClockPowerSave = hsd.Init.ClockPowerSave;
+ Init.BusWide = hsd.Init.BusWide;
+ Init.HardwareFlowControl = hsd.Init.HardwareFlowControl;
+ Init.ClockDiv = TRANSFER_CLOCK_DIV;
+
+ /* Initialize SDIO peripheral interface with default configuration */
+ SDIO_Init(hsd.Instance, Init);
+ }
+
+ void SD_LowLevel_Init(void) {
+ uint32_t tempreg;
+
+ GPIO_InitTypeDef GPIO_InitStruct;
+
+ __HAL_RCC_GPIOC_CLK_ENABLE(); //enable GPIO clocks
+ __HAL_RCC_GPIOD_CLK_ENABLE(); //enable GPIO clocks
+
+ GPIO_InitStruct.Pin = GPIO_PIN_8 | GPIO_PIN_12; // D0 & SCK
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = 1; //GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
+ GPIO_InitStruct.Alternate = GPIO_AF12_SDIO;
+ HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
+
+ #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // define D1-D3 only if have a four bit wide SDIO bus
+ GPIO_InitStruct.Pin = GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11; // D1-D3
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = 1; // GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
+ GPIO_InitStruct.Alternate = GPIO_AF12_SDIO;
+ HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
+ #endif
+
+ // Configure PD.02 CMD line
+ GPIO_InitStruct.Pin = GPIO_PIN_2;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
+
+ RCC->APB2RSTR &= ~RCC_APB2RSTR_SDIORST_Msk; // take SDIO out of reset
+ RCC->APB2ENR |= RCC_APB2RSTR_SDIORST_Msk; // enable SDIO clock
+
+ // Enable the DMA2 Clock
+
+ //Initialize the SDIO (with initial <400Khz Clock)
+ tempreg = 0; //Reset value
+ tempreg |= SDIO_CLKCR_CLKEN; // Clock enabled
+ tempreg |= (uint32_t)0x76; // Clock Divider. Clock = 48000 / (118 + 2) = 400Khz
+ // Keep the rest at 0 => HW_Flow Disabled, Rising Clock Edge, Disable CLK ByPass, Bus Width = 0, Power save Disable
+ SDIO->CLKCR = tempreg;
+
+ // Power up the SDIO
+ SDIO->POWER = 0x03;
+ }
+
+ void HAL_SD_MspInit(SD_HandleTypeDef *hsd) { // application specific init
+ UNUSED(hsd); /* Prevent unused argument(s) compilation warning */
+ __HAL_RCC_SDIO_CLK_ENABLE(); // turn on SDIO clock
+ }
+
+ constexpr uint8_t SD_RETRY_COUNT = TERN(SD_CHECK_AND_RETRY, 3, 1);
+
+ bool SDIO_Init() {
+ //init SDIO and get SD card info
+
+ uint8_t retryCnt = SD_RETRY_COUNT;
+
+ bool status;
+ hsd.Instance = SDIO;
+ hsd.State = (HAL_SD_StateTypeDef) 0; // HAL_SD_STATE_RESET
+ SD_LowLevel_Init();
+
+ uint8_t retry_Cnt = retryCnt;
+ for (;;) {
+ status = (bool) HAL_SD_Init(&hsd);
+ if (!status) break;
+ if (!--retry_Cnt) return false; // return failing status if retries are exhausted
+ }
+
+ go_to_transfer_speed();
+
+ #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // go to 4 bit wide mode if pins are defined
+ retry_Cnt = retryCnt;
+ for (;;) {
+ if (!HAL_SD_ConfigWideBusOperation(&hsd, SDIO_BUS_WIDE_4B)) break; // some cards are only 1 bit wide so a pass here is not required
+ if (!--retry_Cnt) break;
+ }
+ if (!retry_Cnt) { // wide bus failed, go back to one bit wide mode
+ hsd.State = (HAL_SD_StateTypeDef) 0; // HAL_SD_STATE_RESET
+ SD_LowLevel_Init();
+ retry_Cnt = retryCnt;
+ for (;;) {
+ status = (bool) HAL_SD_Init(&hsd);
+ if (!status) break;
+ if (!--retry_Cnt) return false; // return failing status if retries are exhausted
+ }
+ }
+ #endif
+
+ return true;
+ }
+
+ void init_SDIO_pins(void) {
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+
+ /**SDIO GPIO Configuration
+ PC8 ------> SDIO_D0
+ PC12 ------> SDIO_CK
+ PD2 ------> SDIO_CMD
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_8;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStruct.Alternate = GPIO_AF12_SDIO;
+ HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_12;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStruct.Alternate = GPIO_AF12_SDIO;
+ HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_2;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
+ GPIO_InitStruct.Alternate = GPIO_AF12_SDIO;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
+ }
+
+ //bool SDIO_init() { return (bool) (SD_SDIO_Init() ? 1 : 0);}
+ //bool SDIO_Init_C() { return (bool) (SD_SDIO_Init() ? 1 : 0);}
+
+ bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) {
+ hsd.Instance = SDIO;
+ uint8_t retryCnt = SD_RETRY_COUNT;
+
+ bool status;
+ for (;;) {
+ status = (bool) HAL_SD_ReadBlocks(&hsd, (uint8_t*)dst, block, 1, 1000); // read one 512 byte block with 500mS timeout
+ status |= (bool) HAL_SD_GetCardState(&hsd); // make sure all is OK
+ if (!status) break; // return passing status
+ if (!--retryCnt) break; // return failing status if retries are exhausted
+ }
+ return status;
+
+ /*
+ return (bool) ((status_read | status_card) ? 1 : 0);
+
+ if (SDIO_GetCardState() != SDIO_CARD_TRANSFER) return false;
+ if (blockAddress >= SdCard.LogBlockNbr) return false;
+ if ((0x03 & (uint32_t)data)) return false; // misaligned data
+
+ if (SdCard.CardType != CARD_SDHC_SDXC) { blockAddress *= 512U; }
+
+ if (!SDIO_CmdReadSingleBlock(blockAddress)) {
+ SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS);
+ dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL);
+ return false;
+ }
+
+ while (!SDIO_GET_FLAG(SDIO_STA_DATAEND | SDIO_STA_TRX_ERROR_FLAGS)) {}
+
+ dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL);
+
+ if (SDIO->STA & SDIO_STA_RXDAVL) {
+ while (SDIO->STA & SDIO_STA_RXDAVL) (void)SDIO->FIFO;
+ SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS);
+ return false;
+ }
+
+ if (SDIO_GET_FLAG(SDIO_STA_TRX_ERROR_FLAGS)) {
+ SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS);
+ return false;
+ }
+ SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS);
+ */
+
+ return true;
+ }
+
+ bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
+ hsd.Instance = SDIO;
+ uint8_t retryCnt = SD_RETRY_COUNT;
+ bool status;
+ for (;;) {
+ status = (bool) HAL_SD_WriteBlocks(&hsd, (uint8_t*)src, block, 1, 500); // write one 512 byte block with 500mS timeout
+ status |= (bool) HAL_SD_GetCardState(&hsd); // make sure all is OK
+ if (!status) break; // return passing status
+ if (!--retryCnt) break; // return failing status if retries are exhausted
+ }
+ return status;
+ }
+
+#endif // !USBD_USE_CDC_COMPOSITE
+#endif // SDIO_SUPPORT
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/Servo.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/Servo.cpp
new file mode 100644
index 00000000..1cf117a0
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/Servo.cpp
@@ -0,0 +1,110 @@
+/**
+ * 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
+ * Copyright (c) 2017 Victor Perez
+ *
+ * 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 .
+ *
+ */
+#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
+
+#include "../../inc/MarlinConfig.h"
+
+#if HAS_SERVOS
+
+#include "Servo.h"
+
+static uint_fast8_t servoCount = 0;
+static libServo *servos[NUM_SERVOS] = {0};
+constexpr millis_t servoDelay[] = SERVO_DELAY;
+static_assert(COUNT(servoDelay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
+
+// Initialize to the default timer priority. This will be overridden by a call from timers.cpp.
+// This allows all timer interrupt priorities to be managed from a single location in the HAL.
+static uint32_t servo_interrupt_priority = NVIC_EncodePriority(NVIC_GetPriorityGrouping(), TIM_IRQ_PRIO, TIM_IRQ_SUBPRIO);
+
+// This must be called after the STM32 Servo class has intialized the timer.
+// It may only be needed after the first call to attach(), but it is possible
+// that is is necessary after every detach() call. To be safe this is currently
+// called after every call to attach().
+static void fixServoTimerInterruptPriority() {
+ NVIC_SetPriority(getTimerUpIrq(TIMER_SERVO), servo_interrupt_priority);
+}
+
+libServo::libServo()
+: delay(servoDelay[servoCount]),
+ was_attached_before_pause(false),
+ value_before_pause(0)
+{
+ servos[servoCount++] = this;
+}
+
+int8_t libServo::attach(const int pin) {
+ if (servoCount >= MAX_SERVOS) return -1;
+ if (pin > 0) servo_pin = pin;
+ auto result = stm32_servo.attach(servo_pin);
+ fixServoTimerInterruptPriority();
+ return result;
+}
+
+int8_t libServo::attach(const int pin, const int min, const int max) {
+ if (servoCount >= MAX_SERVOS) return -1;
+ if (pin > 0) servo_pin = pin;
+ auto result = stm32_servo.attach(servo_pin, min, max);
+ fixServoTimerInterruptPriority();
+ return result;
+}
+
+void libServo::move(const int value) {
+ if (attach(0) >= 0) {
+ stm32_servo.write(value);
+ safe_delay(delay);
+ TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
+ }
+}
+
+void libServo::pause() {
+ was_attached_before_pause = stm32_servo.attached();
+ if (was_attached_before_pause) {
+ value_before_pause = stm32_servo.read();
+ stm32_servo.detach();
+ }
+}
+
+void libServo::resume() {
+ if (was_attached_before_pause) {
+ attach();
+ move(value_before_pause);
+ }
+}
+
+void libServo::pause_all_servos() {
+ for (auto& servo : servos)
+ if (servo) servo->pause();
+}
+
+void libServo::resume_all_servos() {
+ for (auto& servo : servos)
+ if (servo) servo->resume();
+}
+
+void libServo::setInterruptPriority(uint32_t preemptPriority, uint32_t subPriority) {
+ servo_interrupt_priority = NVIC_EncodePriority(NVIC_GetPriorityGrouping(), preemptPriority, subPriority);
+}
+
+#endif // HAS_SERVOS
+#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/Servo.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/Servo.h
similarity index 61%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/Servo.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/Servo.h
index ec4b6be1..1527e753 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/Servo.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/Servo.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -17,23 +17,38 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
#include
+#include "../../core/millis_t.h"
+
// Inherit and expand on the official library
-class libServo : public Servo {
+class libServo {
public:
libServo();
- int8_t attach(const int pin);
+ int8_t attach(const int pin = 0); // pin == 0 uses value from previous call
int8_t attach(const int pin, const int min, const int max);
+ void detach() { stm32_servo.detach(); }
+ int read() { return stm32_servo.read(); }
void move(const int value);
+
+ void pause();
+ void resume();
+
+ static void pause_all_servos();
+ static void resume_all_servos();
+ static void setInterruptPriority(uint32_t preemptPriority, uint32_t subPriority);
+
private:
- typedef Servo super;
+ Servo stm32_servo;
int servo_pin = 0;
millis_t delay = 0;
+
+ bool was_attached_before_pause;
+ int value_before_pause;
};
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/SoftwareSerial.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/SoftwareSerial.cpp
similarity index 93%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/SoftwareSerial.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/SoftwareSerial.cpp
index f6363aa1..af92548c 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/SoftwareSerial.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/SoftwareSerial.cpp
@@ -3,14 +3,14 @@
*
* Multi-instance software serial library for Arduino/Wiring
* -- Interrupt-driven receive and other improvements by ladyada
- * (http://ladyada.net)
+ * (https://ladyada.net)
* -- Tuning, circular buffer, derivation from class Print/Stream,
* multi-instance support, porting to 8MHz processors,
* various optimizations, PROGMEM delay tables, inverse logic and
* direct port writing by Mikal Hart (http://www.arduiniana.org)
- * -- Pin change interrupt macros by Paul Stoffregen (http://www.pjrc.com)
+ * -- Pin change interrupt macros by Paul Stoffregen (https://www.pjrc.com)
* -- 20MHz processor support by Garrett Mace (http://www.macetech.com)
- * -- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/)
+ * -- ATmega1280/2560 support by Brett Hagman (https://www.roguerobotics.com/)
* -- STM32 support by Armin van der Togt
*
* This library is free software; you can redistribute it and/or
@@ -36,8 +36,9 @@
//
#if defined(PLATFORMIO) && defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
+#include "../../inc/MarlinConfig.h"
+
#include "SoftwareSerial.h"
-#include "timers.h"
#define OVERSAMPLE 3 // in RX, Timer will generate interruption OVERSAMPLE time during a bit. Thus OVERSAMPLE ticks in a bit. (interrupt not synchonized with edge).
@@ -47,49 +48,49 @@
// The order is based on (lack of) features and compare channels, we choose the simplest available
// because we only need an update interrupt
#if !defined(TIMER_SERIAL)
-#if defined (TIM18_BASE)
+#if defined(TIM18_BASE)
#define TIMER_SERIAL TIM18
-#elif defined (TIM7_BASE)
+#elif defined(TIM7_BASE)
#define TIMER_SERIAL TIM7
-#elif defined (TIM6_BASE)
+#elif defined(TIM6_BASE)
#define TIMER_SERIAL TIM6
-#elif defined (TIM22_BASE)
+#elif defined(TIM22_BASE)
#define TIMER_SERIAL TIM22
-#elif defined (TIM21_BASE)
+#elif defined(TIM21_BASE)
#define TIMER_SERIAL TIM21
-#elif defined (TIM17_BASE)
+#elif defined(TIM17_BASE)
#define TIMER_SERIAL TIM17
-#elif defined (TIM16_BASE)
+#elif defined(TIM16_BASE)
#define TIMER_SERIAL TIM16
-#elif defined (TIM15_BASE)
+#elif defined(TIM15_BASE)
#define TIMER_SERIAL TIM15
-#elif defined (TIM14_BASE)
+#elif defined(TIM14_BASE)
#define TIMER_SERIAL TIM14
-#elif defined (TIM13_BASE)
+#elif defined(TIM13_BASE)
#define TIMER_SERIAL TIM13
-#elif defined (TIM11_BASE)
+#elif defined(TIM11_BASE)
#define TIMER_SERIAL TIM11
-#elif defined (TIM10_BASE)
+#elif defined(TIM10_BASE)
#define TIMER_SERIAL TIM10
-#elif defined (TIM12_BASE)
+#elif defined(TIM12_BASE)
#define TIMER_SERIAL TIM12
-#elif defined (TIM19_BASE)
+#elif defined(TIM19_BASE)
#define TIMER_SERIAL TIM19
-#elif defined (TIM9_BASE)
+#elif defined(TIM9_BASE)
#define TIMER_SERIAL TIM9
-#elif defined (TIM5_BASE)
+#elif defined(TIM5_BASE)
#define TIMER_SERIAL TIM5
-#elif defined (TIM4_BASE)
+#elif defined(TIM4_BASE)
#define TIMER_SERIAL TIM4
-#elif defined (TIM3_BASE)
+#elif defined(TIM3_BASE)
#define TIMER_SERIAL TIM3
-#elif defined (TIM2_BASE)
+#elif defined(TIM2_BASE)
#define TIMER_SERIAL TIM2
-#elif defined (TIM20_BASE)
+#elif defined(TIM20_BASE)
#define TIMER_SERIAL TIM20
-#elif defined (TIM8_BASE)
+#elif defined(TIM8_BASE)
#define TIMER_SERIAL TIM8
-#elif defined (TIM1_BASE)
+#elif defined(TIM1_BASE)
#define TIMER_SERIAL TIM1
#else
#error No suitable timer found for SoftwareSerial, define TIMER_SERIAL in variant.h
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/SoftwareSerial.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/SoftwareSerial.h
similarity index 91%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/SoftwareSerial.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/SoftwareSerial.h
index 3799701c..1a4f742c 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/SoftwareSerial.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/SoftwareSerial.h
@@ -3,14 +3,14 @@
*
* Multi-instance software serial library for Arduino/Wiring
* -- Interrupt-driven receive and other improvements by ladyada
- * (http://ladyada.net)
+ * (https://ladyada.net)
* -- Tuning, circular buffer, derivation from class Print/Stream,
* multi-instance support, porting to 8MHz processors,
* various optimizations, PROGMEM delay tables, inverse logic and
* direct port writing by Mikal Hart (http://www.arduiniana.org)
- * -- Pin change interrupt macros by Paul Stoffregen (http://www.pjrc.com)
+ * -- Pin change interrupt macros by Paul Stoffregen (https://www.pjrc.com)
* -- 20MHz processor support by Garrett Mace (http://www.macetech.com)
- * -- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/)
+ * -- ATmega1280/2560 support by Brett Hagman (https://www.roguerobotics.com/)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -29,9 +29,7 @@
* The latest version of this library can always be found at
* http://arduiniana.org.
*/
-
-#ifndef SOFTWARESERIAL_H
-#define SOFTWARESERIAL_H
+#pragma once
#include
@@ -64,7 +62,6 @@ class SoftwareSerial : public Stream {
uint32_t delta_start = 0;
// static data
- static bool initialised;
static HardwareTimer timer;
static const IRQn_Type timer_interrupt_number;
static uint32_t timer_interrupt_priority;
@@ -91,7 +88,7 @@ class SoftwareSerial : public Stream {
public:
// public methods
- SoftwareSerial(uint16_t receivePin, uint16_t transmitPin, bool inverse_logic = false);
+ SoftwareSerial(uint16_t receivePin, uint16_t transmitPin, bool inverse_logic=false);
virtual ~SoftwareSerial();
void begin(long speed);
bool listen();
@@ -115,5 +112,3 @@ class SoftwareSerial : public Stream {
using Print::write;
};
-
-#endif // SOFTWARESERIAL_H
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/persistent_store_flash.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/eeprom_flash.cpp
similarity index 72%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/persistent_store_flash.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/eeprom_flash.cpp
index 0242b78a..0933b9f4 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/persistent_store_flash.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/eeprom_flash.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
@@ -17,22 +17,24 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
#include "../../inc/MarlinConfig.h"
-#if BOTH(EEPROM_SETTINGS, FLASH_EEPROM_EMULATION)
-
-#include "../shared/persistent_store_api.h"
+#if ENABLED(FLASH_EEPROM_EMULATION)
+#include "../shared/eeprom_api.h"
-// Only STM32F4 can support wear leveling at this time
-#ifndef STM32F4xx
- #undef FLASH_EEPROM_LEVELING
+#if HAS_SERVOS
+ #include "Servo.h"
+ #define PAUSE_SERVO_OUTPUT() libServo::pause_all_servos()
+ #define RESUME_SERVO_OUTPUT() libServo::resume_all_servos()
+#else
+ #define PAUSE_SERVO_OUTPUT()
+ #define RESUME_SERVO_OUTPUT()
#endif
/**
@@ -57,8 +59,8 @@
#define DEBUG_OUT ENABLED(EEPROM_CHITCHAT)
#include "src/core/debug_out.h"
- #ifndef EEPROM_SIZE
- #define EEPROM_SIZE 0x1000 // 4kB
+ #ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE 0x1000 // 4KB
#endif
#ifndef FLASH_SECTOR
@@ -68,11 +70,11 @@
#define FLASH_UNIT_SIZE 0x20000 // 128kB
#endif
- #define FLASH_ADDRESS_START (FLASH_END - ((FLASH_SECTOR_TOTAL - FLASH_SECTOR) * FLASH_UNIT_SIZE) + 1)
+ #define FLASH_ADDRESS_START (FLASH_END - ((FLASH_SECTOR_TOTAL - (FLASH_SECTOR)) * (FLASH_UNIT_SIZE)) + 1)
#define FLASH_ADDRESS_END (FLASH_ADDRESS_START + FLASH_UNIT_SIZE - 1)
- #define EEPROM_SLOTS (FLASH_UNIT_SIZE/EEPROM_SIZE)
- #define SLOT_ADDRESS(slot) (FLASH_ADDRESS_START + (slot * EEPROM_SIZE))
+ #define EEPROM_SLOTS ((FLASH_UNIT_SIZE) / (MARLIN_EEPROM_SIZE))
+ #define SLOT_ADDRESS(slot) (FLASH_ADDRESS_START + (slot * (MARLIN_EEPROM_SIZE)))
#define UNLOCK_FLASH() if (!flash_unlocked) { \
HAL_FLASH_Unlock(); \
@@ -85,12 +87,12 @@
#define EMPTY_UINT32 ((uint32_t)-1)
#define EMPTY_UINT8 ((uint8_t)-1)
- static uint8_t ram_eeprom[EEPROM_SIZE] __attribute__((aligned(4))) = {0};
+ static uint8_t ram_eeprom[MARLIN_EEPROM_SIZE] __attribute__((aligned(4))) = {0};
static int current_slot = -1;
- static_assert(0 == EEPROM_SIZE % 4, "EEPROM_SIZE must be a multiple of 4"); // Ensure copying as uint32_t is safe
- static_assert(0 == FLASH_UNIT_SIZE % EEPROM_SIZE, "EEPROM_SIZE must divide evenly into your FLASH_UNIT_SIZE");
- static_assert(FLASH_UNIT_SIZE >= EEPROM_SIZE, "FLASH_UNIT_SIZE must be greater than or equal to your EEPROM_SIZE");
+ static_assert(0 == MARLIN_EEPROM_SIZE % 4, "MARLIN_EEPROM_SIZE must be a multiple of 4"); // Ensure copying as uint32_t is safe
+ static_assert(0 == FLASH_UNIT_SIZE % MARLIN_EEPROM_SIZE, "MARLIN_EEPROM_SIZE must divide evenly into your FLASH_UNIT_SIZE");
+ static_assert(FLASH_UNIT_SIZE >= MARLIN_EEPROM_SIZE, "FLASH_UNIT_SIZE must be greater than or equal to your MARLIN_EEPROM_SIZE");
static_assert(IS_FLASH_SECTOR(FLASH_SECTOR), "FLASH_SECTOR is invalid");
static_assert(IS_POWER_OF_2(FLASH_UNIT_SIZE), "FLASH_UNIT_SIZE should be a power of 2, please check your chip's spec sheet");
@@ -98,6 +100,11 @@
static bool eeprom_data_written = false;
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE size_t(E2END + 1)
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+
bool PersistentStore::access_start() {
#if ENABLED(FLASH_EEPROM_LEVELING)
@@ -111,20 +118,20 @@ bool PersistentStore::access_start() {
while (address <= FLASH_ADDRESS_END) {
uint32_t address_value = (*(__IO uint32_t*)address);
if (address_value != EMPTY_UINT32) {
- current_slot = (address - FLASH_ADDRESS_START) / EEPROM_SIZE;
+ current_slot = (address - (FLASH_ADDRESS_START)) / (MARLIN_EEPROM_SIZE);
break;
}
address += sizeof(uint32_t);
}
if (current_slot == -1) {
// We didn't find anything, so we'll just intialize to empty
- for (int i = 0; i < EEPROM_SIZE; i++) ram_eeprom[i] = EMPTY_UINT8;
+ for (int i = 0; i < MARLIN_EEPROM_SIZE; i++) ram_eeprom[i] = EMPTY_UINT8;
current_slot = EEPROM_SLOTS;
}
else {
// load current settings
uint8_t *eeprom_data = (uint8_t *)SLOT_ADDRESS(current_slot);
- for (int i = 0; i < EEPROM_SIZE; i++) ram_eeprom[i] = eeprom_data[i];
+ for (int i = 0; i < MARLIN_EEPROM_SIZE; i++) ram_eeprom[i] = eeprom_data[i];
DEBUG_ECHOLNPAIR("EEPROM loaded from slot ", current_slot, ".");
}
eeprom_data_written = false;
@@ -140,6 +147,11 @@ bool PersistentStore::access_start() {
bool PersistentStore::access_finish() {
if (eeprom_data_written) {
+ #ifdef STM32F4xx
+ // MCU may come up with flash error bits which prevent some flash operations.
+ // Clear flags prior to flash operations to prevent errors.
+ __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR);
+ #endif
#if ENABLED(FLASH_EEPROM_LEVELING)
@@ -160,7 +172,11 @@ bool PersistentStore::access_finish() {
current_slot = EEPROM_SLOTS - 1;
UNLOCK_FLASH();
+ PAUSE_SERVO_OUTPUT();
+ DISABLE_ISRS();
status = HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError);
+ ENABLE_ISRS();
+ RESUME_SERVO_OUTPUT();
if (status != HAL_OK) {
DEBUG_ECHOLNPAIR("HAL_FLASHEx_Erase=", status);
DEBUG_ECHOLNPAIR("GetError=", HAL_FLASH_GetError());
@@ -174,7 +190,7 @@ bool PersistentStore::access_finish() {
uint32_t offset = 0;
uint32_t address = SLOT_ADDRESS(current_slot);
- uint32_t address_end = address + EEPROM_SIZE;
+ uint32_t address_end = address + MARLIN_EEPROM_SIZE;
uint32_t data = 0;
bool success = true;
@@ -205,7 +221,18 @@ bool PersistentStore::access_finish() {
return success;
#else
+ // The following was written for the STM32F4 but may work with other MCUs as well.
+ // Most STM32F4 flash does not allow reading from flash during erase operations.
+ // This takes about a second on a STM32F407 with a 128kB sector used as EEPROM.
+ // Interrupts during this time can have unpredictable results, such as killing Servo
+ // output. Servo output still glitches with interrupts disabled, but recovers after the
+ // erase.
+ PAUSE_SERVO_OUTPUT();
+ DISABLE_ISRS();
eeprom_buffer_flush();
+ ENABLE_ISRS();
+ RESUME_SERVO_OUTPUT();
+
eeprom_data_written = false;
#endif
}
@@ -236,13 +263,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
- const uint8_t c = (
- #if ENABLED(FLASH_EEPROM_LEVELING)
- ram_eeprom[pos]
- #else
- eeprom_buffered_read_byte(pos)
- #endif
- );
+ const uint8_t c = TERN(FLASH_EEPROM_LEVELING, ram_eeprom[pos], eeprom_buffered_read_byte(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
@@ -251,15 +272,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false;
}
-size_t PersistentStore::capacity() {
- return (
- #if ENABLED(FLASH_EEPROM_LEVELING)
- EEPROM_SIZE
- #else
- E2END + 1
- #endif
- );
-}
-
-#endif // EEPROM_SETTINGS && FLASH_EEPROM_EMULATION
+#endif // FLASH_EEPROM_EMULATION
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/eeprom_sdcard.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/eeprom_sdcard.cpp
new file mode 100644
index 00000000..711a83ed
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/eeprom_sdcard.cpp
@@ -0,0 +1,92 @@
+/**
+ * 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 .
+ *
+ */
+
+/**
+ * Implementation of EEPROM settings in SD Card
+ */
+
+#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
+
+#include "../../inc/MarlinConfig.h"
+
+#if ENABLED(SDCARD_EEPROM_EMULATION)
+
+#include "../shared/eeprom_api.h"
+#include "../../sd/cardreader.h"
+
+#define EEPROM_FILENAME "eeprom.dat"
+
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE 0x1000 // 4KB
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+
+#define _ALIGN(x) __attribute__ ((aligned(x)))
+static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE];
+
+bool PersistentStore::access_start() {
+ if (!card.isMounted()) return false;
+
+ SdFile file, root = card.getroot();
+ if (!file.open(&root, EEPROM_FILENAME, O_RDONLY))
+ return true;
+
+ int bytes_read = file.read(HAL_eeprom_data, MARLIN_EEPROM_SIZE);
+ if (bytes_read < 0) return false;
+ for (; bytes_read < MARLIN_EEPROM_SIZE; bytes_read++)
+ HAL_eeprom_data[bytes_read] = 0xFF;
+ file.close();
+ return true;
+}
+
+bool PersistentStore::access_finish() {
+ if (!card.isMounted()) return false;
+
+ SdFile file, root = card.getroot();
+ int bytes_written = 0;
+ if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) {
+ bytes_written = file.write(HAL_eeprom_data, MARLIN_EEPROM_SIZE);
+ file.close();
+ }
+ return (bytes_written == MARLIN_EEPROM_SIZE);
+}
+
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
+ for (size_t i = 0; i < size; i++)
+ HAL_eeprom_data[pos + i] = value[i];
+ crc16(crc, value, size);
+ pos += size;
+ return false;
+}
+
+bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
+ for (size_t i = 0; i < size; i++) {
+ uint8_t c = HAL_eeprom_data[pos + i];
+ if (writing) value[i] = c;
+ crc16(crc, &c, 1);
+ }
+ pos += size;
+ return false;
+}
+
+#endif // SDCARD_EEPROM_EMULATION
+#endif // STM32 && !STM32GENERIC
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/eeprom_sram.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/eeprom_sram.cpp
new file mode 100644
index 00000000..5f6f26f9
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/eeprom_sram.cpp
@@ -0,0 +1,68 @@
+/**
+ * Marlin 3D Printer Firmware
+ *
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
+ * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
+ * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
+ *
+ * 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 .
+ *
+ */
+#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
+
+#include "../../inc/MarlinConfig.h"
+
+#if ENABLED(SRAM_EEPROM_EMULATION)
+
+#include "../shared/eeprom_if.h"
+#include "../shared/eeprom_api.h"
+
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE 0x1000 // 4KB
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+
+bool PersistentStore::access_start() { return true; }
+bool PersistentStore::access_finish() { return true; }
+
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
+ while (size--) {
+ uint8_t v = *value;
+
+ // Save to Backup SRAM
+ *(__IO uint8_t *)(BKPSRAM_BASE + (uint8_t * const)pos) = v;
+
+ crc16(crc, &v, 1);
+ pos++;
+ value++;
+ };
+
+ return false;
+}
+
+bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
+ do {
+ // Read from either external EEPROM, program flash or Backup SRAM
+ const uint8_t c = ( *(__IO uint8_t *)(BKPSRAM_BASE + ((uint8_t*)pos)) );
+ if (writing) *value = c;
+ crc16(crc, &c, 1);
+ pos++;
+ value++;
+ } while (--size);
+ return false;
+}
+
+#endif // SRAM_EEPROM_EMULATION
+#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/eeprom_wired.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/eeprom_wired.cpp
new file mode 100644
index 00000000..8c46e45f
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/eeprom_wired.cpp
@@ -0,0 +1,81 @@
+/**
+ * Marlin 3D Printer Firmware
+ *
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
+ * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
+ * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
+ *
+ * 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 .
+ *
+ */
+#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
+
+#include "../../inc/MarlinConfig.h"
+
+#if USE_WIRED_EEPROM
+
+/**
+ * PersistentStore for Arduino-style EEPROM interface
+ * with simple implementations supplied by Marlin.
+ */
+
+#include "../shared/eeprom_if.h"
+#include "../shared/eeprom_api.h"
+
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE size_t(E2END + 1)
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+
+bool PersistentStore::access_start() { eeprom_init(); return true; }
+bool PersistentStore::access_finish() { return true; }
+
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
+ while (size--) {
+ uint8_t v = *value;
+
+ // EEPROM has only ~100,000 write cycles,
+ // so only write bytes that have changed!
+ uint8_t * const p = (uint8_t * const)pos;
+ if (v != eeprom_read_byte(p)) {
+ eeprom_write_byte(p, v);
+ if (eeprom_read_byte(p) != v) {
+ SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
+ return true;
+ }
+ }
+
+ crc16(crc, &v, 1);
+ pos++;
+ value++;
+ };
+
+ return false;
+}
+
+bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
+ do {
+ // Read from either external EEPROM, program flash or Backup SRAM
+ const uint8_t c = eeprom_read_byte((uint8_t*)pos);
+ if (writing) *value = c;
+ crc16(crc, &c, 1);
+ pos++;
+ value++;
+ } while (--size);
+ return false;
+}
+
+#endif // USE_WIRED_EEPROM
+#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/endstop_interrupts.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/endstop_interrupts.h
new file mode 100644
index 00000000..fdff8cc6
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/endstop_interrupts.h
@@ -0,0 +1,49 @@
+/**
+ * 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
+ * Copyright (c) 2017 Victor Perez
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#include "../../module/endstops.h"
+
+// One ISR for all EXT-Interrupts
+void endstop_ISR() { endstops.update(); }
+
+void setup_endstop_interrupts() {
+ #define _ATTACH(P) attachInterrupt(P, endstop_ISR, CHANGE)
+ TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN));
+ TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN));
+ TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN));
+ TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN));
+ TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN));
+ TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN));
+ TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN));
+ TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN));
+ TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN));
+ TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN));
+ TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN));
+ TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN));
+ TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN));
+ TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN));
+ TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
+ TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
+ TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
+}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/fastio.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/fastio.cpp
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/fastio.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/fastio.cpp
index 33685ced..0d55579d 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/fastio.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/fastio.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -17,7 +17,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
@@ -27,7 +27,7 @@
GPIO_TypeDef* FastIOPortMap[LastPort + 1];
void FastIO_init() {
- for (uint8_t i = 0; i < NUM_DIGITAL_PINS; i++)
+ LOOP_L_N(i, NUM_DIGITAL_PINS)
FastIOPortMap[STM_PORT(digitalPin[i])] = get_GPIO_Port(STM_PORT(digitalPin[i]));
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/fastio.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/fastio.h
similarity index 89%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/fastio.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/fastio.h
index 917ee3a1..d90b2fbe 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/fastio.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/fastio.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -17,7 +17,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -55,7 +55,7 @@ void FastIO_init(); // Must be called before using fast io macros
else FastIOPortMap[STM_PORT(digitalPin[IO])]->BRR = _BV32(STM_PIN(digitalPin[IO])) ; \
}while(0)
#else
- #define _WRITE(IO, V) (FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO]) + (V ? 0 : 16)))
+ #define _WRITE(IO, V) (FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO]) + ((V) ? 0 : 16)))
#endif
#define _READ(IO) bool(READ_BIT(FastIOPortMap[STM_PORT(digitalPin[IO])]->IDR, _BV32(STM_PIN(digitalPin[IO]))))
@@ -64,12 +64,14 @@ void FastIO_init(); // Must be called before using fast io macros
#define _GET_MODE(IO)
#define _SET_MODE(IO,M) pinMode(IO, M)
#define _SET_OUTPUT(IO) pinMode(IO, OUTPUT) /*!< Output Push Pull Mode & GPIO_NOPULL */
+#define _SET_OUTPUT_OD(IO) pinMode(IO, OUTPUT_OPEN_DRAIN)
#define WRITE(IO,V) _WRITE(IO,V)
#define READ(IO) _READ(IO)
#define TOGGLE(IO) _TOGGLE(IO)
#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0)
+#define OUT_WRITE_OD(IO,V) do{ _SET_OUTPUT_OD(IO); WRITE(IO,V); }while(0)
#define SET_INPUT(IO) _SET_MODE(IO, INPUT) /*!< Input Floating Mode */
#define SET_INPUT_PULLUP(IO) _SET_MODE(IO, INPUT_PULLUP) /*!< Input with Pull-up activation */
@@ -81,6 +83,7 @@ void FastIO_init(); // Must be called before using fast io macros
#define IS_OUTPUT(IO)
#define PWM_PIN(P) digitalPinHasPWM(P)
+#define NO_COMPILE_TIME_PWM
// digitalRead/Write wrappers
#define extDigitalRead(IO) digitalRead(IO)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/Conditionals_LCD.h
new file mode 100644
index 00000000..5f1c4b16
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/Conditionals_LCD.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/Conditionals_adv.h
new file mode 100644
index 00000000..5f1c4b16
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/Conditionals_adv.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/Conditionals_post.h
new file mode 100644
index 00000000..18826e11
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/Conditionals_post.h
@@ -0,0 +1,29 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+// If no real or emulated EEPROM selected, fall back to SD emulation
+#if USE_FALLBACK_EEPROM
+ #define SDCARD_EEPROM_EMULATION
+#elif EITHER(I2C_EEPROM, SPI_EEPROM)
+ #define USE_SHARED_EEPROM 1
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/SanityCheck.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/SanityCheck.h
new file mode 100644
index 00000000..37ca3d5a
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/inc/SanityCheck.h
@@ -0,0 +1,56 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+/**
+ * Test STM32-specific configuration values for errors at compile-time.
+ */
+//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
+// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
+//#endif
+
+#if ENABLED(FAST_PWM_FAN)
+ #error "FAST_PWM_FAN is not yet implemented for this platform."
+#endif
+
+#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT)
+ #undef SDCARD_EEPROM_EMULATION // Avoid additional error noise
+ #if USE_FALLBACK_EEPROM
+ #warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION."
+ #endif
+ #error "SDCARD_EEPROM_EMULATION requires SDSUPPORT. Enable SDSUPPORT or choose another EEPROM emulation."
+#endif
+
+#if defined(STM32F4xx) && BOTH(PRINTCOUNTER, FLASH_EEPROM_EMULATION)
+ #warning "FLASH_EEPROM_EMULATION may cause long delays when writing and should not be used while printing."
+ #error "Disable PRINTCOUNTER or choose another EEPROM emulation."
+#endif
+
+#if !defined(STM32F4xx) && ENABLED(FLASH_EEPROM_LEVELING)
+ #error "FLASH_EEPROM_LEVELING is currently only supported on STM32F4 hardware."
+#endif
+
+#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
+ #error "SERIAL_STATS_MAX_RX_QUEUED is not supported on this platform."
+#elif ENABLED(SERIAL_STATS_DROPPED_RX)
+ #error "SERIAL_STATS_DROPPED_RX is not supported on this platform."
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/pinsDebug.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/pinsDebug.h
similarity index 89%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/pinsDebug.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/pinsDebug.h
index 4e27cee1..ec08e3fd 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/pinsDebug.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/pinsDebug.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32GENERIC.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/pinsDebug_STM32GENERIC.h
similarity index 94%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32GENERIC.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/pinsDebug_STM32GENERIC.h
index b1c25621..5ff40deb 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32GENERIC.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/pinsDebug_STM32GENERIC.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -29,9 +29,9 @@
#ifdef BOARD_NR_GPIO_PINS // Only in STM32GENERIC (Maple)
#ifdef __STM32F1__
- #include "../HAL_STM32F1/fastio.h"
+ #include "../STM32F1/fastio.h"
#elif defined(STM32F4) || defined(STM32F7)
- #include "../HAL_STM32_F4_F7/fastio.h"
+ #include "../STM32_F4_F7/fastio.h"
#else
#include "fastio.h"
#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32duino.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/pinsDebug_STM32duino.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32duino.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/pinsDebug_STM32duino.h
index 9d9796ea..09f2bb54 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32duino.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/pinsDebug_STM32duino.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/pins_Xref.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/pins_Xref.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/pins_Xref.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/pins_Xref.h
index 84278c39..890e5618 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/pins_Xref.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/pins_Xref.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/spi_pins.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/spi_pins.h
similarity index 86%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/spi_pins.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/spi_pins.h
index f8c9546b..176e2a7b 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/spi_pins.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/spi_pins.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/timers.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/timers.cpp
similarity index 60%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/timers.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/timers.cpp
index c2a4cbdc..11967314 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/timers.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/timers.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
*
@@ -16,15 +16,12 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
-#include "HAL.h"
-
-#include "timers.h"
+#include "../../inc/MarlinConfig.h"
// ------------------------
// Local defines
@@ -32,11 +29,82 @@
#define NUM_HARDWARE_TIMERS 2
+// Default timer priorities. Override by specifying alternate priorities in the board pins file.
+// The TONE timer is not present here, as it currently cannot be set programmatically. It is set
+// by defining TIM_IRQ_PRIO in the variant.h or platformio.ini file, which adjusts the default
+// priority for STM32 HardwareTimer objects.
+#define SWSERIAL_TIMER_IRQ_PRIO_DEFAULT 1 // Requires tight bit timing to communicate reliably with TMC drivers
+#define SERVO_TIMER_IRQ_PRIO_DEFAULT 1 // Requires tight PWM timing to control a BLTouch reliably
+#define STEP_TIMER_IRQ_PRIO_DEFAULT 2
+#define TEMP_TIMER_IRQ_PRIO_DEFAULT 14 // Low priority avoids interference with other hardware and timers
+
+#ifndef STEP_TIMER_IRQ_PRIO
+ #define STEP_TIMER_IRQ_PRIO STEP_TIMER_IRQ_PRIO_DEFAULT
+#endif
+#ifndef TEMP_TIMER_IRQ_PRIO
+ #define TEMP_TIMER_IRQ_PRIO TEMP_TIMER_IRQ_PRIO_DEFAULT
+#endif
+#if HAS_TMC_SW_SERIAL
+ #include
+ #ifndef SWSERIAL_TIMER_IRQ_PRIO
+ #define SWSERIAL_TIMER_IRQ_PRIO SWSERIAL_TIMER_IRQ_PRIO_DEFAULT
+ #endif
+#endif
+#if HAS_SERVOS
+ #include "Servo.h"
+ #ifndef SERVO_TIMER_IRQ_PRIO
+ #define SERVO_TIMER_IRQ_PRIO SERVO_TIMER_IRQ_PRIO_DEFAULT
+ #endif
+#endif
+#if ENABLED(SPEAKER)
+ // Ensure the default timer priority is somewhere between the STEP and TEMP priorities.
+ // The STM32 framework defaults to interrupt 14 for all timers. This should be increased so that
+ // timing-sensitive operations such as speaker output are not impacted by the long-running
+ // temperature ISR. This must be defined in the platformio.ini file or the board's variant.h,
+ // so that it will be consumed by framework code.
+ #if !(TIM_IRQ_PRIO > STEP_TIMER_IRQ_PRIO && TIM_IRQ_PRIO < TEMP_TIMER_IRQ_PRIO)
+ #error "Default timer interrupt priority is unspecified or set to a value which may degrade performance."
+ #endif
+#endif
+
+#ifdef STM32F0xx
+ #define MCU_TIMER_RATE (F_CPU) // Frequency of timer peripherals
+ #define MCU_STEP_TIMER 16
+ #define MCU_TEMP_TIMER 17
+#elif defined(STM32F1xx)
+ #define MCU_TIMER_RATE (F_CPU)
+ #define MCU_STEP_TIMER 4
+ #define MCU_TEMP_TIMER 2
+#elif defined(STM32F401xC) || defined(STM32F401xE)
+ #define MCU_TIMER_RATE (F_CPU / 2)
+ #define MCU_STEP_TIMER 9
+ #define MCU_TEMP_TIMER 10
+#elif defined(STM32F4xx) || defined(STM32F7xx)
+ #define MCU_TIMER_RATE (F_CPU / 2)
+ #define MCU_STEP_TIMER 6 // STM32F401 has no TIM6, TIM7, or TIM8
+ #define MCU_TEMP_TIMER 14 // TIM7 is consumed by Software Serial if used.
+#endif
+
+#ifndef HAL_TIMER_RATE
+ #define HAL_TIMER_RATE MCU_TIMER_RATE
+#endif
+#ifndef STEP_TIMER
+ #define STEP_TIMER MCU_STEP_TIMER
+#endif
+#ifndef TEMP_TIMER
+ #define TEMP_TIMER MCU_TEMP_TIMER
+#endif
+
#define __TIMER_DEV(X) TIM##X
#define _TIMER_DEV(X) __TIMER_DEV(X)
#define STEP_TIMER_DEV _TIMER_DEV(STEP_TIMER)
#define TEMP_TIMER_DEV _TIMER_DEV(TEMP_TIMER)
+#define __TIMER_IRQ_NAME(X) TIM##X##_IRQn
+#define _TIMER_IRQ_NAME(X) __TIMER_IRQ_NAME(X)
+#define STEP_TIMER_IRQ_NAME _TIMER_IRQ_NAME(STEP_TIMER)
+#define TEMP_TIMER_IRQ_NAME _TIMER_IRQ_NAME(TEMP_TIMER)
+
// ------------------------
// Private Variables
// ------------------------
@@ -136,4 +204,9 @@ TIM_TypeDef * HAL_timer_device(const uint8_t timer_num) {
return nullptr;
}
+void SetTimerInterruptPriorities() {
+ TERN_(HAS_TMC_SW_SERIAL, SoftwareSerial::setInterruptPriority(SWSERIAL_TIMER_IRQ_PRIO, 0));
+ TERN_(HAS_SERVOS, libServo::setInterruptPriority(SERVO_TIMER_IRQ_PRIO, 0));
+}
+
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/timers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/timers.h
similarity index 68%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/timers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/timers.h
index 1d2c095f..000f8604 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/timers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/timers.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2017 Victor Perez
*
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -33,64 +33,19 @@
#define hal_timer_t uint32_t
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF // Timers can be 16 or 32 bit
-
-#ifdef STM32F0xx
-
- #define HAL_TIMER_RATE (F_CPU) // frequency of timer peripherals
-
- #ifndef STEP_TIMER
- #define STEP_TIMER 16
- #endif
-
- #ifndef TEMP_TIMER
- #define TEMP_TIMER 17
- #endif
-
-#elif defined(STM32F1xx)
-
- #define HAL_TIMER_RATE (F_CPU) // frequency of timer peripherals
-
- #ifndef STEP_TIMER
- #define STEP_TIMER 4
- #endif
-
- #ifndef TEMP_TIMER
- #define TEMP_TIMER 2
- #endif
-
-#elif defined(STM32F4xx) || defined(STM32F7xx)
-
- #define HAL_TIMER_RATE (F_CPU/2) // frequency of timer peripherals
-
- #ifndef STEP_TIMER
- #define STEP_TIMER 5
- #endif
-
- #ifndef TEMP_TIMER
- #define TEMP_TIMER 14 // TIM7 is consumed by Software Serial if used.
- #endif
-
-#endif
-
-#ifndef SWSERIAL_TIMER_IRQ_PRIO
- #define SWSERIAL_TIMER_IRQ_PRIO 1
+#ifndef STEP_TIMER_NUM
+ #define STEP_TIMER_NUM 0 // Timer Index for Stepper
#endif
-
-#ifndef STEP_TIMER_IRQ_PRIO
- #define STEP_TIMER_IRQ_PRIO 2
+#ifndef PULSE_TIMER_NUM
+ #define PULSE_TIMER_NUM STEP_TIMER_NUM
#endif
-
-#ifndef TEMP_TIMER_IRQ_PRIO
- #define TEMP_TIMER_IRQ_PRIO 14 //14 = after hardware ISRs
+#ifndef TEMP_TIMER_NUM
+ #define TEMP_TIMER_NUM 1 // Timer Index for Temperature
#endif
-#define STEP_TIMER_NUM 0 // index of timer to use for stepper
-#define TEMP_TIMER_NUM 1 // index of timer to use for temperature
-#define PULSE_TIMER_NUM STEP_TIMER_NUM
-
-#define TEMP_TIMER_FREQUENCY 1000 //Temperature::isr() is expected to be called at around 1kHz
+#define TEMP_TIMER_FREQUENCY 1000 // Temperature::isr() is expected to be called at around 1kHz
-//TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp
+// TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp
#define STEPPER_TIMER_RATE 2000000 // 2 Mhz
#define STEPPER_TIMER_PRESCALE ((HAL_TIMER_RATE)/(STEPPER_TIMER_RATE))
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
@@ -99,12 +54,6 @@
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
-#define __TIMER_IRQ_NAME(X) TIM##X##_IRQn
-#define _TIMER_IRQ_NAME(X) __TIMER_IRQ_NAME(X)
-
-#define STEP_TIMER_IRQ_NAME _TIMER_IRQ_NAME(STEP_TIMER)
-#define TEMP_TIMER_IRQ_NAME _TIMER_IRQ_NAME(TEMP_TIMER)
-
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM)
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM)
#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM)
@@ -114,8 +63,13 @@
extern void Step_Handler(HardwareTimer *htim);
extern void Temp_Handler(HardwareTimer *htim);
-#define HAL_STEP_TIMER_ISR() void Step_Handler(HardwareTimer *htim)
-#define HAL_TEMP_TIMER_ISR() void Temp_Handler(HardwareTimer *htim)
+
+#ifndef HAL_STEP_TIMER_ISR
+ #define HAL_STEP_TIMER_ISR() void Step_Handler(HardwareTimer *htim)
+#endif
+#ifndef HAL_TEMP_TIMER_ISR
+ #define HAL_TEMP_TIMER_ISR() void Temp_Handler(HardwareTimer *htim)
+#endif
// ------------------------
// Public Variables
@@ -132,6 +86,10 @@ void HAL_timer_enable_interrupt(const uint8_t timer_num);
void HAL_timer_disable_interrupt(const uint8_t timer_num);
bool HAL_timer_interrupt_enabled(const uint8_t timer_num);
+// Configure timer priorities for peripherals such as Software Serial or Servos.
+// Exposed here to allow all timer priority information to reside in timers.cpp
+void SetTimerInterruptPriorities();
+
//TIM_TypeDef* HAL_timer_device(const uint8_t timer_num); no need to be public for now. not public = not used externally
// FORCE_INLINE because these are used in performance-critical situations
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/usb_serial.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/usb_serial.cpp
new file mode 100644
index 00000000..2dd1bef1
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/usb_serial.cpp
@@ -0,0 +1,55 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * 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 .
+ *
+ */
+
+#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
+
+#include "../../inc/MarlinConfigPre.h"
+
+#if ENABLED(EMERGENCY_PARSER)
+
+#include "usb_serial.h"
+#include "../../feature/e_parser.h"
+
+EmergencyParser::State emergency_state = EmergencyParser::State::EP_RESET;
+
+int8_t (*USBD_CDC_Receive_original) (uint8_t *Buf, uint32_t *Len) = nullptr;
+
+static int8_t USBD_CDC_Receive_hook(uint8_t *Buf, uint32_t *Len) {
+ for (uint32_t i = 0; i < *Len; i++)
+ emergency_parser.update(emergency_state, Buf[i]);
+ return USBD_CDC_Receive_original(Buf, Len);
+}
+
+typedef struct _USBD_CDC_Itf {
+ int8_t (* Init)(void);
+ int8_t (* DeInit)(void);
+ int8_t (* Control)(uint8_t cmd, uint8_t *pbuf, uint16_t length);
+ int8_t (* Receive)(uint8_t *Buf, uint32_t *Len);
+ int8_t (* Transferred)(void);
+} USBD_CDC_ItfTypeDef;
+
+extern USBD_CDC_ItfTypeDef USBD_CDC_fops;
+
+void USB_Hook_init() {
+ USBD_CDC_Receive_original = USBD_CDC_fops.Receive;
+ USBD_CDC_fops.Receive = USBD_CDC_Receive_hook;
+}
+
+#endif // EMERGENCY_PARSER
+#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/usb_serial.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/usb_serial.h
new file mode 100644
index 00000000..ca61b9ed
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/usb_serial.h
@@ -0,0 +1,21 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+void USB_Hook_init();
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/watchdog.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/watchdog.cpp
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/watchdog.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/watchdog.cpp
index 4defadaa..37e5638b 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/watchdog.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/watchdog.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
#include "../../inc/MarlinConfigPre.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/watchdog.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/watchdog.h
similarity index 85%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/watchdog.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/watchdog.h
index 68550167..49a0d9c6 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32/watchdog.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32/watchdog.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/HAL.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/HAL.cpp
similarity index 89%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/HAL.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/HAL.cpp
index 9dcb77ae..d7f9264b 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/HAL.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/HAL.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2017 Victor Perez
@@ -17,7 +17,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -100,7 +100,7 @@ const uint8_t adc_pins[] = {
#if HAS_HEATED_BED
TEMP_BED_PIN,
#endif
- #if HAS_HEATED_CHAMBER
+ #if HAS_TEMP_CHAMBER
TEMP_CHAMBER_PIN,
#endif
#if HAS_TEMP_ADC_1
@@ -118,6 +118,12 @@ const uint8_t adc_pins[] = {
#if HAS_TEMP_ADC_5
TEMP_5_PIN,
#endif
+ #if HAS_TEMP_ADC_6
+ TEMP_6_PIN,
+ #endif
+ #if HAS_TEMP_ADC_7
+ TEMP_7_PIN,
+ #endif
#if ENABLED(FILAMENT_WIDTH_SENSOR)
FILWIDTH_PIN,
#endif
@@ -133,16 +139,22 @@ const uint8_t adc_pins[] = {
#if HAS_JOY_ADC_Z
JOY_Z_PIN,
#endif
+ #if ENABLED(POWER_MONITOR_CURRENT)
+ POWER_MONITOR_CURRENT_PIN,
+ #endif
+ #if ENABLED(POWER_MONITOR_VOLTAGE)
+ POWER_MONITOR_VOLTAGE_PIN,
+ #endif
};
-enum TEMP_PINS : char {
+enum TempPinIndex : char {
#if HAS_TEMP_ADC_0
TEMP_0,
#endif
#if HAS_HEATED_BED
TEMP_BED,
#endif
- #if HAS_HEATED_CHAMBER
+ #if HAS_TEMP_CHAMBER
TEMP_CHAMBER,
#endif
#if HAS_TEMP_ADC_1
@@ -160,6 +172,12 @@ enum TEMP_PINS : char {
#if HAS_TEMP_ADC_5
TEMP_5,
#endif
+ #if HAS_TEMP_ADC_6
+ TEMP_6,
+ #endif
+ #if HAS_TEMP_ADC_7
+ TEMP_7,
+ #endif
#if ENABLED(FILAMENT_WIDTH_SENSOR)
FILWIDTH,
#endif
@@ -175,6 +193,12 @@ enum TEMP_PINS : char {
#if HAS_JOY_ADC_Z
JOY_Z,
#endif
+ #if ENABLED(POWER_MONITOR_CURRENT)
+ POWERMON_CURRENT,
+ #endif
+ #if ENABLED(POWER_MONITOR_VOLTAGE)
+ POWERMON_VOLTS,
+ #endif
ADC_PIN_COUNT
};
@@ -234,7 +258,7 @@ void HAL_init() {
// HAL idle task
void HAL_idletask() {
#ifdef USE_USB_COMPOSITE
- #if ENABLED(SHARED_SD_CARD)
+ #if HAS_SHARED_MEDIA
// If Marlin is using the SD card we need to lock it to prevent access from
// a PC via USB.
// Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but
@@ -242,28 +266,19 @@ void HAL_idletask() {
// the disk if Marlin has it mounted. Unfortunately there is currently no way
// to unmount the disk from the LCD menu.
// if (IS_SD_PRINTING() || IS_SD_FILE_OPEN())
- /* copy from lpc1768 framework, should be fixed later for process SHARED_SD_CARD*/
+ /* copy from lpc1768 framework, should be fixed later for process HAS_SHARED_MEDIA*/
#endif
// process USB mass storage device class loop
MarlinMSC.loop();
#endif
}
-/* VGPV Done with defines
-// disable interrupts
-void cli() { noInterrupts(); }
-
-// enable interrupts
-void sei() { interrupts(); }
-*/
-
void HAL_clear_reset_source() { }
/**
* TODO: Check this and change or remove.
- * currently returns 1 that's equal to poweron reset.
*/
-uint8_t HAL_get_reset_source() { return 1; }
+uint8_t HAL_get_reset_source() { return RST_POWER_ON; }
void _delay_ms(const int delay_ms) { delay(delay_ms); }
@@ -319,7 +334,8 @@ void HAL_adc_init() {
}
void HAL_adc_start_conversion(const uint8_t adc_pin) {
- TEMP_PINS pin_index;
+ //TEMP_PINS pin_index;
+ TempPinIndex pin_index;
switch (adc_pin) {
default: return;
#if HAS_TEMP_ADC_0
@@ -328,7 +344,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
#if HAS_HEATED_BED
case TEMP_BED_PIN: pin_index = TEMP_BED; break;
#endif
- #if HAS_HEATED_CHAMBER
+ #if HAS_TEMP_CHAMBER
case TEMP_CHAMBER_PIN: pin_index = TEMP_CHAMBER; break;
#endif
#if HAS_TEMP_ADC_1
@@ -346,6 +362,12 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
#if HAS_TEMP_ADC_5
case TEMP_5_PIN: pin_index = TEMP_5; break;
#endif
+ #if HAS_TEMP_ADC_6
+ case TEMP_6_PIN: pin_index = TEMP_6; break;
+ #endif
+ #if HAS_TEMP_ADC_7
+ case TEMP_7_PIN: pin_index = TEMP_7; break;
+ #endif
#if HAS_JOY_ADC_X
case JOY_X_PIN: pin_index = JOY_X; break;
#endif
@@ -361,6 +383,12 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
#if ENABLED(ADC_KEYPAD)
case ADC_KEYPAD_PIN: pin_index = ADC_KEY; break;
#endif
+ #if ENABLED(POWER_MONITOR_CURRENT)
+ case POWER_MONITOR_CURRENT_PIN: pin_index = POWERMON_CURRENT; break;
+ #endif
+ #if ENABLED(POWER_MONITOR_VOLTAGE)
+ case POWER_MONITOR_VOLTAGE_PIN: pin_index = POWERMON_VOLTS; break;
+ #endif
}
HAL_adc_result = (HAL_adc_results[(int)pin_index] >> 2) & 0x3FF; // shift to get 10 bits only.
}
@@ -378,6 +406,6 @@ void analogWrite(pin_t pin, int pwm_val8) {
analogWrite(uint8_t(pin), pwm_val8);
}
-void flashFirmware(int16_t value) { nvic_sys_reset(); }
+void flashFirmware(const int16_t) { nvic_sys_reset(); }
#endif // __STM32F1__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/HAL.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/HAL.h
similarity index 73%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/HAL.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/HAL.h
index a88b7210..5a0b0460 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/HAL.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/HAL.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2017 Victor Perez
@@ -17,7 +17,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -36,7 +36,6 @@
#include "fastio.h"
#include "watchdog.h"
-#include "timers.h"
#include
#include
@@ -52,7 +51,7 @@
// ------------------------
#ifndef STM32_FLASH_SIZE
- #ifdef MCU_STM32F103RE
+ #if defined(MCU_STM32F103RE) || defined(MCU_STM32F103VE)
#define STM32_FLASH_SIZE 512
#else
#define STM32_FLASH_SIZE 256
@@ -78,13 +77,10 @@
#define MSerial5 Serial4
#endif
-#if !WITHIN(SERIAL_PORT, -1, 5)
- #error "SERIAL_PORT must be from -1 to 5"
-#endif
-#if SERIAL_PORT == -1
+#if SERIAL_PORT == 0
+ #error "SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
+#elif SERIAL_PORT == -1
#define MYSERIAL0 UsbSerial
-#elif SERIAL_PORT == 0
- #error "Serial port 0 does not exist"
#elif SERIAL_PORT == 1
#define MYSERIAL0 MSerial1
#elif SERIAL_PORT == 2
@@ -95,19 +91,17 @@
#define MYSERIAL0 MSerial4
#elif SERIAL_PORT == 5
#define MYSERIAL0 MSerial5
+#else
+ #error "SERIAL_PORT must be from -1 to 5. Please update your configuration."
#endif
#ifdef SERIAL_PORT_2
- #if !WITHIN(SERIAL_PORT_2, -1, 5)
- #error "SERIAL_PORT_2 must be from -1 to 5"
+ #if SERIAL_PORT_2 == 0
+ #error "SERIAL_PORT_2 cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif SERIAL_PORT_2 == SERIAL_PORT
- #error "SERIAL_PORT_2 must be different than SERIAL_PORT"
- #endif
- #define NUM_SERIAL 2
- #if SERIAL_PORT_2 == -1
+ #error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
+ #elif SERIAL_PORT_2 == -1
#define MYSERIAL1 UsbSerial
- #elif SERIAL_PORT_2 == 0
- #error "Serial port 0 does not exist"
#elif SERIAL_PORT_2 == 1
#define MYSERIAL1 MSerial1
#elif SERIAL_PORT_2 == 2
@@ -118,11 +112,39 @@
#define MYSERIAL1 MSerial4
#elif SERIAL_PORT_2 == 5
#define MYSERIAL1 MSerial5
+ #else
+ #error "SERIAL_PORT_2 must be from -1 to 5. Please update your configuration."
#endif
+ #define NUM_SERIAL 2
#else
#define NUM_SERIAL 1
#endif
+#ifdef DGUS_SERIAL
+ #if DGUS_SERIAL_PORT == 0
+ #error "DGUS_SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
+ #elif DGUS_SERIAL_PORT == SERIAL_PORT
+ #error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
+ #elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
+ #error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
+ #elif DGUS_SERIAL_PORT == -1
+ #define DGUS_SERIAL UsbSerial
+ #elif DGUS_SERIAL_PORT == 1
+ #define DGUS_SERIAL MSerial1
+ #elif DGUS_SERIAL_PORT == 2
+ #define DGUS_SERIAL MSerial2
+ #elif DGUS_SERIAL_PORT == 3
+ #define DGUS_SERIAL MSerial3
+ #elif DGUS_SERIAL_PORT == 4
+ #define DGUS_SERIAL MSerial4
+ #elif DGUS_SERIAL_PORT == 5
+ #define DGUS_SERIAL MSerial5
+ #else
+ #error "DGUS_SERIAL_PORT must be from -1 to 5. Please update your configuration."
+ #endif
+#endif
+
+
// Set interrupt grouping for this MCU
void HAL_init();
#define HAL_IDLETASK 1
@@ -137,10 +159,11 @@ void HAL_idletask();
#ifndef digitalPinHasPWM
#define digitalPinHasPWM(P) (PIN_MAP[P].timer_device != nullptr)
+ #define NO_COMPILE_TIME_PWM
#endif
-#define CRITICAL_SECTION_START uint32_t primask = __get_primask(); (void)__iCliRetVal()
-#define CRITICAL_SECTION_END if (!primask) (void)__iSeiRetVal()
+#define CRITICAL_SECTION_START() uint32_t primask = __get_primask(); (void)__iCliRetVal()
+#define CRITICAL_SECTION_END() if (!primask) (void)__iSeiRetVal()
#define ISRS_ENABLED() (!__get_primask())
#define ENABLE_ISRS() ((void)__iSeiRetVal())
#define DISABLE_ISRS() ((void)__iCliRetVal())
@@ -224,19 +247,6 @@ static int freeMemory() {
#pragma GCC diagnostic pop
-//
-// EEPROM
-//
-
-/**
- * TODO: Write all this EEPROM stuff. Can emulate EEPROM in flash as last resort.
- * Wire library should work for i2c EEPROMs.
- */
-void eeprom_write_byte(uint8_t *pos, unsigned char value);
-uint8_t eeprom_read_byte(uint8_t *pos);
-void eeprom_read_block(void *__dst, const void *__src, size_t __n);
-void eeprom_update_block(const void *__src, void *__dst, size_t __n);
-
//
// ADC
//
@@ -245,8 +255,9 @@ void eeprom_update_block(const void *__src, void *__dst, size_t __n);
void HAL_adc_init();
-#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
+#define HAL_ADC_VREF 3.3
#define HAL_ADC_RESOLUTION 10
+#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
#define HAL_READ_ADC() HAL_adc_result
#define HAL_ADC_READY() true
@@ -264,4 +275,4 @@ void analogWrite(pin_t pin, int pwm_val8); // PWM only! mul by 257 in maple!?
#define JTAGSWD_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_NONE)
#define PLATFORM_M997_SUPPORT
-void flashFirmware(int16_t value);
+void flashFirmware(const int16_t);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/HAL_SPI.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/HAL_SPI.cpp
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/HAL_SPI.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/HAL_SPI.cpp
index 9f3f3423..4d72473e 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/HAL_SPI.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/HAL_SPI.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -17,7 +17,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/README.md b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/README.md
similarity index 100%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/README.md
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/README.md
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/SPI.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/SPI.cpp
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/SPI.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/SPI.cpp
index 8eb8f9aa..80095ba1 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/SPI.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/SPI.cpp
@@ -216,7 +216,7 @@ void SPIClass::setDataMode(uint8_t dataMode) {
/**
* Notes:
* As far as we know the AVR numbers for dataMode match the numbers required by the STM32.
- * From the AVR doc http://www.atmel.com/images/doc2585.pdf section 2.4
+ * From the AVR doc https://www.atmel.com/images/doc2585.pdf section 2.4
*
* SPI Mode CPOL CPHA Shift SCK-edge Capture SCK-edge
* 0 0 0 Falling Rising
@@ -243,7 +243,7 @@ void SPIClass::setDataMode(uint8_t dataMode) {
_currentSetting->spi_d->regs->CR1 = cr1 | (dataMode & (SPI_CR1_CPOL|SPI_CR1_CPHA));
}
-void SPIClass::beginTransaction(uint8_t pin, SPISettings settings) {
+void SPIClass::beginTransaction(uint8_t pin, const SPISettings &settings) {
setBitOrder(settings.bitOrder);
setDataMode(settings.dataMode);
setDataSize(settings.dataSize);
@@ -251,7 +251,7 @@ void SPIClass::beginTransaction(uint8_t pin, SPISettings settings) {
begin();
}
-void SPIClass::beginTransactionSlave(SPISettings settings) {
+void SPIClass::beginTransactionSlave(const SPISettings &settings) {
setBitOrder(settings.bitOrder);
setDataMode(settings.dataMode);
setDataSize(settings.dataSize);
@@ -266,7 +266,7 @@ void SPIClass::endTransaction() { }
uint16_t SPIClass::read() {
while (!spi_is_rx_nonempty(_currentSetting->spi_d)) { /* nada */ }
- return (uint16)spi_rx_reg(_currentSetting->spi_d);
+ return (uint16_t)spi_rx_reg(_currentSetting->spi_d);
}
void SPIClass::read(uint8_t *buf, uint32_t len) {
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/SPI.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/SPI.h
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/SPI.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/SPI.h
index 0162ac13..dc2a2158 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/SPI.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/SPI.h
@@ -126,6 +126,7 @@ class SPISettings {
bitOrder = inBitOrder;
dataMode = inDataMode;
dataSize = inDataSize;
+ //state = SPI_STATE_IDLE;
}
uint32_t clock;
uint32_t dataSize;
@@ -187,11 +188,11 @@ class SPIClass {
*/
void end();
- void beginTransaction(SPISettings settings) { beginTransaction(BOARD_SPI_DEFAULT_SS, settings); }
- void beginTransaction(uint8_t pin, SPISettings settings);
+ void beginTransaction(const SPISettings &settings) { beginTransaction(BOARD_SPI_DEFAULT_SS, settings); }
+ void beginTransaction(uint8_t pin, const SPISettings &settings);
void endTransaction();
- void beginTransactionSlave(SPISettings settings);
+ void beginTransactionSlave(const SPISettings &settings);
void setClockDivider(uint32_t clockDivider);
void setBitOrder(BitOrder bitOrder);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/Servo.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/Servo.cpp
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/Servo.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/Servo.cpp
index 5dc21691..e1ee8314 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/Servo.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/Servo.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -17,10 +17,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __STM32F1__
#include "../../inc/MarlinConfig.h"
@@ -30,7 +29,6 @@
uint8_t ServoCount = 0;
#include "Servo.h"
-#include "timers.h"
//#include "Servo.h"
@@ -76,6 +74,7 @@ void libServo::servoWrite(uint8_t inPin, uint16_t duty_cycle) {
libServo::libServo() {
servoIndex = ServoCount < MAX_SERVOS ? ServoCount++ : INVALID_SERVO;
+ timer_set_interrupt_priority(SERVO0_TIMER_NUM, SERVO0_TIMER_IRQ_PRIO);
}
bool libServo::attach(const int32_t inPin, const int32_t inMinAngle, const int32_t inMaxAngle) {
@@ -138,9 +137,7 @@ void libServo::move(const int32_t value) {
angle = constrain(value, minAngle, maxAngle);
servoWrite(pin, US_TO_COMPARE(ANGLE_TO_US(angle)));
safe_delay(servo_delay[servoIndex]);
- #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- detach();
- #endif
+ TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
}
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/Servo.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/Servo.h
similarity index 93%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/Servo.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/Servo.h
index 92f4dd67..b6143de8 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/Servo.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/Servo.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -17,7 +17,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/SoftwareSerial.cpp
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/SoftwareSerial.cpp
index 99772a03..3641c9fd 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/SoftwareSerial.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#if defined(__STM32F1__) && !defined(HAVE_SW_SERIAL)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/SoftwareSerial.h
similarity index 88%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/SoftwareSerial.h
index 330d7d63..1c805866 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/SoftwareSerial.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/SoftwareSerial.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/build_flags.py b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/build_flags.py
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/build_flags.py
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/build_flags.py
index 6310740f..98c871a1 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/build_flags.py
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/build_flags.py
@@ -15,7 +15,7 @@
"--specs=nano.specs",
"--specs=nosys.specs",
- "-IMarlin/src/HAL/HAL_STM32F1",
+ "-IMarlin/src/HAL/STM32F1",
"-MMD",
"-MP",
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp
index 9d569772..0f3887d2 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -49,6 +49,7 @@
void LCD_IO_Init(uint8_t cs, uint8_t rs);
void LCD_IO_WriteData(uint16_t RegValue);
void LCD_IO_WriteReg(uint16_t Reg);
+uint16_t LCD_IO_ReadData(uint16_t RegValue);
uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize);
#ifdef LCD_USE_DMA_FSMC
void LCD_IO_WriteMultiple(uint16_t data, uint32_t count);
@@ -79,8 +80,11 @@ uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, voi
LCD_IO_Init(u8g->pin_list[U8G_PI_CS], u8g->pin_list[U8G_PI_A0]);
u8g_Delay(50);
- if (arg_ptr)
- *((uint32_t *)arg_ptr) = LCD_IO_ReadData(LCD_READ_ID, 3);
+ if (arg_ptr) {
+ *((uint32_t *)arg_ptr) = LCD_IO_ReadData(0x0000);
+ if (*((uint32_t *)arg_ptr) == 0)
+ *((uint32_t *)arg_ptr) = (LCD_READ_ID << 24) | LCD_IO_ReadData(LCD_READ_ID, 3);
+ }
isCommand = 0;
break;
@@ -265,6 +269,13 @@ void LCD_IO_WriteReg(uint16_t Reg) {
__DSB();
}
+uint16_t LCD_IO_ReadData(uint16_t RegValue) {
+ LCD->REG = RegValue;
+ __DSB();
+
+ return LCD->RAM;
+}
+
uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize) {
volatile uint32_t data;
LCD->REG = RegValue;
@@ -280,7 +291,7 @@ uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize) {
return uint32_t(data);
}
-#if ENABLED(LCD_USE_DMA_FSMC)
+#ifdef LCD_USE_DMA_FSMC
void LCD_IO_WriteMultiple(uint16_t color, uint32_t count) {
while (count > 0) {
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_swspi.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp
similarity index 87%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_swspi.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp
index 753a5d5e..894abb88 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_swspi.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,14 +13,14 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#ifdef __STM32F1__
#include "../../../inc/MarlinConfig.h"
-#if HAS_GRAPHICAL_LCD && ENABLED(FORCE_SOFT_SPI)
+#if BOTH(HAS_GRAPHICAL_LCD, FORCE_SOFT_SPI)
#include "../HAL.h"
#include
@@ -32,7 +32,7 @@
static uint8_t SPI_speed = SPI_SPEED;
static inline uint8_t swSpiTransfer_mode_0(uint8_t b, const uint8_t spi_speed, const pin_t miso_pin=-1) {
- for (uint8_t i = 0; i < 8; i++) {
+ LOOP_L_N(i, 8) {
if (spi_speed == 0) {
WRITE(DOGLCD_MOSI, !!(b & 0x80));
WRITE(DOGLCD_SCK, HIGH);
@@ -42,16 +42,16 @@ static inline uint8_t swSpiTransfer_mode_0(uint8_t b, const uint8_t spi_speed, c
}
else {
const uint8_t state = (b & 0x80) ? HIGH : LOW;
- for (uint8_t j = 0; j < spi_speed; j++)
+ LOOP_L_N(j, spi_speed)
WRITE(DOGLCD_MOSI, state);
- for (uint8_t j = 0; j < spi_speed + (miso_pin >= 0 ? 0 : 1); j++)
+ LOOP_L_N(j, spi_speed + (miso_pin >= 0 ? 0 : 1))
WRITE(DOGLCD_SCK, HIGH);
b <<= 1;
if (miso_pin >= 0 && READ(miso_pin)) b |= 1;
- for (uint8_t j = 0; j < spi_speed; j++)
+ LOOP_L_N(j, spi_speed)
WRITE(DOGLCD_SCK, LOW);
}
}
@@ -59,7 +59,7 @@ static inline uint8_t swSpiTransfer_mode_0(uint8_t b, const uint8_t spi_speed, c
}
static inline uint8_t swSpiTransfer_mode_3(uint8_t b, const uint8_t spi_speed, const pin_t miso_pin=-1) {
- for (uint8_t i = 0; i < 8; i++) {
+ LOOP_L_N(i, 8) {
const uint8_t state = (b & 0x80) ? HIGH : LOW;
if (spi_speed == 0) {
WRITE(DOGLCD_SCK, LOW);
@@ -68,13 +68,13 @@ static inline uint8_t swSpiTransfer_mode_3(uint8_t b, const uint8_t spi_speed, c
WRITE(DOGLCD_SCK, HIGH);
}
else {
- for (uint8_t j = 0; j < spi_speed + (miso_pin >= 0 ? 0 : 1); j++)
+ LOOP_L_N(j, spi_speed + (miso_pin >= 0 ? 0 : 1))
WRITE(DOGLCD_SCK, LOW);
- for (uint8_t j = 0; j < spi_speed; j++)
+ LOOP_L_N(j, spi_speed)
WRITE(DOGLCD_MOSI, state);
- for (uint8_t j = 0; j < spi_speed; j++)
+ LOOP_L_N(j, spi_speed)
WRITE(DOGLCD_SCK, HIGH);
}
b <<= 1;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp
new file mode 100644
index 00000000..f77306a8
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp
@@ -0,0 +1,81 @@
+/**
+ * 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 .
+ *
+ */
+
+/**
+ * PersistentStore for Arduino-style EEPROM interface
+ * with simple implementations supplied by Marlin.
+ */
+
+#include "../../inc/MarlinConfig.h"
+
+#if ENABLED(IIC_BL24CXX_EEPROM)
+
+#include "../shared/eeprom_if.h"
+#include "../shared/eeprom_api.h"
+
+//
+// PersistentStore
+//
+
+#ifndef MARLIN_EEPROM_SIZE
+ #error "MARLIN_EEPROM_SIZE is required for IIC_BL24CXX_EEPROM."
+#endif
+
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+
+bool PersistentStore::access_start() { eeprom_init(); return true; }
+bool PersistentStore::access_finish() { return true; }
+
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
+ while (size--) {
+ uint8_t v = *value;
+ uint8_t * const p = (uint8_t * const)pos;
+ // EEPROM has only ~100,000 write cycles,
+ // so only write bytes that have changed!
+ if (v != eeprom_read_byte(p)) {
+ eeprom_write_byte(p, v);
+ delay(2);
+ if (eeprom_read_byte(p) != v) {
+ SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
+ return true;
+ }
+ }
+ crc16(crc, &v, 1);
+ pos++;
+ value++;
+ }
+ return false;
+}
+
+bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
+ do {
+ uint8_t * const p = (uint8_t * const)pos;
+ uint8_t c = eeprom_read_byte(p);
+ if (writing) *value = c;
+ crc16(crc, &c, 1);
+ pos++;
+ value++;
+ } while (--size);
+ return false;
+}
+
+#endif // IIC_BL24CXX_EEPROM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_flash.cpp
similarity index 79%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_flash.cpp
index bbca1cb3..8db8c863 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_flash.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
@@ -17,7 +17,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -31,27 +31,28 @@
#include "../../inc/MarlinConfig.h"
-// This is for EEPROM emulation in flash
-#if BOTH(EEPROM_SETTINGS, FLASH_EEPROM_EMULATION)
+#if ENABLED(FLASH_EEPROM_EMULATION)
-#include "../shared/persistent_store_api.h"
+#include "../shared/eeprom_api.h"
#include
#include
// Store settings in the last two pages
-#define EEPROM_SIZE (EEPROM_PAGE_SIZE * 2)
-#define ACCESS_FINISHED(TF) do{ FLASH_Lock(); eeprom_dirty = false; return TF; }while(0)
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE ((EEPROM_PAGE_SIZE) * 2)
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
-static uint8_t ram_eeprom[EEPROM_SIZE] __attribute__((aligned(4))) = {0};
+static uint8_t ram_eeprom[MARLIN_EEPROM_SIZE] __attribute__((aligned(4))) = {0};
static bool eeprom_dirty = false;
bool PersistentStore::access_start() {
const uint32_t* source = reinterpret_cast(EEPROM_PAGE0_BASE);
uint32_t* destination = reinterpret_cast(ram_eeprom);
- static_assert(0 == EEPROM_SIZE % 4, "EEPROM_SIZE is corrupted. (Must be a multiple of 4.)"); // Ensure copying as uint32_t is safe
- constexpr size_t eeprom_size_u32 = EEPROM_SIZE / 4;
+ static_assert(0 == (MARLIN_EEPROM_SIZE) % 4, "MARLIN_EEPROM_SIZE is corrupted. (Must be a multiple of 4.)"); // Ensure copying as uint32_t is safe
+ constexpr size_t eeprom_size_u32 = (MARLIN_EEPROM_SIZE) / 4;
for (size_t i = 0; i < eeprom_size_u32; ++i, ++destination, ++source)
*destination = *source;
@@ -73,13 +74,15 @@ bool PersistentStore::access_finish() {
// page changes...either way, something to look at later.
FLASH_Unlock();
+ #define ACCESS_FINISHED(TF) { FLASH_Lock(); eeprom_dirty = false; return TF; }
+
status = FLASH_ErasePage(EEPROM_PAGE0_BASE);
if (status != FLASH_COMPLETE) ACCESS_FINISHED(true);
status = FLASH_ErasePage(EEPROM_PAGE1_BASE);
if (status != FLASH_COMPLETE) ACCESS_FINISHED(true);
const uint16_t *source = reinterpret_cast(ram_eeprom);
- for (size_t i = 0; i < EEPROM_SIZE; i += 2, ++source) {
+ for (size_t i = 0; i < MARLIN_EEPROM_SIZE; i += 2, ++source) {
if (FLASH_ProgramHalfWord(EEPROM_PAGE0_BASE + i, *source) != FLASH_COMPLETE)
ACCESS_FINISHED(false);
}
@@ -106,7 +109,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin
return false; // return true for any error
}
-size_t PersistentStore::capacity() { return EEPROM_SIZE; }
-
-#endif // EEPROM_SETTINGS && EEPROM FLASH
+#endif // FLASH_EEPROM_EMULATION
#endif // __STM32F1__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_if_iic.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_if_iic.cpp
new file mode 100644
index 00000000..33dd277a
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_if_iic.cpp
@@ -0,0 +1,51 @@
+/**
+ * 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 .
+ *
+ */
+
+/**
+ * Platform-independent Arduino functions for I2C EEPROM.
+ * Enable USE_SHARED_EEPROM if not supplied by the framework.
+ */
+
+#include "../../inc/MarlinConfig.h"
+
+#if ENABLED(IIC_BL24CXX_EEPROM)
+
+#include "../../libs/BL24CXX.h"
+#include "../shared/eeprom_if.h"
+
+void eeprom_init() { BL24CXX::init(); }
+
+// ------------------------
+// Public functions
+// ------------------------
+
+void eeprom_write_byte(uint8_t *pos, unsigned char value) {
+ const unsigned eeprom_address = (unsigned)pos;
+ return BL24CXX::writeOneByte(eeprom_address, value);
+}
+
+uint8_t eeprom_read_byte(uint8_t *pos) {
+ const unsigned eeprom_address = (unsigned)pos;
+ return BL24CXX::readOneByte(eeprom_address);
+}
+
+#endif // IIC_BL24CXX_EEPROM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp
similarity index 50%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp
index 38d5803f..11959191 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -29,56 +29,47 @@
#include "../../inc/MarlinConfig.h"
-#if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM)
+#if ENABLED(SDCARD_EEPROM_EMULATION)
-#include "../shared/persistent_store_api.h"
+#include "../shared/eeprom_api.h"
+#include "../../sd/cardreader.h"
-#ifndef E2END
- #define E2END 0xFFF // 4KB
+#define EEPROM_FILENAME "eeprom.dat"
+
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE 0x1000 // 4KB
#endif
-#define HAL_EEPROM_SIZE (E2END + 1)
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
#define _ALIGN(x) __attribute__ ((aligned(x))) // SDIO uint32_t* compat.
-static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE];
-
-#if ENABLED(SDSUPPORT)
+static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE];
- #include "../../sd/cardreader.h"
+bool PersistentStore::access_start() {
+ if (!card.isMounted()) return false;
- #define EEPROM_FILENAME "eeprom.dat"
+ SdFile file, root = card.getroot();
+ if (!file.open(&root, EEPROM_FILENAME, O_RDONLY))
+ return true; // false aborts the save
- bool PersistentStore::access_start() {
- if (!card.isMounted()) return false;
+ int bytes_read = file.read(HAL_eeprom_data, MARLIN_EEPROM_SIZE);
+ if (bytes_read < 0) return false;
+ for (; bytes_read < MARLIN_EEPROM_SIZE; bytes_read++)
+ HAL_eeprom_data[bytes_read] = 0xFF;
+ file.close();
+ return true;
+}
- SdFile file, root = card.getroot();
- if (!file.open(&root, EEPROM_FILENAME, O_RDONLY))
- return true; // false aborts the save
+bool PersistentStore::access_finish() {
+ if (!card.isMounted()) return false;
- int bytes_read = file.read(HAL_eeprom_data, HAL_EEPROM_SIZE);
- if (bytes_read < 0) return false;
- for (; bytes_read < HAL_EEPROM_SIZE; bytes_read++)
- HAL_eeprom_data[bytes_read] = 0xFF;
+ SdFile file, root = card.getroot();
+ int bytes_written = 0;
+ if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) {
+ bytes_written = file.write(HAL_eeprom_data, MARLIN_EEPROM_SIZE);
file.close();
- return true;
- }
-
- bool PersistentStore::access_finish() {
- if (!card.isMounted()) return false;
-
- SdFile file, root = card.getroot();
- int bytes_written = 0;
- if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) {
- bytes_written = file.write(HAL_eeprom_data, HAL_EEPROM_SIZE);
- file.close();
- }
- return (bytes_written == HAL_EEPROM_SIZE);
}
-
-#else // !SDSUPPORT
-
- #error "Please define SPI_EEPROM (in Configuration.h) or disable EEPROM_SETTINGS."
-
-#endif // !SDSUPPORT
+ return (bytes_written == MARLIN_EEPROM_SIZE);
+}
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
for (size_t i = 0; i < size; i++)
@@ -98,8 +89,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin
return false;
}
-size_t PersistentStore::capacity() { return HAL_EEPROM_SIZE; }
-
-#endif // EEPROM_SETTINGS
-
+#endif // SDCARD_EEPROM_EMULATION
#endif // __STM32F1__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_wired.cpp
similarity index 75%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_wired.cpp
index babcdeae..b4699d00 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/eeprom_wired.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -14,19 +14,32 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __STM32F1__
#include "../../inc/MarlinConfig.h"
-#if ENABLED(EEPROM_SETTINGS) && EITHER(SPI_EEPROM, I2C_EEPROM)
+#if USE_WIRED_EEPROM
+
+/**
+ * PersistentStore for Arduino-style EEPROM interface
+ * with simple implementations supplied by Marlin.
+ */
+
+#include "../shared/eeprom_if.h"
+#include "../shared/eeprom_api.h"
-#include "../shared/persistent_store_api.h"
+#ifndef MARLIN_EEPROM_SIZE
+ #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM."
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+
+bool PersistentStore::access_finish() { return true; }
bool PersistentStore::access_start() {
+ eeprom_init();
#if ENABLED(SPI_EEPROM)
#if SPI_CHAN_EEPROM1 == 1
SET_OUTPUT(BOARD_SPI1_SCK_PIN);
@@ -38,7 +51,6 @@ bool PersistentStore::access_start() {
#endif
return true;
}
-bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) {
@@ -49,14 +61,14 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
if (v != eeprom_read_byte(p)) {
eeprom_write_byte(p, v);
if (eeprom_read_byte(p) != v) {
- SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
+ SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
return true;
}
}
crc16(crc, &v, 1);
pos++;
value++;
- };
+ }
return false;
}
@@ -71,7 +83,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false;
}
-size_t PersistentStore::capacity() { return E2END + 1; }
-
-#endif // EEPROM_SETTINGS && EITHER(SPI_EEPROM, I2C_EEPROM)
+#endif // USE_WIRED_EEPROM
#endif // __STM32F1__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/endstop_interrupts.h
similarity index 67%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/endstop_interrupts.h
index d043b3b8..bcb07d99 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/endstop_interrupts.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -17,7 +17,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -53,37 +53,22 @@
void endstop_ISR() { endstops.update(); }
void setup_endstop_interrupts() {
- #if HAS_X_MAX
- attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); // assign it
- #endif
- #if HAS_X_MIN
- attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Y_MAX
- attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Y_MIN
- attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z_MAX
- attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z_MIN
- attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z2_MAX
- attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z2_MIN
- attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z3_MAX
- attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z3_MIN
- attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE);
- #endif
- #if HAS_Z_MIN_PROBE_PIN
- attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);
- #endif
+ #define _ATTACH(P) attachInterrupt(P, endstop_ISR, CHANGE)
+ TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN));
+ TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN));
+ TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN));
+ TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN));
+ TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN));
+ TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN));
+ TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN));
+ TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN));
+ TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN));
+ TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN));
+ TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN));
+ TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN));
+ TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN));
+ TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN));
+ TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
+ TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
+ TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/fastio.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/fastio.h
similarity index 97%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/fastio.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/fastio.h
index 3aafb9de..e0e2e03a 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/fastio.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/fastio.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -17,7 +17,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h
new file mode 100644
index 00000000..f52e6fec
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/inc/Conditionals_LCD.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#if ENABLED(USE_USB_COMPOSITE)
+ //#warning "SD_CHECK_AND_RETRY isn't needed with USE_USB_COMPOSITE."
+ #undef SD_CHECK_AND_RETRY
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/inc/Conditionals_adv.h
new file mode 100644
index 00000000..5f1c4b16
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/inc/Conditionals_adv.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/inc/Conditionals_post.h
new file mode 100644
index 00000000..656fbe1c
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/inc/Conditionals_post.h
@@ -0,0 +1,34 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation
+#if USE_FALLBACK_EEPROM
+ #define SDCARD_EEPROM_EMULATION
+#elif EITHER(I2C_EEPROM, SPI_EEPROM)
+ #define USE_SHARED_EEPROM 1
+#endif
+
+// Allow SDSUPPORT to be disabled
+#if DISABLED(SDSUPPORT)
+ #undef SDIO_SUPPORT
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/inc/SanityCheck.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/inc/SanityCheck.h
similarity index 61%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/inc/SanityCheck.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/inc/SanityCheck.h
index 69466a0a..5559b3d4 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/inc/SanityCheck.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/inc/SanityCheck.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -29,15 +29,25 @@
#error "EMERGENCY_PARSER is not yet implemented for STM32F1. Disable EMERGENCY_PARSER to continue."
#endif
-#if ENABLED(SDIO_SUPPORT) && DISABLED(SDSUPPORT)
- #error "SDIO_SUPPORT requires SDSUPPORT. Enable SDSUPPORT to continue."
-#endif
-
#if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform."
#endif
-#if !defined(HAVE_SW_SERIAL) && HAS_TMC220x
+#if !defined(HAVE_SW_SERIAL) && HAS_TMC_SW_SERIAL
#warning "With TMC2208/9 consider using SoftwareSerialM with HAVE_SW_SERIAL and appropriate SS_TIMER."
#error "Missing SoftwareSerial implementation."
#endif
+
+#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT)
+ #undef SDCARD_EEPROM_EMULATION // Avoid additional error noise
+ #if USE_FALLBACK_EEPROM
+ #warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION."
+ #endif
+ #error "SDCARD_EEPROM_EMULATION requires SDSUPPORT. Enable SDSUPPORT or choose another EEPROM emulation."
+#endif
+
+#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
+ #error "SERIAL_STATS_MAX_RX_QUEUED is not supported on this platform."
+#elif ENABLED(SERIAL_STATS_DROPPED_RX)
+ #error "SERIAL_STATS_DROPPED_RX is not supported on this platform."
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/maple_win_usb_driver/maple_serial.inf b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/maple_win_usb_driver/maple_serial.inf
similarity index 100%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/maple_win_usb_driver/maple_serial.inf
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/maple_win_usb_driver/maple_serial.inf
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/msc_sd.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/msc_sd.cpp
similarity index 89%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/msc_sd.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/msc_sd.cpp
index 81e430fa..ab553017 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/msc_sd.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/msc_sd.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech]
*
* This program is free software: you can redistribute it and/or modify
@@ -10,7 +10,7 @@
* (at your option) any later version.
*
* You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
+ * along with this program. If not, see .
*
*/
#ifdef USE_USB_COMPOSITE
@@ -25,7 +25,7 @@ USBCompositeSerial MarlinCompositeSerial;
#include "../../inc/MarlinConfig.h"
-#ifdef HAS_ONBOARD_SD
+#if SD_CONNECTION_IS(ONBOARD)
#include "onboard_sd.h"
@@ -47,7 +47,7 @@ void MSC_SD_init() {
USBComposite.end();
USBComposite.clear();
// Set api and register mass storage
- #ifdef HAS_ONBOARD_SD
+ #if SD_CONNECTION_IS(ONBOARD)
uint32_t cardSize;
if (disk_initialize(0) == RES_OK) {
if (disk_ioctl(0, GET_SECTOR_COUNT, (void *)(&cardSize)) == RES_OK) {
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/msc_sd.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/msc_sd.h
similarity index 81%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/msc_sd.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/msc_sd.h
index 9f06ca5f..8715888f 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/msc_sd.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/msc_sd.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech]
*
* This program is free software: you can redistribute it and/or modify
@@ -10,7 +10,7 @@
* (at your option) any later version.
*
* You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/onboard_sd.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/onboard_sd.cpp
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/onboard_sd.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/onboard_sd.cpp
index c5b4f34c..099e2a06 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/onboard_sd.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/onboard_sd.cpp
@@ -1,7 +1,7 @@
/**
* STM32F1: MMCv3/SDv1/SDv2 (SPI mode) control module
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech]
* Copyright (C) 2015, ChaN, all right reserved.
*
@@ -14,13 +14,13 @@
#include "../../inc/MarlinConfig.h"
-#ifdef HAS_ONBOARD_SD
+#if SD_CONNECTION_IS(ONBOARD)
#include "onboard_sd.h"
#include "SPI.h"
#include "fastio.h"
-#ifdef SHARED_SD_CARD
+#if HAS_SHARED_MEDIA
#ifndef ON_BOARD_SPI_DEVICE
#define ON_BOARD_SPI_DEVICE SPI_DEVICE
#endif
@@ -553,4 +553,4 @@ DRESULT disk_read (
#endif // _DISKIO_IOCTL
-#endif // HAS_ONBOARD_SD
+#endif // SD_CONNECTION_IS(ONBOARD)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/onboard_sd.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/onboard_sd.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/onboard_sd.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/onboard_sd.h
index ec73162b..1dc7ec5b 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/onboard_sd.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/onboard_sd.h
@@ -1,5 +1,5 @@
/*-----------------------------------------------------------------------
-/ * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+/ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
/ * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech]
/ * Low level disk interface module include file (C)ChaN, 2015
/-----------------------------------------------------------------------*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/pinsDebug.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/pinsDebug.h
similarity index 78%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/pinsDebug.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/pinsDebug.h
index a8b63287..2d63ebd7 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/pinsDebug.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/pinsDebug.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,15 +13,15 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
#ifdef NUM_DIGITAL_PINS // Only in ST's Arduino core (STM32duino, STM32Core)
- #include "../HAL_STM32/pinsDebug_STM32duino.h"
+ #include "../STM32/pinsDebug_STM32duino.h"
#elif defined(BOARD_NR_GPIO_PINS) // Only in STM32GENERIC (Maple)
- #include "../HAL_STM32/pinsDebug_STM32GENERIC.h"
+ #include "../STM32/pinsDebug_STM32GENERIC.h"
#else
#error "M43 not supported for this board"
#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/sdio.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/sdio.cpp
similarity index 93%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/sdio.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/sdio.cpp
index c1cab57a..0e8a7458 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/sdio.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/sdio.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -17,10 +17,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef ARDUINO_ARCH_STM32F1
#include
@@ -102,7 +101,23 @@ bool SDIO_ReadBlock_DMA(uint32_t blockAddress, uint8_t *data) {
return false;
}
- while (!SDIO_GET_FLAG(SDIO_STA_DATAEND | SDIO_STA_TRX_ERROR_FLAGS)) {}
+ while (!SDIO_GET_FLAG(SDIO_STA_DATAEND | SDIO_STA_TRX_ERROR_FLAGS)) { /* wait */ }
+
+ //If there were SDIO errors, do not wait DMA.
+ if (SDIO->STA & SDIO_STA_TRX_ERROR_FLAGS) {
+ SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS);
+ dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL);
+ return false;
+ }
+
+ //Wait for DMA transaction to complete
+ while ((DMA2_BASE->ISR & (DMA_ISR_TEIF4|DMA_ISR_TCIF4)) == 0 ) { /* wait */ }
+
+ if (DMA2_BASE->ISR & DMA_ISR_TEIF4) {
+ dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL);
+ SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS);
+ return false;
+ }
dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL);
@@ -121,7 +136,7 @@ bool SDIO_ReadBlock_DMA(uint32_t blockAddress, uint8_t *data) {
}
bool SDIO_ReadBlock(uint32_t blockAddress, uint8_t *data) {
- uint32_t retries = 3;
+ uint32_t retries = SDIO_READ_RETRIES;
while (retries--) if (SDIO_ReadBlock_DMA(blockAddress, data)) return true;
return false;
}
@@ -147,7 +162,7 @@ bool SDIO_WriteBlock(uint32_t blockAddress, const uint8_t *data) {
sdio_setup_transfer(SDIO_DATA_TIMEOUT * (F_CPU / 1000U), 512U, SDIO_BLOCKSIZE_512 | SDIO_DCTRL_DMAEN | SDIO_DCTRL_DTEN);
- while (!SDIO_GET_FLAG(SDIO_STA_DATAEND | SDIO_STA_TRX_ERROR_FLAGS)) {}
+ while (!SDIO_GET_FLAG(SDIO_STA_DATAEND | SDIO_STA_TRX_ERROR_FLAGS)) { /* wait */ }
dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/sdio.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/sdio.h
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/sdio.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/sdio.h
index ca0aced6..8777299f 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/sdio.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/sdio.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2017 Victor Perez
*
@@ -16,12 +16,12 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
-#include "../shared/Marduino.h"
+#include "../../inc/MarlinConfig.h" // Allow pins/pins.h to override SDIO clock / retries
#include
#include
@@ -100,7 +100,13 @@
#define SDIO_DATA_TIMEOUT 100U /* Read data transfer timeout */
#define SDIO_WRITE_TIMEOUT 200U /* Write data transfer timeout */
-#define SDIO_CLOCK 18000000 /* 18 MHz */
+#ifndef SDIO_CLOCK
+ #define SDIO_CLOCK 18000000 /* 18 MHz */
+#endif
+
+#ifndef SDIO_READ_RETRIES
+ #define SDIO_READ_RETRIES 3
+#endif
// ------------------------
// Types
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/spi_pins.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/spi_pins.h
similarity index 91%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/spi_pins.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/spi_pins.h
index edea89cc..8f2b324f 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/spi_pins.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/spi_pins.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/timers.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/timers.cpp
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/timers.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/timers.cpp
index 051f0323..8c2df1e2 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/timers.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/timers.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
*
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -27,8 +27,6 @@
#ifdef __STM32F1__
#include "../../inc/MarlinConfig.h"
-#include "HAL.h"
-#include "timers.h"
// ------------------------
// Local defines
@@ -49,7 +47,10 @@
* TODO: Calculate Timer prescale value, so we get the 32bit to adjust
*/
-void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
+
+
+
+void timer_set_interrupt_priority(uint_fast8_t timer_num, uint_fast8_t priority) {
nvic_irq_num irq_num;
switch (timer_num) {
case 1: irq_num = NVIC_TIMER1_CC; break;
@@ -66,9 +67,14 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
* This should never happen. Add a Sanitycheck for timer number.
* Should be a general timer since basic timers have no CC channels.
*/
- break;
+ return;
}
+ nvic_irq_set_priority(irq_num, priority);
+}
+
+
+void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
/**
* Give the Stepper ISR a higher priority (lower number)
* so it automatically preempts the Temperature ISR.
@@ -85,7 +91,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
timer_set_compare(STEP_TIMER_DEV, STEP_TIMER_CHAN, _MIN(hal_timer_t(HAL_TIMER_TYPE_MAX), (STEPPER_TIMER_RATE) / frequency));
timer_no_ARR_preload_ARPE(STEP_TIMER_DEV); // Need to be sure no preload on ARR register
timer_attach_interrupt(STEP_TIMER_DEV, STEP_TIMER_CHAN, stepTC_Handler);
- nvic_irq_set_priority(irq_num, STEP_TIMER_IRQ_PRIO);
+ timer_set_interrupt_priority(STEP_TIMER_NUM, STEP_TIMER_IRQ_PRIO);
timer_generate_update(STEP_TIMER_DEV);
timer_resume(STEP_TIMER_DEV);
break;
@@ -97,7 +103,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
timer_set_reload(TEMP_TIMER_DEV, 0xFFFF);
timer_set_compare(TEMP_TIMER_DEV, TEMP_TIMER_CHAN, _MIN(hal_timer_t(HAL_TIMER_TYPE_MAX), (F_CPU) / (TEMP_TIMER_PRESCALE) / frequency));
timer_attach_interrupt(TEMP_TIMER_DEV, TEMP_TIMER_CHAN, tempTC_Handler);
- nvic_irq_set_priority(irq_num, TEMP_TIMER_IRQ_PRIO);
+ timer_set_interrupt_priority(TEMP_TIMER_NUM, TEMP_TIMER_IRQ_PRIO);
timer_generate_update(TEMP_TIMER_DEV);
timer_resume(TEMP_TIMER_DEV);
break;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/timers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/timers.h
similarity index 82%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/timers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/timers.h
index d5d02a3d..6f360f6b 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/timers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/timers.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2017 Victor Perez
*
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -44,8 +44,12 @@ typedef uint16_t hal_timer_t;
#define HAL_TIMER_RATE uint32_t(F_CPU) // frequency of timers peripherals
-#define STEP_TIMER_CHAN 1 // Channel of the timer to use for compare and interrupts
-#define TEMP_TIMER_CHAN 1 // Channel of the timer to use for compare and interrupts
+#ifndef STEP_TIMER_CHAN
+ #define STEP_TIMER_CHAN 1 // Channel of the timer to use for compare and interrupts
+#endif
+#ifndef TEMP_TIMER_CHAN
+ #define TEMP_TIMER_CHAN 1 // Channel of the timer to use for compare and interrupts
+#endif
/**
* Note: Timers may be used by platforms and libraries
@@ -61,16 +65,22 @@ typedef uint16_t hal_timer_t;
* - Otherwise it uses Timer 8 on boards with STM32_HIGH_DENSITY
* or Timer 4 on other boards.
*/
-#if defined(MCU_STM32F103CB) || defined(MCU_STM32F103C8)
- #define STEP_TIMER_NUM 4 // For C8/CB boards, use timer 4
-#else
- #define STEP_TIMER_NUM 5 // for other boards, five is fine.
+#ifndef STEP_TIMER_NUM
+ #if defined(MCU_STM32F103CB) || defined(MCU_STM32F103C8)
+ #define STEP_TIMER_NUM 4 // For C8/CB boards, use timer 4
+ #else
+ #define STEP_TIMER_NUM 5 // for other boards, five is fine.
+ #endif
+#endif
+#ifndef PULSE_TIMER_NUM
+ #define PULSE_TIMER_NUM STEP_TIMER_NUM
+#endif
+#ifndef TEMP_TIMER_NUM
+ #define TEMP_TIMER_NUM 2 // Timer Index for Temperature
+ //#define TEMP_TIMER_NUM 4 // 2->4, Timer 2 for Stepper Current PWM
#endif
-#define TEMP_TIMER_NUM 2 // index of timer to use for temperature
-//#define TEMP_TIMER_NUM 4 // 2->4, Timer 2 for Stepper Current PWM
-#define PULSE_TIMER_NUM STEP_TIMER_NUM
-#if MB(BTT_SKR_MINI_E3_V1_0, BIGTREE_SKR_E3_DIP, BTT_SKR_MINI_E3_V1_2, MKS_ROBIN_LITE)
+#if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_E3_DIP, BTT_SKR_MINI_E3_V1_2, MKS_ROBIN_LITE)
// SKR Mini E3 boards use PA8 as FAN_PIN, so TIMER 1 is used for Fan PWM.
#ifdef STM32_HIGH_DENSITY
#define SERVO0_TIMER_NUM 8 // tone.cpp uses Timer 4
@@ -81,8 +91,9 @@ typedef uint16_t hal_timer_t;
#define SERVO0_TIMER_NUM 1 // SERVO0 or BLTOUCH
#endif
-#define STEP_TIMER_IRQ_PRIO 1
-#define TEMP_TIMER_IRQ_PRIO 2
+#define STEP_TIMER_IRQ_PRIO 2
+#define TEMP_TIMER_IRQ_PRIO 3
+#define SERVO0_TIMER_IRQ_PRIO 1
#define TEMP_TIMER_PRESCALE 1000 // prescaler for setting Temp timer, 72Khz
#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
@@ -111,8 +122,12 @@ timer_dev* get_timer_dev(int number);
// TODO change this
-#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler()
-#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler()
+#ifndef HAL_TEMP_TIMER_ISR
+ #define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler()
+#endif
+#ifndef HAL_STEP_TIMER_ISR
+ #define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler()
+#endif
extern "C" void tempTC_Handler();
extern "C" void stepTC_Handler();
@@ -179,4 +194,6 @@ FORCE_INLINE static void timer_no_ARR_preload_ARPE(timer_dev *dev) {
bb_peri_set_bit(&(dev->regs).gen->CR1, TIMER_CR1_ARPE_BIT, 0);
}
+void timer_set_interrupt_priority(uint_fast8_t timer_num, uint_fast8_t priority);
+
#define TIMER_OC_NO_PRELOAD 0 // Need to disable preload also on compare registers.
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/watchdog.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/watchdog.cpp
similarity index 91%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/watchdog.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/watchdog.cpp
index 17f5aa97..4123bc3e 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/watchdog.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/watchdog.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/watchdog.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/watchdog.h
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/watchdog.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/watchdog.h
index 21f97dd7..7185d697 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32F1/watchdog.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32F1/watchdog.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/HAL.cpp
similarity index 94%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/HAL.cpp
index e24483f6..b4629d2a 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/HAL.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2017 Victor Perez
@@ -17,10 +17,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7))
#include "HAL.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/HAL.h
similarity index 68%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/HAL.h
index 0e44df4d..5601400c 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/HAL.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2017 Victor Perez
@@ -17,7 +17,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -31,7 +31,6 @@
#include "../shared/HAL_SPI.h"
#include "fastio.h"
-#include "timers.h"
#include "watchdog.h"
#include
@@ -44,18 +43,15 @@
// Defines
// ------------------------
-//Serial override
+// Serial override
//extern HalSerial usb_serial;
#if defined(STM32F4) && SERIAL_PORT == 0
- #error "Serial port 0 does not exist"
-#endif
-
-#if !WITHIN(SERIAL_PORT, -1, 6)
- #error "SERIAL_PORT must be from -1 to 6"
-#endif
-#if SERIAL_PORT == -1
+ #error "SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
+#elif SERIAL_PORT == -1
#define MYSERIAL0 SerialUSB
+#elif SERIAL_PORT == 0
+ #define MYSERIAL0 Serial1
#elif SERIAL_PORT == 1
#define MYSERIAL0 SerialUART1
#elif SERIAL_PORT == 2
@@ -68,20 +64,19 @@
#define MYSERIAL0 SerialUART5
#elif SERIAL_PORT == 6
#define MYSERIAL0 SerialUART6
+#else
+ #error "SERIAL_PORT must be from -1 to 6. Please update your configuration."
#endif
#ifdef SERIAL_PORT_2
#if defined(STM32F4) && SERIAL_PORT_2 == 0
- #error "Serial port 0 does not exist"
- #endif
- #if !WITHIN(SERIAL_PORT_2, -1, 6)
- #error "SERIAL_PORT_2 must be from -1 to 6"
+ #error "SERIAL_PORT_2 cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif SERIAL_PORT_2 == SERIAL_PORT
- #error "SERIAL_PORT_2 must be different than SERIAL_PORT"
- #endif
- #define NUM_SERIAL 2
- #if SERIAL_PORT_2 == -1
+ #error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
+ #elif SERIAL_PORT_2 == -1
#define MYSERIAL1 SerialUSB
+ #elif SERIAL_PORT_2 == 0
+ #define MYSERIAL1 Serial1
#elif SERIAL_PORT_2 == 1
#define MYSERIAL1 SerialUART1
#elif SERIAL_PORT_2 == 2
@@ -94,11 +89,42 @@
#define MYSERIAL1 SerialUART5
#elif SERIAL_PORT_2 == 6
#define MYSERIAL1 SerialUART6
+ #else
+ #error "SERIAL_PORT_2 must be from -1 to 6. Please update your configuration."
#endif
+ #define NUM_SERIAL 2
#else
#define NUM_SERIAL 1
#endif
+#ifdef DGUS_SERIAL_PORT
+ #if defined(STM32F4) && DGUS_SERIAL_PORT == 0
+ #error "DGUS_SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
+ #elif DGUS_SERIAL_PORT == SERIAL_PORT
+ #error "DGUS_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
+ #elif defined(SERIAL_PORT_2) && DGUS_SERIAL_PORT == SERIAL_PORT_2
+ #error "DGUS_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
+ #elif DGUS_SERIAL_PORT == -1
+ #define DGUS_SERIAL SerialUSB
+ #elif DGUS_SERIAL_PORT == 0
+ #define DGUS_SERIAL Serial1
+ #elif DGUS_SERIAL_PORT == 1
+ #define DGUS_SERIAL SerialUART1
+ #elif DGUS_SERIAL_PORT == 2
+ #define DGUS_SERIAL SerialUART2
+ #elif DGUS_SERIAL_PORT == 3
+ #define DGUS_SERIAL SerialUART3
+ #elif DGUS_SERIAL_PORT == 4
+ #define DGUS_SERIAL SerialUART4
+ #elif DGUS_SERIAL_PORT == 5
+ #define DGUS_SERIAL SerialUART5
+ #elif DGUS_SERIAL_PORT == 6
+ #define DGUS_SERIAL SerialUART6
+ #else
+ #error "DGUS_SERIAL_PORT must be from -1 to 6. Please update your configuration."
+ #endif
+#endif
+
/**
* TODO: review this to return 1 for pins that are not analog input
*/
@@ -106,8 +132,8 @@
#define analogInputToDigitalPin(p) (p)
#endif
-#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq()
-#define CRITICAL_SECTION_END if (!primask) __enable_irq()
+#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq()
+#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
#define ISRS_ENABLED() (!__get_PRIMASK())
#define ENABLE_ISRS() __enable_irq()
#define DISABLE_ISRS() __disable_irq()
@@ -185,19 +211,6 @@ static inline int freeMemory() {
#pragma GCC diagnostic pop
-//
-// EEPROM
-//
-
-/**
- * TODO: Write all this EEPROM stuff. Can emulate EEPROM in flash as last resort.
- * Wire library should work for i2c EEPROMs.
- */
-void eeprom_write_byte(uint8_t *pos, unsigned char value);
-uint8_t eeprom_read_byte(uint8_t *pos);
-void eeprom_read_block (void *__dst, const void *__src, size_t __n);
-void eeprom_update_block (const void *__src, void *__dst, size_t __n);
-
//
// ADC
//
@@ -206,8 +219,9 @@ void eeprom_update_block (const void *__src, void *__dst, size_t __n);
inline void HAL_adc_init() {}
-#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
+#define HAL_ADC_VREF 3.3
#define HAL_ADC_RESOLUTION 10
+#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
#define HAL_READ_ADC() HAL_adc_result
#define HAL_ADC_READY() true
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_SPI.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/HAL_SPI.cpp
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_SPI.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/HAL_SPI.cpp
index 2f85182e..6fe81819 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_SPI.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/HAL_SPI.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -17,9 +17,10 @@
* 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 .
+ * along with this program. If not, see .
*
*/
+#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7))
/**
* Software SPI functions originally from Arduino Sd2Card Library
@@ -30,8 +31,6 @@
* Adapted to the Marlin STM32F4/7 HAL
*/
-#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7))
-
#include "../../inc/MarlinConfig.h"
#include
@@ -121,7 +120,7 @@ uint8_t spiRec() {
*/
void spiRead(uint8_t* buf, uint16_t nbyte) {
SPI.beginTransaction(spiConfig);
- #ifdef STM32GENERIC
+ #ifndef STM32GENERIC
SPI.dmaTransfer(0, const_cast(buf), nbyte);
#else
SPI.transfer((uint8_t*)buf, nbyte);
@@ -153,7 +152,7 @@ void spiSend(uint8_t b) {
void spiSendBlock(uint8_t token, const uint8_t* buf) {
SPI.beginTransaction(spiConfig);
SPI.transfer(token);
- #ifdef STM32GENERIC
+ #ifndef STM32GENERIC
SPI.dmaSend(const_cast(buf), 512);
#else
SPI.transfer((uint8_t*)buf, nullptr, 512);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/README.md b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/README.md
similarity index 100%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/README.md
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/README.md
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/README.md b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F4/README.md
similarity index 100%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/README.md
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F4/README.md
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp
index 32219962..dc41f891 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
*
@@ -16,14 +16,12 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#if defined(STM32GENERIC) && defined(STM32F4)
-#include "../HAL.h"
-#include "timers.h"
+#include "../../../inc/MarlinConfig.h"
// ------------------------
// Local defines
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.h
index 726207fb..a4a7ad82 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F4/timers.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2017 Victor Perez
*
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -34,9 +34,15 @@
#define HAL_TIMER_RATE (HAL_RCC_GetSysClockFreq() / 2) // frequency of timer peripherals
-#define STEP_TIMER_NUM 0 // index of timer to use for stepper
-#define TEMP_TIMER_NUM 1 // index of timer to use for temperature
-#define PULSE_TIMER_NUM STEP_TIMER_NUM
+#ifndef STEP_TIMER_NUM
+ #define STEP_TIMER_NUM 0 // Timer Index for Stepper
+#endif
+#ifndef PULSE_TIMER_NUM
+ #define PULSE_TIMER_NUM STEP_TIMER_NUM
+#endif
+#ifndef TEMP_TIMER_NUM
+ #define TEMP_TIMER_NUM 1 // Timer Index for Temperature
+#endif
#define TEMP_TIMER_PRESCALE 1000 // prescaler for setting Temp timer, 72Khz
#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
@@ -59,17 +65,19 @@
// TODO change this
#ifdef STM32GENERIC
- extern void TC5_Handler();
- extern void TC7_Handler();
- #define HAL_STEP_TIMER_ISR() void TC5_Handler()
- #define HAL_TEMP_TIMER_ISR() void TC7_Handler()
+ #define TC_TIMER_ARGS
#else
- extern void TC5_Handler(stimer_t *htim);
- extern void TC7_Handler(stimer_t *htim);
- #define HAL_STEP_TIMER_ISR() void TC5_Handler(stimer_t *htim)
- #define HAL_TEMP_TIMER_ISR() void TC7_Handler(stimer_t *htim)
+ #define TC_TIMER_ARGS stimer_t *htim
#endif
+extern void TC5_Handler(TC_TIMER_ARGS);
+extern void TC7_Handler(TC_TIMER_ARGS);
+#ifndef HAL_STEP_TIMER_ISR
+ #define HAL_STEP_TIMER_ISR() void TC5_Handler(TC_TIMER_ARGS)
+#endif
+#ifndef HAL_TEMP_TIMER_ISR
+ #define HAL_TEMP_TIMER_ISR() void TC7_Handler(TC_TIMER_ARGS)
+#endif
// ------------------------
// Types
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/README.md b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F7/README.md
similarity index 100%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/README.md
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F7/README.md
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F7/TMC2660.cpp
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F7/TMC2660.cpp
index 3117321a..b0304590 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F7/TMC2660.cpp
@@ -36,7 +36,7 @@
#include "TMC2660.h"
#include "../../../inc/MarlinConfig.h"
-#include "../../../Marlin.h"
+#include "../../../MarlinCore.h"
#include "../../../module/stepper/indirection.h"
#include "../../../module/printcounter.h"
#include "../../../libs/duration_t.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F7/TMC2660.h
similarity index 100%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F7/TMC2660.h
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp
index 5a3b32ef..f7ded745 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
*
@@ -16,14 +16,12 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#if defined(STM32GENERIC) && defined(STM32F7)
-#include "../HAL.h"
-#include "timers.h"
+#include "../../../inc/MarlinConfig.h"
// ------------------------
// Local defines
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.h
index 38ecde30..d2f78259 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/STM32F7/timers.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2017 Victor Perez
*
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -34,9 +34,15 @@
#define HAL_TIMER_RATE (HAL_RCC_GetSysClockFreq() / 2) // frequency of timer peripherals
-#define STEP_TIMER_NUM 0 // index of timer to use for stepper
-#define TEMP_TIMER_NUM 1 // index of timer to use for temperature
-#define PULSE_TIMER_NUM STEP_TIMER_NUM
+#ifndef STEP_TIMER_NUM
+ #define STEP_TIMER_NUM 0 // Timer Index for Stepper
+#endif
+#ifndef PULSE_TIMER_NUM
+ #define PULSE_TIMER_NUM STEP_TIMER_NUM
+#endif
+#ifndef TEMP_TIMER_NUM
+ #define TEMP_TIMER_NUM 1 // Timer Index for Temperature
+#endif
#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
#define TEMP_TIMER_PRESCALE 1000 // prescaler for setting Temp timer, 72Khz
@@ -62,8 +68,12 @@
extern void TC5_Handler();
extern void TC7_Handler();
-#define HAL_STEP_TIMER_ISR() void TC5_Handler()
-#define HAL_TEMP_TIMER_ISR() void TC7_Handler()
+#ifndef HAL_STEP_TIMER_ISR
+ #define HAL_STEP_TIMER_ISR() void TC5_Handler()
+#endif
+#ifndef HAL_TEMP_TIMER_ISR
+ #define HAL_TEMP_TIMER_ISR() void TC7_Handler()
+#endif
// ------------------------
// Types
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/Servo.cpp
similarity index 87%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/Servo.cpp
index b3aac776..7185468f 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/Servo.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -17,10 +17,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7))
#include "../../inc/MarlinConfig.h"
@@ -44,9 +43,7 @@ void libServo::move(const int value) {
if (attach(0) >= 0) {
write(value);
safe_delay(servo_delay[servoIndex]);
- #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- detach();
- #endif
+ TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
}
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/Servo.h
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/Servo.h
index 64fa0502..e42cc608 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/Servo.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -17,7 +17,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp
index 3358fa3d..e0726c7c 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.cpp
@@ -1,6 +1,6 @@
/**
******************************************************************************
- * @file EEPROM/EEPROM_Emulation/src/eeprom.c
+ * @file eeprom_emul.cpp
* @author MCD Application Team
* @version V1.2.6
* @date 04-November-2016
@@ -49,6 +49,10 @@
*/
#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7))
+#include "../../inc/MarlinConfig.h"
+
+#if ENABLED(FLASH_EEPROM_EMULATION)
+
/* Includes ------------------------------------------------------------------*/
#include "eeprom_emul.h"
@@ -61,7 +65,7 @@ uint16_t DataVar = 0;
uint16_t VirtAddVarTab[NB_OF_VAR];
/* Private function prototypes -----------------------------------------------*/
-/* Private functions ---------------------------------------------------------*/
+
static HAL_StatusTypeDef EE_Format();
static uint16_t EE_FindValidPage(uint8_t Operation);
static uint16_t EE_VerifyPageFullWriteVariable(uint16_t VirtAddress, uint16_t Data);
@@ -75,6 +79,9 @@ static uint16_t EE_VerifyPageFullyErased(uint32_t Address);
* @retval - Flash error code: on write Flash error
* - FLASH_COMPLETE: on success
*/
+
+/* Private functions ---------------------------------------------------------*/
+
uint16_t EE_Initialize() {
/* Get Page0 and Page1 status */
uint16_t PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS),
@@ -329,7 +336,7 @@ uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data) {
* @brief Erases PAGE and PAGE1 and writes VALID_PAGE header to PAGE
* @param None
* @retval Status of the last operation (Flash write or erase) done during
- * EEPROM formating
+ * EEPROM formatting
*/
static HAL_StatusTypeDef EE_Format() {
FLASH_EraseInitTypeDef pEraseInit;
@@ -518,6 +525,7 @@ static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data) {
return HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, NewPageAddress, VALID_PAGE);
}
+#endif // FLASH_EEPROM_EMULATION
#endif // STM32GENERIC && (STM32F4 || STM32F7)
/**
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.h
similarity index 99%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.h
index e4094f8e..84c4c6e3 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/eeprom_emul.h
@@ -50,7 +50,6 @@
// ------------------------
#include "../../inc/MarlinConfig.h"
-#include "HAL.h"
/* Exported constants --------------------------------------------------------*/
/* EEPROM emulation firmware error codes */
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/EmulatedEeprom.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp
similarity index 53%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/EmulatedEeprom.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp
index 5e6ae09b..00b808fd 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/EmulatedEeprom.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/eeprom_flash.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,39 +13,18 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7))
-/**
- * Description: Functions for a Flash emulated EEPROM
- * Not platform dependent.
- */
-
-// Include configs and pins to get all EEPROM flags
#include "../../inc/MarlinConfig.h"
-#ifdef STM32F7
- #define HAS_EMULATED_EEPROM 1
-#else
- #define HAS_EMULATED_EEPROM NONE(I2C_EEPROM, SPI_EEPROM)
-#endif
-
-#if HAS_EMULATED_EEPROM && ENABLED(EEPROM_SETTINGS)
-
-// ------------------------
-// Includes
-// ------------------------
+#if ENABLED(FLASH_EEPROM_EMULATION)
-#include "HAL.h"
+#include "../shared/eeprom_api.h"
#include "eeprom_emul.h"
-// ------------------------
-// Local defines
-// ------------------------
-
// FLASH_FLAG_PGSERR (Programming Sequence Error) was renamed to
// FLASH_FLAG_ERSERR (Erasing Sequence Error) in STM32F4/7
@@ -55,68 +34,78 @@
//#define FLASH_FLAG_PGSERR FLASH_FLAG_ERSERR
#endif
-// ------------------------
-// Private Variables
-// ------------------------
-
-static bool eeprom_initialized = false;
-
-// ------------------------
-// Public functions
-// ------------------------
-
-void eeprom_init() {
- if (!eeprom_initialized) {
- HAL_FLASH_Unlock();
-
- __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR);
-
- /* EEPROM Init */
- if (EE_Initialize() != EE_OK)
- for (;;) HAL_Delay(1); // Spin forever until watchdog reset
-
- HAL_FLASH_Lock();
- eeprom_initialized = true;
- }
-}
-
-void eeprom_write_byte(uint8_t *pos, unsigned char value) {
- eeprom_init();
-
+void ee_write_byte(uint8_t *pos, unsigned char value) {
HAL_FLASH_Unlock();
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR);
- uint16_t eeprom_address = unsigned(pos);
+ const unsigned eeprom_address = (unsigned)pos;
if (EE_WriteVariable(eeprom_address, uint16_t(value)) != EE_OK)
for (;;) HAL_Delay(1); // Spin forever until watchdog reset
HAL_FLASH_Lock();
}
-uint8_t eeprom_read_byte(uint8_t *pos) {
- eeprom_init();
-
+uint8_t ee_read_byte(uint8_t *pos) {
uint16_t data = 0xFF;
- uint16_t eeprom_address = unsigned(pos);
+ const unsigned eeprom_address = (unsigned)pos;
(void)EE_ReadVariable(eeprom_address, &data); // Data unchanged on error
-
return uint8_t(data);
}
-void eeprom_read_block(void *__dst, const void *__src, size_t __n) {
- eeprom_init();
+#ifndef MARLIN_EEPROM_SIZE
+ #error "MARLIN_EEPROM_SIZE is required for Flash-based EEPROM."
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
- uint16_t data = 0xFF;
- uint16_t eeprom_address = unsigned(__src);
- for (uint8_t c = 0; c < __n; c++) {
- EE_ReadVariable(eeprom_address+c, &data);
- *((uint8_t*)__dst + c) = data;
+bool PersistentStore::access_finish() { return true; }
+
+bool PersistentStore::access_start() {
+ static bool ee_initialized = false;
+ if (!ee_initialized) {
+ HAL_FLASH_Unlock();
+
+ __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR);
+
+ /* EEPROM Init */
+ if (EE_Initialize() != EE_OK)
+ for (;;) HAL_Delay(1); // Spin forever until watchdog reset
+
+ HAL_FLASH_Lock();
+ ee_initialized = true;
}
+ return true;
}
-void eeprom_update_block(const void *__src, void *__dst, size_t __n) {
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
+ while (size--) {
+ uint8_t * const p = (uint8_t * const)pos;
+ uint8_t v = *value;
+ // EEPROM has only ~100,000 write cycles,
+ // so only write bytes that have changed!
+ if (v != ee_read_byte(p)) {
+ ee_write_byte(p, v);
+ if (ee_read_byte(p) != v) {
+ SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
+ return true;
+ }
+ }
+ crc16(crc, &v, 1);
+ pos++;
+ value++;
+ }
+ return false;
+}
+bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
+ do {
+ uint8_t c = ee_read_byte((uint8_t*)pos);
+ if (writing) *value = c;
+ crc16(crc, &c, 1);
+ pos++;
+ value++;
+ } while (--size);
+ return false;
}
-#endif // EEPROM_SETTINGS
+#endif // FLASH_EEPROM_EMULATION
#endif // STM32GENERIC && (STM32F4 || STM32F7)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp
similarity index 72%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp
index 4bd86d22..c0d82dbd 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/eeprom_wired.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
@@ -17,19 +17,29 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7))
-#include "../../inc/MarlinConfigPre.h"
+#include "../../inc/MarlinConfig.h"
+
+#if USE_WIRED_EEPROM
+
+/**
+ * PersistentStore for Arduino-style EEPROM interface
+ * with simple implementations supplied by Marlin.
+ */
-#if ENABLED(EEPROM_SETTINGS)
+#include "../shared/eeprom_if.h"
+#include "../shared/eeprom_api.h"
-#include "../shared/persistent_store_api.h"
+#ifndef MARLIN_EEPROM_SIZE
+ #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM."
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
-bool PersistentStore::access_start() { return true; }
+bool PersistentStore::access_start() { eeprom_init(); return true; }
bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
@@ -41,14 +51,14 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
if (v != eeprom_read_byte(p)) {
eeprom_write_byte(p, v);
if (eeprom_read_byte(p) != v) {
- SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
+ SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
return true;
}
}
crc16(crc, &v, 1);
pos++;
value++;
- };
+ }
return false;
}
@@ -63,7 +73,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false;
}
-size_t PersistentStore::capacity() { return E2END + 1; }
-
-#endif // EEPROM_SETTINGS
+#endif // USE_WIRED_EEPROM
#endif // STM32GENERIC && (STM32F4 || STM32F7)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/endstop_interrupts.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/endstop_interrupts.h
new file mode 100644
index 00000000..fdff8cc6
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/endstop_interrupts.h
@@ -0,0 +1,49 @@
+/**
+ * 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
+ * Copyright (c) 2017 Victor Perez
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#include "../../module/endstops.h"
+
+// One ISR for all EXT-Interrupts
+void endstop_ISR() { endstops.update(); }
+
+void setup_endstop_interrupts() {
+ #define _ATTACH(P) attachInterrupt(P, endstop_ISR, CHANGE)
+ TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN));
+ TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN));
+ TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN));
+ TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN));
+ TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN));
+ TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN));
+ TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN));
+ TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN));
+ TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN));
+ TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN));
+ TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN));
+ TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN));
+ TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN));
+ TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN));
+ TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
+ TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
+ TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
+}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/fastio.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/fastio.h
similarity index 98%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/fastio.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/fastio.h
index 1e5ef2ef..f42be583 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/fastio.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/fastio.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -17,7 +17,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_LCD.h
new file mode 100644
index 00000000..5f1c4b16
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_LCD.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_adv.h
new file mode 100644
index 00000000..5f1c4b16
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_adv.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h
new file mode 100644
index 00000000..b5d808e2
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/inc/Conditionals_post.h
@@ -0,0 +1,29 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#if ENABLED(EEPROM_SETTINGS) && defined(STM32F7)
+ #undef USE_WIRED_EEPROM
+ #undef SRAM_EEPROM_EMULATION
+ #undef SDCARD_EEPROM_EMULATION
+ #define FLASH_EEPROM_EMULATION
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/inc/SanityCheck.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/inc/SanityCheck.h
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/inc/SanityCheck.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/inc/SanityCheck.h
index 7b8d29aa..53b15ba1 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/inc/SanityCheck.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/inc/SanityCheck.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -35,3 +35,7 @@
#if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform."
#endif
+
+#if HAS_TMC_SW_SERIAL
+ #error "TMC220x Software Serial is not supported on this platform."
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/pinsDebug.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/pinsDebug.h
similarity index 78%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/pinsDebug.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/pinsDebug.h
index 342b8755..973abb1b 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/pinsDebug.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/pinsDebug.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,15 +13,15 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
#ifdef NUM_DIGITAL_PINS // Only in ST's Arduino core (STM32duino, STM32Core)
- #include "../HAL_STM32/pinsDebug_STM32duino.h"
+ #include "../STM32/pinsDebug_STM32duino.h"
#elif defined(BOARD_NR_GPIO_PINS) // Only in STM32GENERIC (Maple)
- #include "../HAL_STM32/pinsDebug_STM32GENERIC.h"
+ #include "../STM32/pinsDebug_STM32GENERIC.h"
#else
#error "M43 Pins Debugging not supported for this board."
#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/spi_pins.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/spi_pins.h
similarity index 86%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/spi_pins.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/spi_pins.h
index 4aef289a..75a6a2b2 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/spi_pins.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/spi_pins.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/timers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/timers.h
similarity index 85%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/timers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/timers.h
index cf33205b..4e8c8178 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/timers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/timers.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2017 Victor Perez
*
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/watchdog.cpp
similarity index 92%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/watchdog.cpp
index 900d1ef6..cb12ec7a 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/watchdog.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7))
#include "../../inc/MarlinConfig.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/watchdog.h
similarity index 85%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/watchdog.h
index 9e2a2dc2..3dbc2d08 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/STM32_F4_F7/watchdog.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/HAL.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/HAL.cpp
similarity index 94%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/HAL.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/HAL.cpp
index 2e15324e..d276a4c8 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/HAL.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/HAL.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/HAL.h
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/HAL.h
index 684afa58..890930f7 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/HAL.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
*
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -34,7 +34,6 @@
#include "fastio.h"
#include "watchdog.h"
-#include "timers.h"
#include
@@ -70,8 +69,8 @@ typedef int8_t pin_t;
#define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1)
#endif
-#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq()
-#define CRITICAL_SECTION_END if (!primask) __enable_irq()
+#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq()
+#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
#define ISRS_ENABLED() (!__get_PRIMASK())
#define ENABLE_ISRS() __enable_irq()
#define DISABLE_ISRS() __disable_irq()
@@ -108,8 +107,9 @@ extern "C" {
void HAL_adc_init();
-#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
+#define HAL_ADC_VREF 3.3
#define HAL_ADC_RESOLUTION 10
+#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
#define HAL_READ_ADC() HAL_adc_get_result()
#define HAL_ADC_READY() true
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/HAL_SPI.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/HAL_SPI.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp
index 4236f02b..cdb3f470 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/HAL_SPI.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#ifdef __MK20DX256__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/Servo.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/Servo.cpp
similarity index 88%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/Servo.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/Servo.cpp
index 6451f6b1..544892cb 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/Servo.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/Servo.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#ifdef __MK20DX256__
@@ -46,9 +46,7 @@ void libServo::move(const int value) {
if (attach(0) >= 0) {
write(value);
safe_delay(servo_delay[servoIndex]);
- #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- detach();
- #endif
+ TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
}
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/Servo.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/Servo.h
similarity index 89%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/Servo.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/Servo.h
index 3eb7d39b..82b601d9 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/Servo.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/Servo.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/eeprom.cpp
similarity index 71%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/eeprom.cpp
index 6da10263..f6631322 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/eeprom.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,18 +13,29 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#ifdef __MK20DX256__
#include "../../inc/MarlinConfig.h"
-#if ENABLED(EEPROM_SETTINGS)
+#if USE_WIRED_EEPROM
-#include "../shared/persistent_store_api.h"
+/**
+ * PersistentStore for Arduino-style EEPROM interface
+ * with implementations supplied by the framework.
+ */
+
+#include "../shared/eeprom_api.h"
+#include
+
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE size_t(E2END + 1)
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
-bool PersistentStore::access_start() { return true; }
+bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
@@ -36,14 +47,14 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
if (v != eeprom_read_byte(p)) {
eeprom_write_byte(p, v);
if (eeprom_read_byte(p) != v) {
- SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
+ SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
return true;
}
}
crc16(crc, &v, 1);
pos++;
value++;
- };
+ }
return false;
}
@@ -58,5 +69,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false;
}
-#endif // EEPROM_SETTINGS
+#endif // USE_WIRED_EEPROM
#endif // __MK20DX256__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/endstop_interrupts.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/endstop_interrupts.h
similarity index 66%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/endstop_interrupts.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/endstop_interrupts.h
index 221b721b..999ada51 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/endstop_interrupts.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/endstop_interrupts.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -47,31 +47,21 @@ void endstop_ISR() { endstops.update(); }
void setup_endstop_interrupts() {
#define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
- #if HAS_X_MAX
- _ATTACH(X_MAX_PIN);
- #endif
- #if HAS_X_MIN
- _ATTACH(X_MIN_PIN);
- #endif
- #if HAS_Y_MAX
- _ATTACH(Y_MAX_PIN);
- #endif
- #if HAS_Y_MIN
- _ATTACH(Y_MIN_PIN);
- #endif
- #if HAS_Z_MAX
- _ATTACH(Z_MAX_PIN);
- #endif
- #if HAS_Z_MIN
- _ATTACH(Z_MIN_PIN);
- #endif
- #if HAS_Z2_MAX
- _ATTACH(Z2_MAX_PIN);
- #endif
- #if HAS_Z2_MIN
- _ATTACH(Z2_MIN_PIN);
- #endif
- #if HAS_Z_MIN_PROBE_PIN
- _ATTACH(Z_MIN_PROBE_PIN);
- #endif
+ TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN));
+ TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN));
+ TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN));
+ TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN));
+ TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN));
+ TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN));
+ TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN));
+ TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN));
+ TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN));
+ TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN));
+ TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN));
+ TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN));
+ TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN));
+ TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN));
+ TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
+ TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
+ TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/fastio.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/fastio.h
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/fastio.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/fastio.h
index d1b5f567..9a299de9 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/fastio.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/fastio.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -39,7 +39,7 @@
*
* Now you can simply SET_OUTPUT(PIN); WRITE(PIN, HIGH); WRITE(PIN, LOW);
*
- * Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
+ * Why double up on these macros? see https://gcc.gnu.org/onlinedocs/gcc-4.8.5/cpp/Stringification.html
*/
#define _READ(P) bool(CORE_PIN ## P ## _PINREG & CORE_PIN ## P ## _BITMASK)
@@ -76,8 +76,9 @@
#define SET_INPUT(IO) _SET_INPUT(IO)
#define SET_INPUT_PULLUP(IO) _SET_INPUT_PULLUP(IO)
+#define SET_INPUT_PULLDOWN SET_INPUT
#define SET_OUTPUT(IO) _SET_OUTPUT(IO)
-#define SET_PWM(IO) SET_OUTPUT(IO)
+#define SET_PWM SET_OUTPUT
#define IS_INPUT(IO) _IS_INPUT(IO)
#define IS_OUTPUT(IO) _IS_OUTPUT(IO)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_LCD.h
new file mode 100644
index 00000000..5f1c4b16
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_LCD.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_adv.h
new file mode 100644
index 00000000..5f1c4b16
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_adv.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_post.h
similarity index 78%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_post.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_post.h
index 85f26f40..998f1dcc 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_LINUX/inc/Conditionals_post.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_post.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,11 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
+
+#if USE_FALLBACK_EEPROM
+ #define USE_WIRED_EEPROM 1
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/inc/SanityCheck.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/inc/SanityCheck.h
similarity index 81%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/inc/SanityCheck.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/inc/SanityCheck.h
index 389d2782..0b731a61 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/inc/SanityCheck.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/inc/SanityCheck.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -32,3 +32,7 @@
#if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform."
#endif
+
+#if HAS_TMC_SW_SERIAL
+ #error "TMC220x Software Serial is not supported on this platform."
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/pinsDebug.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/pinsDebug.h
similarity index 100%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/pinsDebug.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/pinsDebug.h
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/spi_pins.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/spi_pins.h
similarity index 86%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/spi_pins.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/spi_pins.h
index 8a0ab8f9..5754fbfe 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/spi_pins.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/spi_pins.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/timers.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/timers.cpp
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/timers.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/timers.cpp
index e4ccf33a..bf756af8 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/timers.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/timers.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -26,8 +26,7 @@
#ifdef __MK20DX256__
-#include "HAL.h"
-#include "timers.h"
+#include "../../inc/MarlinConfig.h"
/** \brief Instruction Synchronization Barrier
Instruction Synchronization Barrier flushes the pipeline in the processor,
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/timers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/timers.h
similarity index 83%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/timers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/timers.h
index 6dff7701..4f004ef7 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/timers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/timers.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -47,9 +47,15 @@ typedef uint32_t hal_timer_t;
#define HAL_TIMER_RATE (FTM0_TIMER_RATE)
-#define STEP_TIMER_NUM 0
-#define TEMP_TIMER_NUM 1
-#define PULSE_TIMER_NUM STEP_TIMER_NUM
+#ifndef STEP_TIMER_NUM
+ #define STEP_TIMER_NUM 0 // Timer Index for Stepper
+#endif
+#ifndef PULSE_TIMER_NUM
+ #define PULSE_TIMER_NUM STEP_TIMER_NUM
+#endif
+#ifndef TEMP_TIMER_NUM
+ #define TEMP_TIMER_NUM 1 // Timer Index for Temperature
+#endif
#define TEMP_TIMER_FREQUENCY 1000
@@ -68,8 +74,12 @@ typedef uint32_t hal_timer_t;
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
-#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler()
-#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler()
+#ifndef HAL_STEP_TIMER_ISR
+ #define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler()
+#endif
+#ifndef HAL_TEMP_TIMER_ISR
+ #define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler()
+#endif
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/watchdog.cpp
similarity index 87%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/watchdog.cpp
index d1313e1f..9f7b70d9 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/watchdog.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#ifdef __MK20DX256__
#include "../../inc/MarlinConfig.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/watchdog.h
similarity index 87%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/watchdog.h
index 861afcbc..b8b46a40 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY31_32/watchdog.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/HAL.cpp
similarity index 94%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/HAL.cpp
index 58489447..bcbee1d4 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/HAL.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -94,7 +94,7 @@ extern "C" {
}
void HAL_adc_start_conversion(const uint8_t adc_pin) {
- uint16_t pin = pin2sc1a[adc_pin];
+ const uint16_t pin = pin2sc1a[adc_pin];
if (pin == 0xFF) {
// Digital only
HAL_adc_select = -1;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/HAL.h
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/HAL.h
index 97763bf2..5442ae2d 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/HAL.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
*
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -34,8 +34,6 @@
#include "fastio.h"
#include "watchdog.h"
-#include "timers.h"
-
#include
#include
@@ -73,8 +71,8 @@ typedef int8_t pin_t;
#define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1)
#endif
-#define CRITICAL_SECTION_START uint32_t primask = __get_primask(); __disable_irq()
-#define CRITICAL_SECTION_END if (!primask) __enable_irq()
+#define CRITICAL_SECTION_START() uint32_t primask = __get_primask(); __disable_irq()
+#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
#define ISRS_ENABLED() (!__get_primask())
#define ENABLE_ISRS() __enable_irq()
#define DISABLE_ISRS() __disable_irq()
@@ -114,8 +112,9 @@ extern "C" {
void HAL_adc_init();
-#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
+#define HAL_ADC_VREF 3.3
#define HAL_ADC_RESOLUTION 10
+#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
#define HAL_READ_ADC() HAL_adc_get_result()
#define HAL_ADC_READY() true
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/HAL_SPI.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp
similarity index 96%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/HAL_SPI.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp
index 44ab74cc..0b1ae4af 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/HAL_SPI.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#if defined(__MK64FX512__) || defined(__MK66FX1M0__)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/Servo.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/Servo.cpp
similarity index 88%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/Servo.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/Servo.cpp
index d376b80a..d1390187 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/Servo.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/Servo.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#if defined(__MK64FX512__) || defined(__MK66FX1M0__)
@@ -46,9 +46,7 @@ void libServo::move(const int value) {
if (attach(0) >= 0) {
write(value);
safe_delay(servo_delay[servoIndex]);
- #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- detach();
- #endif
+ TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
}
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/Servo.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/Servo.h
similarity index 89%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/Servo.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/Servo.h
index cafd323a..ae904f0e 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/Servo.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/Servo.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/eeprom.cpp
similarity index 75%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/eeprom.cpp
index 17934f71..d2d7324c 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/eeprom.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
@@ -17,20 +17,29 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#if defined(__MK64FX512__) || defined(__MK66FX1M0__)
#include "../../inc/MarlinConfig.h"
-#if ENABLED(EEPROM_SETTINGS)
+#if USE_WIRED_EEPROM
+
+/**
+ * PersistentStore for Arduino-style EEPROM interface
+ * with implementations supplied by the framework.
+ */
-#include "../shared/persistent_store_api.h"
+#include "../shared/eeprom_api.h"
#include
-bool PersistentStore::access_start() { return true; }
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE size_t(E2END + 1)
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+
+bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
@@ -42,14 +51,14 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
if (v != eeprom_read_byte(p)) {
eeprom_write_byte(p, v);
if (eeprom_read_byte(p) != v) {
- SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
+ SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
return true;
}
}
crc16(crc, &v, 1);
pos++;
value++;
- };
+ }
return false;
}
@@ -64,7 +73,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false;
}
-size_t PersistentStore::capacity() { return E2END + 1; }
-
-#endif // EEPROM_SETTINGS
+#endif // USE_WIRED_EEPROM
#endif // __MK64FX512__ || __MK66FX1M0__
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/endstop_interrupts.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/endstop_interrupts.h
similarity index 66%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/endstop_interrupts.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/endstop_interrupts.h
index 3862f2b5..92e22efc 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/endstop_interrupts.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/endstop_interrupts.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -46,37 +46,21 @@ void endstop_ISR() { endstops.update(); }
*/
void setup_endstop_interrupts() {
#define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
- #if HAS_X_MAX
- _ATTACH(X_MAX_PIN);
- #endif
- #if HAS_X_MIN
- _ATTACH(X_MIN_PIN);
- #endif
- #if HAS_Y_MAX
- _ATTACH(Y_MAX_PIN);
- #endif
- #if HAS_Y_MIN
- _ATTACH(Y_MIN_PIN);
- #endif
- #if HAS_Z_MAX
- _ATTACH(Z_MAX_PIN);
- #endif
- #if HAS_Z_MIN
- _ATTACH(Z_MIN_PIN);
- #endif
- #if HAS_Z2_MAX
- _ATTACH(Z2_MAX_PIN);
- #endif
- #if HAS_Z2_MIN
- _ATTACH(Z2_MIN_PIN);
- #endif
- #if HAS_Z3_MAX
- _ATTACH(Z3_MAX_PIN);
- #endif
- #if HAS_Z3_MIN
- _ATTACH(Z3_MIN_PIN);
- #endif
- #if HAS_Z_MIN_PROBE_PIN
- _ATTACH(Z_MIN_PROBE_PIN);
- #endif
+ TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN));
+ TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN));
+ TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN));
+ TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN));
+ TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN));
+ TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN));
+ TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN));
+ TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN));
+ TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN));
+ TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN));
+ TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN));
+ TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN));
+ TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN));
+ TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN));
+ TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
+ TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
+ TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/fastio.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/fastio.h
similarity index 90%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/fastio.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/fastio.h
index d1b5f567..9a299de9 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/fastio.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/fastio.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -39,7 +39,7 @@
*
* Now you can simply SET_OUTPUT(PIN); WRITE(PIN, HIGH); WRITE(PIN, LOW);
*
- * Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
+ * Why double up on these macros? see https://gcc.gnu.org/onlinedocs/gcc-4.8.5/cpp/Stringification.html
*/
#define _READ(P) bool(CORE_PIN ## P ## _PINREG & CORE_PIN ## P ## _BITMASK)
@@ -76,8 +76,9 @@
#define SET_INPUT(IO) _SET_INPUT(IO)
#define SET_INPUT_PULLUP(IO) _SET_INPUT_PULLUP(IO)
+#define SET_INPUT_PULLDOWN SET_INPUT
#define SET_OUTPUT(IO) _SET_OUTPUT(IO)
-#define SET_PWM(IO) SET_OUTPUT(IO)
+#define SET_PWM SET_OUTPUT
#define IS_INPUT(IO) _IS_INPUT(IO)
#define IS_OUTPUT(IO) _IS_OUTPUT(IO)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_LCD.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_LCD.h
new file mode 100644
index 00000000..5f1c4b16
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_LCD.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_adv.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_adv.h
new file mode 100644
index 00000000..5f1c4b16
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_adv.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_post.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_post.h
new file mode 100644
index 00000000..998f1dcc
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_post.h
@@ -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 .
+ *
+ */
+#pragma once
+
+#if USE_FALLBACK_EEPROM
+ #define USE_WIRED_EEPROM 1
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/inc/SanityCheck.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h
similarity index 81%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/inc/SanityCheck.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h
index 6a126b68..36b80180 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/inc/SanityCheck.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -32,3 +32,7 @@
#if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform."
#endif
+
+#if HAS_TMC_SW_SERIAL
+ #error "TMC220x Software Serial is not supported on this platform."
+#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/pinsDebug.h
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/pinsDebug.h
index db750cf6..e57c73c5 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/pinsDebug.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/spi_pins.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/spi_pins.h
similarity index 86%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/spi_pins.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/spi_pins.h
index 9c6a83e3..276d4f45 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/spi_pins.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/spi_pins.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/timers.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/timers.cpp
similarity index 95%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/timers.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/timers.cpp
index 6bbc16dc..5725e83a 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/timers.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/timers.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -27,8 +27,7 @@
#if defined(__MK64FX512__) || defined(__MK66FX1M0__)
-#include "HAL.h"
-#include "timers.h"
+#include "../../inc/MarlinConfig.h"
/** \brief Instruction Synchronization Barrier
Instruction Synchronization Barrier flushes the pipeline in the processor,
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/timers.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/timers.h
similarity index 83%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/timers.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/timers.h
index 8ae51107..68060d0e 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/timers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/timers.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
*
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*/
#pragma once
@@ -46,9 +46,15 @@ typedef uint32_t hal_timer_t;
#define HAL_TIMER_RATE (FTM0_TIMER_RATE)
-#define STEP_TIMER_NUM 0
-#define TEMP_TIMER_NUM 1
-#define PULSE_TIMER_NUM STEP_TIMER_NUM
+#ifndef STEP_TIMER_NUM
+ #define STEP_TIMER_NUM 0 // Timer Index for Stepper
+#endif
+#ifndef PULSE_TIMER_NUM
+ #define PULSE_TIMER_NUM STEP_TIMER_NUM
+#endif
+#ifndef TEMP_TIMER_NUM
+ #define TEMP_TIMER_NUM 1 // Timer Index for Temperature
+#endif
#define TEMP_TIMER_FREQUENCY 1000
@@ -67,8 +73,12 @@ typedef uint32_t hal_timer_t;
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
-#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler()
-#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler()
+#ifndef HAL_STEP_TIMER_ISR
+ #define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler()
+#endif
+#ifndef HAL_TEMP_TIMER_ISR
+ #define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler()
+#endif
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/watchdog.cpp
similarity index 88%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/watchdog.cpp
index f58217c7..e735ee79 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/watchdog.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#if defined(__MK64FX512__) || defined(__MK66FX1M0__)
#include "../../inc/MarlinConfig.h"
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/watchdog.h
similarity index 86%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/watchdog.h
index 7c272609..981b1f0b 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/TEENSY35_36/watchdog.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/platforms.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/platforms.h
index e3e7f52c..d4cec642 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/platforms.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/platforms.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,37 +16,35 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
+#define XSTR(V...) #V
+
#ifdef __AVR__
- #define HAL_PLATFORM HAL_AVR
+ #define HAL_PATH(PATH, NAME) XSTR(PATH/AVR/NAME)
#elif defined(ARDUINO_ARCH_SAM)
- #define HAL_PLATFORM HAL_DUE
+ #define HAL_PATH(PATH, NAME) XSTR(PATH/DUE/NAME)
#elif defined(__MK20DX256__)
- #define HAL_PLATFORM HAL_TEENSY31_32
+ #define HAL_PATH(PATH, NAME) XSTR(PATH/TEENSY31_32/NAME)
#elif defined(__MK64FX512__) || defined(__MK66FX1M0__)
- #define HAL_PLATFORM HAL_TEENSY35_36
+ #define HAL_PATH(PATH, NAME) XSTR(PATH/TEENSY35_36/NAME)
#elif defined(TARGET_LPC1768)
- #define HAL_PLATFORM HAL_LPC1768
+ #define HAL_PATH(PATH, NAME) XSTR(PATH/LPC1768/NAME)
#elif defined(__STM32F1__) || defined(TARGET_STM32F1)
- #define HAL_PLATFORM HAL_STM32F1
+ #define HAL_PATH(PATH, NAME) XSTR(PATH/STM32F1/NAME)
#elif defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7))
- #define HAL_PLATFORM HAL_STM32_F4_F7
+ #define HAL_PATH(PATH, NAME) XSTR(PATH/STM32_F4_F7/NAME)
#elif defined(ARDUINO_ARCH_STM32)
- #define HAL_PLATFORM HAL_STM32
+ #define HAL_PATH(PATH, NAME) XSTR(PATH/STM32/NAME)
#elif defined(ARDUINO_ARCH_ESP32)
- #define HAL_PLATFORM HAL_ESP32
+ #define HAL_PATH(PATH, NAME) XSTR(PATH/ESP32/NAME)
#elif defined(__PLAT_LINUX__)
- #define HAL_PLATFORM HAL_LINUX
+ #define HAL_PATH(PATH, NAME) XSTR(PATH/LINUX/NAME)
#elif defined(__SAMD51__)
- #define HAL_PLATFORM HAL_SAMD51
+ #define HAL_PATH(PATH, NAME) XSTR(PATH/SAMD51/NAME)
#else
#error "Unsupported Platform!"
#endif
-
-#define XSTR_(M) #M
-#define XSTR(M) XSTR_(M)
-#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL_PLATFORM/NAME)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/Delay.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/Delay.h
index b1dafbb0..d98e9608 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/Delay.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/Delay.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -29,7 +29,6 @@
* DELAY_US(count): Delay execution in microseconds
*/
-#include "../../core/millis_t.h"
#include "../../core/macros.h"
#if defined(__arm__) || defined(__thumb__)
@@ -37,7 +36,7 @@
#if __CORTEX_M == 7
// Cortex-M3 through M7 can use the cycle counter of the DWT unit
- // http://www.anthonyvh.com/2017/05/18/cortex_m-cycle_counter/
+ // https://www.anthonyvh.com/2017/05/18/cortex_m-cycle_counter/
FORCE_INLINE static void enableCycleCounter() {
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
@@ -145,21 +144,7 @@
}
#undef nop
-#elif defined(ESP32)
-
- FORCE_INLINE static void DELAY_CYCLES(uint32_t x) {
- unsigned long ccount, stop;
-
- __asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) );
-
- stop = ccount + x; // This can overflow
-
- while (ccount < stop) { // This doesn't deal with overflows
- __asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) );
- }
- }
-
-#elif defined(__PLAT_LINUX__)
+#elif defined(__PLAT_LINUX__) || defined(ESP32)
// specified inside platform
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/HAL_SPI.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/HAL_SPI.h
index d8052070..59af5548 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/HAL_SPI.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/HAL_SPI.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/HAL_ST7920.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/HAL_ST7920.h
index de40ade5..05e8a1f2 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/HAL_ST7920.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/HAL_ST7920.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,18 +16,18 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
/**
- * HAL/HAL_ST7920.h
+ * HAL/ST7920.h
* For the HALs that provide direct access to the ST7920 display
* (bypassing U8G), it will allow the LIGHTWEIGHT_UI to operate.
*/
-#if HAS_GRAPHICAL_LCD && ENABLED(LIGHTWEIGHT_UI)
+#if BOTH(HAS_GRAPHICAL_LCD, LIGHTWEIGHT_UI)
void ST7920_cs();
void ST7920_ncs();
void ST7920_set_cmd();
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/HAL_spi_L6470.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/HAL_spi_L6470.cpp
index 936acc7c..bd85dbe7 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/HAL_spi_L6470.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/HAL_spi_L6470.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -27,12 +27,12 @@
#include "../../inc/MarlinConfig.h"
-#if HAS_DRIVER(L6470)
+#if HAS_L64XX
#include "Delay.h"
#include "../../core/serial.h"
-#include "../../libs/L6470/L6470_Marlin.h"
+#include "../../libs/L64XX/L64XX_Marlin.h"
// Make sure GCC optimizes this file.
// Note that this line triggers a bug in GCC which is fixed by casting.
@@ -40,7 +40,7 @@
#pragma GCC optimize (3)
// run at ~4Mhz
-uint8_t L6470_SpiTransfer_Mode_0(uint8_t b) { // using Mode 0
+inline uint8_t L6470_SpiTransfer_Mode_0(uint8_t b) { // using Mode 0
for (uint8_t bits = 8; bits--;) {
WRITE(L6470_CHAIN_MOSI_PIN, b & 0x80);
b <<= 1; // little setup time
@@ -56,39 +56,60 @@ uint8_t L6470_SpiTransfer_Mode_0(uint8_t b) { // using Mode 0
return b;
}
-uint8_t L6470_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3
+inline uint8_t L6470_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3
for (uint8_t bits = 8; bits--;) {
WRITE(L6470_CHAIN_SCK_PIN, LOW);
WRITE(L6470_CHAIN_MOSI_PIN, b & 0x80);
DELAY_NS(125); // 10 cycles @ 84mhz
-
WRITE(L6470_CHAIN_SCK_PIN, HIGH);
+ DELAY_NS(125); // Need more delay for fast CPUs
b <<= 1; // little setup time
b |= (READ(L6470_CHAIN_MISO_PIN) != 0);
}
-
- DELAY_NS(125); // 10 cycles @ 84mhz
+ DELAY_NS(125); // 10 cycles @ 84mhz
return b;
}
/**
- * The following are weak-linked and defined as do-nothing
- * functions by the L6470-Arduino library. They must be
- * defined by the client (Marlin) to provide an SPI interface.
+ * L64XX methods for SPI init and transfer
*/
+void L64XX_Marlin::spi_init() {
+ OUT_WRITE(L6470_CHAIN_SS_PIN, HIGH);
+ OUT_WRITE(L6470_CHAIN_SCK_PIN, HIGH);
+ OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH);
+ SET_INPUT(L6470_CHAIN_MISO_PIN);
+
+ #if PIN_EXISTS(L6470_BUSY)
+ SET_INPUT(L6470_BUSY_PIN);
+ #endif
-uint8_t L6470_transfer(uint8_t data, int16_t ss_pin, const uint8_t chain_position) {
+ OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH);
+}
+
+uint8_t L64XX_Marlin::transfer_single(uint8_t data, int16_t ss_pin) {
+ // First device in chain has data sent last
+ extDigitalWrite(ss_pin, LOW);
+
+ DISABLE_ISRS(); // Disable interrupts during SPI transfer (can't allow partial command to chips)
+ const uint8_t data_out = L6470_SpiTransfer_Mode_3(data);
+ ENABLE_ISRS(); // Enable interrupts
+
+ extDigitalWrite(ss_pin, HIGH);
+ return data_out;
+}
+
+uint8_t L64XX_Marlin::transfer_chain(uint8_t data, int16_t ss_pin, uint8_t chain_position) {
uint8_t data_out = 0;
// first device in chain has data sent last
extDigitalWrite(ss_pin, LOW);
- for (uint8_t i = L6470::chain[0]; (i >= 1) && !spi_abort; i--) { // stop sending data if spi_abort is active
- DISABLE_ISRS(); // disable interrupts during SPI transfer (can't allow partial command to chips)
- uint8_t temp = L6470_SpiTransfer_Mode_3(uint8_t(i == chain_position ? data : dSPIN_NOP));
- ENABLE_ISRS(); // enable interrupts
+ for (uint8_t i = L64XX::chain[0]; !L64xxManager.spi_abort && i >= 1; i--) { // Send data unless aborted
+ DISABLE_ISRS(); // Disable interrupts during SPI transfer (can't allow partial command to chips)
+ const uint8_t temp = L6470_SpiTransfer_Mode_3(uint8_t(i == chain_position ? data : dSPIN_NOP));
+ ENABLE_ISRS(); // Enable interrupts
if (i == chain_position) data_out = temp;
}
@@ -96,11 +117,14 @@ uint8_t L6470_transfer(uint8_t data, int16_t ss_pin, const uint8_t chain_positio
return data_out;
}
-void L6470_transfer(uint8_t L6470_buf[], const uint8_t length) {
- // first device in chain has data sent last
+/**
+ * Platform-supplied L6470 buffer transfer method
+ */
+void L64XX_Marlin::transfer(uint8_t L6470_buf[], const uint8_t length) {
+ // First device in chain has its data sent last
- if (spi_active) { // interrupted SPI transfer so need to
- WRITE(L6470_CHAIN_SS_PIN, HIGH); // guarantee min high of 650nS
+ if (spi_active) { // Interrupted SPI transfer so need to
+ WRITE(L6470_CHAIN_SS_PIN, HIGH); // guarantee min high of 650ns
DELAY_US(1);
}
@@ -110,19 +134,6 @@ void L6470_transfer(uint8_t L6470_buf[], const uint8_t length) {
WRITE(L6470_CHAIN_SS_PIN, HIGH);
}
-void L6470_spi_init() {
- OUT_WRITE(L6470_CHAIN_SS_PIN, HIGH);
- OUT_WRITE(L6470_CHAIN_SCK_PIN, HIGH);
- OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH);
- SET_INPUT(L6470_CHAIN_MISO_PIN);
-
- #if PIN_EXISTS(L6470_BUSY)
- SET_INPUT(L6470_BUSY_PIN);
- #endif
-
- OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH);
-}
-
#pragma GCC reset_options
-#endif // HAS_DRIVER(L6470)
+#endif // HAS_L64XX
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/Marduino.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/Marduino.h
index a2de03a2..3003f3cc 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/Marduino.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/Marduino.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/MarlinSerial.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/MarlinSerial.h
deleted file mode 100644
index afbd7d34..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/MarlinSerial.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
-
-/**
- * HAL/shared/MarlinSerial.h
- */
-
-#include "../../inc/MarlinConfigPre.h"
-
-constexpr bool
- bSERIAL_XON_XOFF = (false
- #if ENABLED(SERIAL_XON_XOFF)
- || true
- #endif
- ),
- bEMERGENCY_PARSER = (false
- #if ENABLED(EMERGENCY_PARSER)
- || true
- #endif
- ),
- bSERIAL_STATS_DROPPED_RX = (false
- #if ENABLED(SERIAL_STATS_DROPPED_RX)
- || true
- #endif
- ),
- bSERIAL_STATS_RX_BUFFER_OVERRUNS = (false
- #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS)
- || true
- #endif
- ),
- bSERIAL_STATS_RX_FRAMING_ERRORS = (false
- #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS)
- || true
- #endif
- ),
- bSERIAL_STATS_MAX_RX_QUEUED = (false
- #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
- || true
- #endif
- );
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/backtrace.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/backtrace.cpp
index 7a8377f7..6cf5e055 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/backtrace.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/backtrace.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,10 +16,9 @@
* 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 .
+ * along with this program. If not, see .
*
*/
-
#if defined(__arm__) || defined(__thumb__)
#include "backtrace.h"
@@ -35,7 +34,7 @@ static bool UnwReportOut(void* ctx, const UnwReport* bte) {
(*p)++;
- SERIAL_CHAR('#'); SERIAL_PRINT(*p,DEC); SERIAL_ECHOPGM(" : ");
+ SERIAL_CHAR('#'); SERIAL_PRINT(*p, DEC); SERIAL_ECHOPGM(" : ");
SERIAL_ECHOPGM(bte->name ? bte->name : "unknown"); SERIAL_ECHOPGM("@0x"); SERIAL_PRINT(bte->function, HEX);
SERIAL_CHAR('+'); SERIAL_PRINT(bte->address - bte->function,DEC);
SERIAL_ECHOPGM(" PC:"); SERIAL_PRINT(bte->address,HEX); SERIAL_CHAR('\n');
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/backtrace.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/backtrace.h
index a2b8eae5..fccadeda 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/backtrace.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/backtrace.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp
index d5449f86..26ca8b26 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp
@@ -807,7 +807,7 @@ UnwResult UnwStartThumb(UnwState * const state) {
case 2: /* MOV */
UnwPrintd5("MOV r%d, r%d\t; r%d %s", rhd, rhs, rhd, M_Origin2Str(state->regData[rhs].o));
state->regData[rhd].v = state->regData[rhs].v;
- state->regData[rhd].o = state->regData[rhd].o;
+ state->regData[rhd].o = state->regData[rhs].o;
break;
case 3: /* BX */
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp
index 207cd56a..f524673e 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp
@@ -4,7 +4,7 @@
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* This library was modified, some bugs fixed, stack address validated
* and adapted to be used in Marlin 3D printer firmware as backtracer
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/unwinder.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/unwinder.h
index 604854ad..cae13795 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/unwinder.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/backtrace/unwinder.h
@@ -164,7 +164,7 @@ typedef struct {
* link register (i.e. not a normal register) and the stack pointer value
* supplied.
*
- * -If the program was compiled with -funwind-tables , it will use them to
+ * -If the program was compiled with -funwind-tables it will use them to
* perform the traceback. Otherwise, brute force will be employed
* -If the program was compiled with -mpoke-function-name, then you will
* get function names in the traceback. Otherwise, you will not.
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/persistent_store_api.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_api.cpp
similarity index 84%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/persistent_store_api.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_api.cpp
index 9aed03a0..47cfa5a2 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/persistent_store_api.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_api.cpp
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
@@ -17,14 +17,14 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#include "../../inc/MarlinConfigPre.h"
#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
- #include "persistent_store_api.h"
+ #include "eeprom_api.h"
PersistentStore persistentStore;
#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/persistent_store_api.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_api.h
similarity index 72%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/persistent_store_api.h
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_api.h
index 02013120..6445f7a4 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/persistent_store_api.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_api.h
@@ -1,7 +1,7 @@
/**
* Marlin 3D Printer Firmware
*
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
@@ -17,7 +17,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -29,20 +29,38 @@
class PersistentStore {
public:
+
+ // Total available persistent storage space (in bytes)
+ static size_t capacity();
+
+ // Prepare to read or write
static bool access_start();
+
+ // Housecleaning after read or write
static bool access_finish();
+
+ // Write one or more bytes of data and update the CRC
+ // Return 'true' on write error
static bool write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc);
+
+ // Read one or more bytes of data and update the CRC
+ // Return 'true' on read error
static bool read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing=true);
- static size_t capacity();
+ // Write one or more bytes of data
+ // Return 'true' on write error
static inline bool write_data(const int pos, const uint8_t* value, const size_t size=sizeof(uint8_t)) {
int data_pos = pos;
uint16_t crc = 0;
return write_data(data_pos, value, size, &crc);
}
+ // Write a single byte of data
+ // Return 'true' on write error
static inline bool write_data(const int pos, const uint8_t value) { return write_data(pos, &value); }
+ // Read one or more bytes of data
+ // Return 'true' on read error
static inline bool read_data(const int pos, uint8_t* value, const size_t size=1) {
int data_pos = pos;
uint16_t crc = 0;
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_i2c.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_i2c.cpp
deleted file mode 100644
index 2752b7d4..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_i2c.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 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 .
- *
- */
-
-/**
- * Description: functions for I2C connected external EEPROM.
- * Not platform dependent.
- */
-
-#include "../../inc/MarlinConfig.h"
-
-#if ENABLED(I2C_EEPROM)
-
-#include "../HAL.h"
-#include
-
-// ------------------------
-// Private Variables
-// ------------------------
-
-static uint8_t eeprom_device_address = 0x50;
-
-// ------------------------
-// Public functions
-// ------------------------
-
-static void eeprom_init() {
- Wire.begin();
-}
-
-void eeprom_write_byte(uint8_t *pos, unsigned char value) {
- unsigned eeprom_address = (unsigned) pos;
-
- eeprom_init();
-
- Wire.beginTransmission(I2C_ADDRESS(eeprom_device_address));
- Wire.write((int)(eeprom_address >> 8)); // MSB
- Wire.write((int)(eeprom_address & 0xFF)); // LSB
- Wire.write(value);
- Wire.endTransmission();
-
- // wait for write cycle to complete
- // this could be done more efficiently with "acknowledge polling"
- delay(5);
-}
-
-// WARNING: address is a page address, 6-bit end will wrap around
-// also, data can be maximum of about 30 bytes, because the Wire library has a buffer of 32 bytes
-void eeprom_update_block(const void *pos, void* eeprom_address, size_t n) {
- eeprom_init();
-
- Wire.beginTransmission(I2C_ADDRESS(eeprom_device_address));
- Wire.write((int)((unsigned)eeprom_address >> 8)); // MSB
- Wire.write((int)((unsigned)eeprom_address & 0xFF)); // LSB
- Wire.endTransmission();
-
- uint8_t *ptr = (uint8_t*)pos;
- uint8_t flag = 0;
- Wire.requestFrom(eeprom_device_address, (byte)n);
- for (byte c = 0; c < n && Wire.available(); c++)
- flag |= Wire.read() ^ ptr[c];
-
- if (flag) {
- Wire.beginTransmission(I2C_ADDRESS(eeprom_device_address));
- Wire.write((int)((unsigned)eeprom_address >> 8)); // MSB
- Wire.write((int)((unsigned)eeprom_address & 0xFF)); // LSB
- Wire.write((uint8_t*)pos, n);
- Wire.endTransmission();
-
- // wait for write cycle to complete
- // this could be done more efficiently with "acknowledge polling"
- delay(5);
- }
-}
-
-uint8_t eeprom_read_byte(uint8_t *pos) {
- unsigned eeprom_address = (unsigned)pos;
-
- eeprom_init();
-
- Wire.beginTransmission(I2C_ADDRESS(eeprom_device_address));
- Wire.write((int)(eeprom_address >> 8)); // MSB
- Wire.write((int)(eeprom_address & 0xFF)); // LSB
- Wire.endTransmission();
- Wire.requestFrom(eeprom_device_address, (byte)1);
- return Wire.available() ? Wire.read() : 0xFF;
-}
-
-// Don't read more than 30..32 bytes at a time!
-void eeprom_read_block(void* pos, const void* eeprom_address, size_t n) {
- eeprom_init();
-
- Wire.beginTransmission(I2C_ADDRESS(eeprom_device_address));
- Wire.write((int)((unsigned)eeprom_address >> 8)); // MSB
- Wire.write((int)((unsigned)eeprom_address & 0xFF)); // LSB
- Wire.endTransmission();
- Wire.requestFrom(eeprom_device_address, (byte)n);
- for (byte c = 0; c < n; c++ )
- if (Wire.available()) *((uint8_t*)pos + c) = Wire.read();
-}
-
-#endif // I2C_EEPROM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_if.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_if.h
new file mode 100644
index 00000000..e44da801
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_if.h
@@ -0,0 +1,29 @@
+/**
+ * Marlin 3D Printer Firmware
+ *
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
+ * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+//
+// EEPROM
+//
+void eeprom_init();
+void eeprom_write_byte(uint8_t *pos, unsigned char value);
+uint8_t eeprom_read_byte(uint8_t *pos);
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_if_i2c.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_if_i2c.cpp
new file mode 100644
index 00000000..cc22bf7d
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_if_i2c.cpp
@@ -0,0 +1,78 @@
+/**
+ * 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 .
+ *
+ */
+
+/**
+ * Platform-independent Arduino functions for I2C EEPROM.
+ * Enable USE_SHARED_EEPROM if not supplied by the framework.
+ */
+
+#include "../../inc/MarlinConfig.h"
+
+#if ENABLED(I2C_EEPROM)
+
+#include "eeprom_if.h"
+#include
+
+void eeprom_init() { Wire.begin(); }
+
+#if ENABLED(USE_SHARED_EEPROM)
+
+#ifndef EEPROM_WRITE_DELAY
+ #define EEPROM_WRITE_DELAY 5
+#endif
+#ifndef EEPROM_DEVICE_ADDRESS
+ #define EEPROM_DEVICE_ADDRESS 0x50
+#endif
+
+static constexpr uint8_t eeprom_device_address = I2C_ADDRESS(EEPROM_DEVICE_ADDRESS);
+
+// ------------------------
+// Public functions
+// ------------------------
+
+void eeprom_write_byte(uint8_t *pos, unsigned char value) {
+ const unsigned eeprom_address = (unsigned)pos;
+
+ Wire.beginTransmission(eeprom_device_address);
+ Wire.write(int(eeprom_address >> 8)); // MSB
+ Wire.write(int(eeprom_address & 0xFF)); // LSB
+ Wire.write(value);
+ Wire.endTransmission();
+
+ // wait for write cycle to complete
+ // this could be done more efficiently with "acknowledge polling"
+ delay(EEPROM_WRITE_DELAY);
+}
+
+uint8_t eeprom_read_byte(uint8_t *pos) {
+ const unsigned eeprom_address = (unsigned)pos;
+
+ Wire.beginTransmission(eeprom_device_address);
+ Wire.write(int(eeprom_address >> 8)); // MSB
+ Wire.write(int(eeprom_address & 0xFF)); // LSB
+ Wire.endTransmission();
+ Wire.requestFrom(eeprom_device_address, (byte)1);
+ return Wire.available() ? Wire.read() : 0xFF;
+}
+
+#endif // USE_SHARED_EEPROM
+#endif // I2C_EEPROM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_spi.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_if_spi.cpp
similarity index 55%
rename from firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_spi.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_if_spi.cpp
index 35e7d9b0..a341fef9 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_spi.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/eeprom_if_spi.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,25 +16,33 @@
* 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 .
+ * along with this program. If not, see .
*
*/
/**
- * Description: functions for SPI connected external EEPROM.
- * Not platform dependent.
+ * Platform-independent Arduino functions for SPI EEPROM.
+ * Enable USE_SHARED_EEPROM if not supplied by the framework.
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(SPI_EEPROM)
-#include "../HAL.h"
+#include "eeprom_if.h"
+
+void eeprom_init() {}
+
+#if ENABLED(USE_SHARED_EEPROM)
#define CMD_WREN 6 // WREN
#define CMD_READ 2 // WRITE
#define CMD_WRITE 2 // WRITE
+#ifndef EEPROM_WRITE_DELAY
+ #define EEPROM_WRITE_DELAY 7
+#endif
+
uint8_t eeprom_read_byte(uint8_t* pos) {
uint8_t v;
uint8_t eeprom_temp[3];
@@ -53,24 +61,6 @@ uint8_t eeprom_read_byte(uint8_t* pos) {
return v;
}
-void eeprom_read_block(void* dest, const void* eeprom_address, size_t n) {
- uint8_t eeprom_temp[3];
-
- // set read location
- // begin transmission from device
- eeprom_temp[0] = CMD_READ;
- eeprom_temp[1] = ((unsigned)eeprom_address>>8) & 0xFF; // addr High
- eeprom_temp[2] = (unsigned)eeprom_address& 0xFF; // addr Low
- WRITE(SPI_EEPROM1_CS, HIGH);
- WRITE(SPI_EEPROM1_CS, LOW);
- spiSend(SPI_CHAN_EEPROM1, eeprom_temp, 3);
-
- uint8_t *p_dest = (uint8_t *)dest;
- while (n--)
- *p_dest++ = spiRec(SPI_CHAN_EEPROM1);
- WRITE(SPI_EEPROM1_CS, HIGH);
-}
-
void eeprom_write_byte(uint8_t* pos, uint8_t value) {
uint8_t eeprom_temp[3];
@@ -90,29 +80,8 @@ void eeprom_write_byte(uint8_t* pos, uint8_t value) {
spiSend(SPI_CHAN_EEPROM1, value);
WRITE(SPI_EEPROM1_CS, HIGH);
- delay(7); // wait for page write to complete
-}
-
-void eeprom_update_block(const void* src, void* eeprom_address, size_t n) {
- uint8_t eeprom_temp[3];
-
- /*write enable*/
- eeprom_temp[0] = CMD_WREN;
- WRITE(SPI_EEPROM1_CS, LOW);
- spiSend(SPI_CHAN_EEPROM1, eeprom_temp, 1);
- WRITE(SPI_EEPROM1_CS, HIGH);
- delay(1);
-
- /*write addr*/
- eeprom_temp[0] = CMD_WRITE;
- eeprom_temp[1] = ((unsigned)eeprom_address>>8) & 0xFF; //addr High
- eeprom_temp[2] = (unsigned)eeprom_address & 0xFF; //addr Low
- WRITE(SPI_EEPROM1_CS, LOW);
- spiSend(SPI_CHAN_EEPROM1, eeprom_temp, 3);
-
- spiSend(SPI_CHAN_EEPROM1, (const uint8_t*)src, n);
- WRITE(SPI_EEPROM1_CS, HIGH);
- delay(7); // wait for page write to complete
+ delay(EEPROM_WRITE_DELAY); // wait for page write to complete
}
-#endif // SPI_EEPROM
+#endif // USE_SHARED_EEPROM
+#endif // I2C_EEPROM
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/esp_wifi.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/esp_wifi.cpp
new file mode 100644
index 00000000..a55f5ca3
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/esp_wifi.cpp
@@ -0,0 +1,43 @@
+/**
+ * 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 .
+ *
+ */
+
+#include "../../inc/MarlinConfig.h"
+#include "Delay.h"
+
+void esp_wifi_init(void) { // init ESP01 WIFI module pins
+ #if PIN_EXISTS(ESP_WIFI_MODULE_GPIO0)
+ OUT_WRITE(ESP_WIFI_MODULE_GPIO0_PIN, HIGH);
+ #endif
+ #if PIN_EXISTS(ESP_WIFI_MODULE_GPIO2)
+ OUT_WRITE(ESP_WIFI_MODULE_GPIO2_PIN, HIGH);
+ #endif
+ #if PIN_EXISTS(ESP_WIFI_MODULE_RESET)
+ delay(1); // power up delay (0.1mS minimum)
+ OUT_WRITE(ESP_WIFI_MODULE_RESET_PIN, LOW);
+ delay(1);
+ OUT_WRITE(ESP_WIFI_MODULE_RESET_PIN, HIGH);
+ #endif
+ #if PIN_EXISTS(ESP_WIFI_MODULE_ENABLE)
+ delay(1); // delay after reset released (0.1mS minimum)
+ OUT_WRITE(ESP_WIFI_MODULE_ENABLE_PIN, HIGH);
+ #endif
+}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/esp_wifi.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/esp_wifi.h
new file mode 100644
index 00000000..84a50a94
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/esp_wifi.h
@@ -0,0 +1,24 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+void esp_wifi_init();
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/math_32bit.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/math_32bit.h
index a69992a6..87e9e640 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/math_32bit.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/math_32bit.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/servo.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/servo.cpp
index b5975e58..d69cf2fe 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/servo.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/servo.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -68,7 +68,7 @@ uint8_t ServoCount = 0; // the total number of attached
static boolean isTimerActive(timer16_Sequence_t timer) {
// returns true if any servo is active on this timer
- for (uint8_t channel = 0; channel < SERVOS_PER_TIMER; channel++) {
+ LOOP_L_N(channel, SERVOS_PER_TIMER) {
if (SERVO(timer, channel).Pin.isActive)
return true;
}
@@ -129,9 +129,9 @@ void Servo::writeMicroseconds(int value) {
value = constrain(value, SERVO_MIN(min), SERVO_MAX(max)) - (TRIM_DURATION);
value = usToTicks(value); // convert to ticks after compensating for interrupt overhead - 12 Aug 2009
- CRITICAL_SECTION_START;
+ CRITICAL_SECTION_START();
servo_info[channel].ticks = value;
- CRITICAL_SECTION_END;
+ CRITICAL_SECTION_END();
}
}
@@ -150,9 +150,7 @@ void Servo::move(const int value) {
if (attach(0) >= 0) {
write(value);
safe_delay(servo_delay[servoIndex]);
- #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
- detach();
- #endif
+ TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
}
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/servo.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/servo.h
index e4905b72..f9c47841 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/servo.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/servo.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -68,19 +68,19 @@
*/
#if IS_TEENSY32
- #include "../HAL_TEENSY31_32/Servo.h"
+ #include "../TEENSY31_32/Servo.h"
#elif IS_TEENSY35 || IS_TEENSY36
- #include "../HAL_TEENSY35_36/Servo.h"
+ #include "../TEENSY35_36/Servo.h"
#elif defined(TARGET_LPC1768)
- #include "../HAL_LPC1768/Servo.h"
+ #include "../LPC1768/Servo.h"
#elif defined(__STM32F1__) || defined(TARGET_STM32F1)
- #include "../HAL_STM32F1/Servo.h"
+ #include "../STM32F1/Servo.h"
#elif defined(STM32GENERIC) && defined(STM32F4)
- #include "../HAL_STM32_F4_F7/Servo.h"
+ #include "../STM32_F4_F7/Servo.h"
#elif defined(ARDUINO_ARCH_STM32)
- #include "../HAL_STM32/Servo.h"
+ #include "../STM32/Servo.h"
#elif defined(ARDUINO_ARCH_ESP32)
- #include "../HAL_ESP32/Servo.h"
+ #include "../ESP32/Servo.h"
#else
#include
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/servo_private.h b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/servo_private.h
index 1d4cdc7e..d85d8da8 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/servo_private.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/HAL/shared/servo_private.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -44,11 +44,11 @@
// Architecture specific include
#ifdef __AVR__
- #include "../HAL_AVR/ServoTimers.h"
+ #include "../AVR/ServoTimers.h"
#elif defined(ARDUINO_ARCH_SAM)
- #include "../HAL_DUE/ServoTimers.h"
+ #include "../DUE/ServoTimers.h"
#elif defined(__SAMD51__)
- #include "../HAL_SAMD51/ServoTimers.h"
+ #include "../SAMD51/ServoTimers.h"
#else
#error "This library only supports boards with an AVR, SAM3X or SAMD51 processor."
#endif
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/Marlin.h b/firmware/marlin2.0 for Ender3/Marlin/src/Marlin.h
deleted file mode 100644
index 8b44298a..00000000
--- a/firmware/marlin2.0 for Ender3/Marlin/src/Marlin.h
+++ /dev/null
@@ -1,381 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
-
-#include "inc/MarlinConfig.h"
-
-#ifdef DEBUG_GCODE_PARSER
- #include "gcode/parser.h"
-#endif
-
-#include
-#include
-#include
-
-#if HAS_DRIVER(L6470)
- #include "libs/L6470/L6470_Marlin.h"
- extern uint8_t axis_known_position;
-#endif
-
-void stop();
-
-void idle(
- #if ENABLED(ADVANCED_PAUSE_FEATURE)
- bool no_stepper_sleep = false // pass true to keep steppers from disabling on timeout
- #endif
-);
-
-void manage_inactivity(const bool ignore_stepper_queue=false);
-
-//
-// X, Y, Z Stepper enable / disable
-//
-#if AXIS_DRIVER_TYPE_X(L6470)
- extern L6470 stepperX;
- #define X_enable() NOOP
- #define X_disable() stepperX.free()
-#elif HAS_X_ENABLE
- #define X_enable() X_ENABLE_WRITE( X_ENABLE_ON)
- #define X_disable() X_ENABLE_WRITE(!X_ENABLE_ON)
-#else
- #define X_enable() NOOP
- #define X_disable() NOOP
-#endif
-
-#if AXIS_DRIVER_TYPE_X2(L6470)
- extern L6470 stepperX2;
- #define X2_enable() NOOP
- #define X2_disable() stepperX2.free()
-#elif HAS_X2_ENABLE
- #define X2_enable() X2_ENABLE_WRITE( X_ENABLE_ON)
- #define X2_disable() X2_ENABLE_WRITE(!X_ENABLE_ON)
-#else
- #define X2_enable() NOOP
- #define X2_disable() NOOP
-#endif
-
-#define enable_X() do{ X_enable(); X2_enable(); }while(0)
-#define disable_X() do{ X_disable(); X2_disable(); CBI(axis_known_position, X_AXIS); }while(0)
-
-#if AXIS_DRIVER_TYPE_Y(L6470)
- extern L6470 stepperY;
- #define Y_enable() NOOP
- #define Y_disable() stepperY.free()
-#elif HAS_Y_ENABLE
- #define Y_enable() Y_ENABLE_WRITE( Y_ENABLE_ON)
- #define Y_disable() Y_ENABLE_WRITE(!Y_ENABLE_ON)
-#else
- #define Y_enable() NOOP
- #define Y_disable() NOOP
-#endif
-
-#if AXIS_DRIVER_TYPE_Y2(L6470)
- extern L6470 stepperY2;
- #define Y2_enable() NOOP
- #define Y2_disable() stepperY2.free()
-#elif HAS_Y2_ENABLE
- #define Y2_enable() Y2_ENABLE_WRITE( Y_ENABLE_ON)
- #define Y2_disable() Y2_ENABLE_WRITE(!Y_ENABLE_ON)
-#else
- #define Y2_enable() NOOP
- #define Y2_disable() NOOP
-#endif
-
-#define enable_Y() do{ Y_enable(); Y2_enable(); }while(0)
-#define disable_Y() do{ Y_disable(); Y2_disable(); CBI(axis_known_position, Y_AXIS); }while(0)
-
-#if AXIS_DRIVER_TYPE_Z(L6470)
- extern L6470 stepperZ;
- #define Z_enable() NOOP
- #define Z_disable() stepperZ.free()
-#elif HAS_Z_ENABLE
- #define Z_enable() Z_ENABLE_WRITE( Z_ENABLE_ON)
- #define Z_disable() Z_ENABLE_WRITE(!Z_ENABLE_ON)
-#else
- #define Z_enable() NOOP
- #define Z_disable() NOOP
-#endif
-
-#if AXIS_DRIVER_TYPE_Z2(L6470)
- extern L6470 stepperZ2;
- #define Z2_enable() NOOP
- #define Z2_disable() stepperZ2.free()
-#elif HAS_Z2_ENABLE
- #define Z2_enable() Z2_ENABLE_WRITE( Z_ENABLE_ON)
- #define Z2_disable() Z2_ENABLE_WRITE(!Z_ENABLE_ON)
-#else
- #define Z2_enable() NOOP
- #define Z2_disable() NOOP
-#endif
-
-#if AXIS_DRIVER_TYPE_Z3(L6470)
- extern L6470 stepperZ3;
- #define Z3_enable() NOOP
- #define Z3_disable() stepperZ3.free()
-#elif HAS_Z3_ENABLE
- #define Z3_enable() Z3_ENABLE_WRITE( Z_ENABLE_ON)
- #define Z3_disable() Z3_ENABLE_WRITE(!Z_ENABLE_ON)
-#else
- #define Z3_enable() NOOP
- #define Z3_disable() NOOP
-#endif
-
-#define enable_Z() do{ Z_enable(); Z2_enable(); Z3_enable(); }while(0)
-#define disable_Z() do{ Z_disable(); Z2_disable(); Z3_disable(); CBI(axis_known_position, Z_AXIS); }while(0)
-
-//
-// Extruder Stepper enable / disable
-//
-
-// define the individual enables/disables
-#if AXIS_DRIVER_TYPE_E0(L6470)
- extern L6470 stepperE0;
- #define E0_enable() NOOP
- #define E0_disable() do{ stepperE0.free(); CBI(axis_known_position, E_AXIS); }while(0)
-#elif HAS_E0_ENABLE
- #define E0_enable() E0_ENABLE_WRITE( E_ENABLE_ON)
- #define E0_disable() E0_ENABLE_WRITE(!E_ENABLE_ON)
-#else
- #define E0_enable() NOOP
- #define E0_disable() NOOP
-#endif
-
-#if AXIS_DRIVER_TYPE_E1(L6470)
- extern L6470 stepperE1;
- #define E1_enable() NOOP
- #define E1_disable() do{ stepperE1.free(); CBI(axis_known_position, E_AXIS); }while(0)
-#elif E_STEPPERS > 1 && HAS_E1_ENABLE
- #define E1_enable() E1_ENABLE_WRITE( E_ENABLE_ON)
- #define E1_disable() E1_ENABLE_WRITE(!E_ENABLE_ON)
-#else
- #define E1_enable() NOOP
- #define E1_disable() NOOP
-#endif
-
-#if AXIS_DRIVER_TYPE_E2(L6470)
- extern L6470 stepperE2;
- #define E2_enable() NOOP
- #define E2_disable() do{ stepperE2.free(); CBI(axis_known_position, E_AXIS); }while(0)
-#elif E_STEPPERS > 2 && HAS_E2_ENABLE
- #define E2_enable() E2_ENABLE_WRITE( E_ENABLE_ON)
- #define E2_disable() E2_ENABLE_WRITE(!E_ENABLE_ON)
-#else
- #define E2_enable() NOOP
- #define E2_disable() NOOP
-#endif
-
-#if AXIS_DRIVER_TYPE_E3(L6470)
- extern L6470 stepperE3;
- #define E3_enable() NOOP
- #define E3_disable() do{ stepperE3.free(); CBI(axis_known_position, E_AXIS); }while(0)
-#elif E_STEPPERS > 3 && HAS_E3_ENABLE
- #define E3_enable() E3_ENABLE_WRITE( E_ENABLE_ON)
- #define E3_disable() E3_ENABLE_WRITE(!E_ENABLE_ON)
-#else
- #define E3_enable() NOOP
- #define E3_disable() NOOP
-#endif
-
-#if AXIS_DRIVER_TYPE_E4(L6470)
- extern L6470 stepperE4;
- #define E4_enable() NOOP
- #define E4_disable() do{ stepperE4.free(); CBI(axis_known_position, E_AXIS); }while(0)
-#elif E_STEPPERS > 4 && HAS_E4_ENABLE
- #define E4_enable() E4_ENABLE_WRITE( E_ENABLE_ON)
- #define E4_disable() E4_ENABLE_WRITE(!E_ENABLE_ON)
-#else
- #define E4_enable() NOOP
- #define E4_disable() NOOP
-#endif
-
-#if AXIS_DRIVER_TYPE_E5(L6470)
- extern L6470 stepperE5;
- #define E5_enable() NOOP
- #define E5_disable() do{ stepperE5.free(); CBI(axis_known_position, E_AXIS); }while(0)
-#elif E_STEPPERS > 5 && HAS_E5_ENABLE
- #define E5_enable() E5_ENABLE_WRITE( E_ENABLE_ON)
- #define E5_disable() E5_ENABLE_WRITE(!E_ENABLE_ON)
-#else
- #define E5_enable() NOOP
- #define E5_disable() NOOP
-#endif
-
-#if ENABLED(MIXING_EXTRUDER)
-
- /**
- * Mixing steppers synchronize their enable (and direction) together
- */
- #if MIXING_STEPPERS > 5
- #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); E5_enable(); }
- #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); }
- #elif MIXING_STEPPERS > 4
- #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); }
- #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); }
- #elif MIXING_STEPPERS > 3
- #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); }
- #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); }
- #elif MIXING_STEPPERS > 2
- #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); }
- #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); }
- #else
- #define enable_E0() { E0_enable(); E1_enable(); }
- #define disable_E0() { E0_disable(); E1_disable(); }
- #endif
- #define enable_E1() NOOP
- #define disable_E1() NOOP
- #define enable_E2() NOOP
- #define disable_E2() NOOP
- #define enable_E3() NOOP
- #define disable_E3() NOOP
- #define enable_E4() NOOP
- #define disable_E4() NOOP
- #define enable_E5() NOOP
- #define disable_E5() NOOP
-
-#else // !MIXING_EXTRUDER
-
- #if HAS_E0_ENABLE
- #define enable_E0() E0_enable()
- #define disable_E0() E0_disable()
- #else
- #define enable_E0() NOOP
- #define disable_E0() NOOP
- #endif
-
- #if E_STEPPERS > 1 && HAS_E1_ENABLE
- #define enable_E1() E1_enable()
- #define disable_E1() E1_disable()
- #else
- #define enable_E1() NOOP
- #define disable_E1() NOOP
- #endif
-
- #if E_STEPPERS > 2 && HAS_E2_ENABLE
- #define enable_E2() E2_enable()
- #define disable_E2() E2_disable()
- #else
- #define enable_E2() NOOP
- #define disable_E2() NOOP
- #endif
-
- #if E_STEPPERS > 3 && HAS_E3_ENABLE
- #define enable_E3() E3_enable()
- #define disable_E3() E3_disable()
- #else
- #define enable_E3() NOOP
- #define disable_E3() NOOP
- #endif
-
- #if E_STEPPERS > 4 && HAS_E4_ENABLE
- #define enable_E4() E4_enable()
- #define disable_E4() E4_disable()
- #else
- #define enable_E4() NOOP
- #define disable_E4() NOOP
- #endif
-
- #if E_STEPPERS > 5 && HAS_E5_ENABLE
- #define enable_E5() E5_enable()
- #define disable_E5() E5_disable()
- #else
- #define enable_E5() NOOP
- #define disable_E5() NOOP
- #endif
-
-#endif // !MIXING_EXTRUDER
-
-#if ENABLED(EXPERIMENTAL_I2CBUS)
- #include "feature/twibus.h"
- extern TWIBus i2c;
-#endif
-
-#if ENABLED(G38_PROBE_TARGET)
- extern uint8_t G38_move; // Flag to tell the ISR that G38 is in progress, and the type
- extern bool G38_did_trigger; // Flag from the ISR to indicate the endstop changed
-#endif
-
-/**
- * The axis order in all axis related arrays is X, Y, Z, E
- */
-void enable_e_steppers();
-void enable_all_steppers();
-void disable_e_stepper(const uint8_t e);
-void disable_e_steppers();
-void disable_all_steppers();
-
-void kill(PGM_P const lcd_error=nullptr, PGM_P const lcd_component=nullptr, const bool steppers_off=false);
-void minkill(const bool steppers_off=false);
-
-void quickstop_stepper();
-
-extern bool Running;
-inline bool IsRunning() { return Running; }
-inline bool IsStopped() { return !Running; }
-
-bool printingIsActive();
-bool printingIsPaused();
-void startOrResumeJob();
-
-extern bool wait_for_heatup;
-
-#if HAS_RESUME_CONTINUE
- extern bool wait_for_user;
-#endif
-
-#if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE)
- extern bool suspend_auto_report;
-#endif
-
-// Inactivity shutdown timer
-extern millis_t max_inactive_time, stepper_inactive_time;
-
-#if ENABLED(USE_CONTROLLER_FAN)
- extern uint8_t controllerfan_speed;
-#endif
-
-#if ENABLED(PSU_CONTROL)
- extern bool powersupply_on;
- #define PSU_PIN_ON() do{ OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_HIGH); powersupply_on = true; }while(0)
- #define PSU_PIN_OFF() do{ OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_HIGH); powersupply_on = false; }while(0)
- #if ENABLED(AUTO_POWER_CONTROL)
- #define PSU_ON() powerManager.power_on()
- #define PSU_OFF() powerManager.power_off()
- #else
- #define PSU_ON() PSU_PIN_ON()
- #define PSU_OFF() PSU_PIN_OFF()
- #endif
-#endif
-
-bool pin_is_protected(const pin_t pin);
-void protected_pin_err();
-
-#if HAS_SUICIDE
- inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_INVERTING); }
-#endif
-
-#if ENABLED(G29_RETRY_AND_RECOVER)
- void event_probe_recover();
- void event_probe_failure();
-#endif
-
-extern const char NUL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[],
- SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[];
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/Marlin.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/MarlinCore.cpp
similarity index 55%
rename from firmware/marlin2.0 for Ender3/Marlin/src/Marlin.cpp
rename to firmware/marlin2.0 for Ender3/Marlin/src/MarlinCore.cpp
index 8da8eb8d..00ea51b0 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/Marlin.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/MarlinCore.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -28,7 +28,15 @@
* - https://github.com/grbl/grbl
*/
-#include "Marlin.h"
+#include "MarlinCore.h"
+
+#include "HAL/shared/Delay.h"
+#include "HAL/shared/esp_wifi.h"
+
+#ifdef ARDUINO
+ #include
+#endif
+#include
#include "core/utility.h"
#include "lcd/ultralcd.h"
@@ -43,20 +51,35 @@
#include "module/printcounter.h" // PrintCounter or Stopwatch
#include "feature/closedloop.h"
-#include "HAL/shared/Delay.h"
-
#include "module/stepper/indirection.h"
-#ifdef ARDUINO
- #include
-#endif
-#include
#include "libs/nozzle.h"
#include "gcode/gcode.h"
#include "gcode/parser.h"
#include "gcode/queue.h"
+#if HAS_TFT_LVGL_UI
+ #include "lcd/extui/lib/mks_ui/tft_lvgl_configuration.h"
+ #include "lcd/extui/lib/mks_ui/draw_ui.h"
+ #include "lcd/extui/lib/mks_ui/mks_hardware_test.h"
+ #include
+#endif
+
+#if ENABLED(DWIN_CREALITY_LCD)
+ #include "lcd/dwin/dwin.h"
+ #include "lcd/dwin/dwin_lcd.h"
+ #include "lcd/dwin/rotary_encoder.h"
+#endif
+
+#if ENABLED(IIC_BL24CXX_EEPROM)
+ #include "libs/BL24CXX.h"
+#endif
+
+#if ENABLED(DIRECT_STEPPING)
+ #include "feature/direct_stepping.h"
+#endif
+
#if ENABLED(TOUCH_BUTTONS)
#include "feature/touch/xpt2046.h"
#endif
@@ -69,7 +92,7 @@
#include "libs/buzzer.h"
#endif
-#if ENABLED(DIGIPOT_I2C)
+#if HAS_I2C_DIGIPOT
#include "feature/digipot/digipot.h"
#endif
@@ -78,7 +101,7 @@
#endif
#if ENABLED(MAX7219_DEBUG)
- #include "feature/Max7219_Debug_LEDs.h"
+ #include "feature/max7219.h"
#endif
#if HAS_COLOR_LEDS
@@ -107,10 +130,10 @@
#endif
#if ENABLED(I2C_POSITION_ENCODERS)
- #include "feature/I2CPositionEncoder.h"
+ #include "feature/encoder_i2c.h"
#endif
-#if HAS_TRINAMIC && DISABLED(PSU_DEFAULT_OFF)
+#if HAS_TRINAMIC_CONFIG && DISABLED(PSU_DEFAULT_OFF)
#include "feature/tmc_util.h"
#endif
@@ -142,7 +165,7 @@
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
- #include "feature/power_loss_recovery.h"
+ #include "feature/powerloss.h"
#endif
#if ENABLED(CANCEL_OBJECTS)
@@ -153,6 +176,10 @@
#include "feature/runout.h"
#endif
+#if ENABLED(HOTEND_IDLE_TIMEOUT)
+ #include "feature/hotend_idle.h"
+#endif
+
#if ENABLED(TEMP_STAT_LEDS)
#include "feature/leds/tempstat.h"
#endif
@@ -165,7 +192,7 @@
#include "feature/fanmux.h"
#endif
-#if DO_SWITCH_EXTRUDER || ANY(SWITCHING_NOZZLE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
+#if DO_SWITCH_EXTRUDER || ANY(SWITCHING_NOZZLE, PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER, ELECTROMAGNETIC_SWITCHING_TOOLHEAD, SWITCHING_TOOLHEAD)
#include "module/tool_change.h"
#endif
@@ -174,24 +201,27 @@
#endif
#if ENABLED(PRUSA_MMU2)
- #include "feature/prusa_MMU2/mmu2.h"
+ #include "feature/mmu2/mmu2.h"
#endif
-#if HAS_DRIVER(L6470)
- #include "libs/L6470/L6470_Marlin.h"
+#if HAS_L64XX
+ #include "libs/L64XX/L64XX_Marlin.h"
#endif
-const char NUL_STR[] PROGMEM = "",
- G28_STR[] PROGMEM = "G28",
- M21_STR[] PROGMEM = "M21",
- M23_STR[] PROGMEM = "M23 %s",
- M24_STR[] PROGMEM = "M24",
- SP_X_STR[] PROGMEM = " X",
- SP_Y_STR[] PROGMEM = " Y",
- SP_Z_STR[] PROGMEM = " Z",
- SP_E_STR[] PROGMEM = " E";
-
-bool Running = true;
+PGMSTR(NUL_STR, "");
+PGMSTR(M112_KILL_STR, "M112 Shutdown");
+PGMSTR(G28_STR, "G28");
+PGMSTR(M21_STR, "M21");
+PGMSTR(M23_STR, "M23 %s");
+PGMSTR(M24_STR, "M24");
+PGMSTR(SP_P_STR, " P"); PGMSTR(SP_T_STR, " T");
+PGMSTR(X_STR, "X"); PGMSTR(Y_STR, "Y"); PGMSTR(Z_STR, "Z"); PGMSTR(E_STR, "E");
+PGMSTR(X_LBL, "X:"); PGMSTR(Y_LBL, "Y:"); PGMSTR(Z_LBL, "Z:"); PGMSTR(E_LBL, "E:");
+PGMSTR(SP_A_STR, " A"); PGMSTR(SP_B_STR, " B"); PGMSTR(SP_C_STR, " C");
+PGMSTR(SP_X_STR, " X"); PGMSTR(SP_Y_STR, " Y"); PGMSTR(SP_Z_STR, " Z"); PGMSTR(SP_E_STR, " E");
+PGMSTR(SP_X_LBL, " X:"); PGMSTR(SP_Y_LBL, " Y:"); PGMSTR(SP_Z_LBL, " Z:"); PGMSTR(SP_E_LBL, " E:");
+
+MarlinState marlin_state = MF_INITIALIZING;
// For M109 and M190, this flag may be cleared (by M108) to exit the wait loop
bool wait_for_heatup = true;
@@ -199,15 +229,18 @@ bool wait_for_heatup = true;
// For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop
#if HAS_RESUME_CONTINUE
bool wait_for_user; // = false;
-#endif
-#if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE)
- bool suspend_auto_report; // = false
-#endif
+ void wait_for_user_response(millis_t ms/*=0*/, const bool no_sleep/*=false*/) {
+ TERN(ADVANCED_PAUSE_FEATURE,,UNUSED(no_sleep));
+ KEEPALIVE_STATE(PAUSED_FOR_USER);
+ wait_for_user = true;
+ if (ms) ms += millis(); // expire time
+ while (wait_for_user && !(ms && ELAPSED(millis(), ms)))
+ idle(TERN_(ADVANCED_PAUSE_FEATURE, no_sleep));
+ wait_for_user = false;
+ }
-// Inactivity shutdown
-millis_t max_inactive_time, // = 0
- stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL;
+#endif
#if PIN_EXISTS(CHDK)
extern millis_t chdk_timeout;
@@ -225,7 +258,11 @@ millis_t max_inactive_time, // = 0
void setup_killpin() {
#if HAS_KILL
- SET_INPUT_PULLUP(KILL_PIN);
+ #if KILL_PIN_STATE
+ SET_INPUT_PULLDOWN(KILL_PIN);
+ #else
+ SET_INPUT_PULLUP(KILL_PIN);
+ #endif
#endif
}
@@ -234,11 +271,8 @@ void setup_powerhold() {
OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_INVERTING);
#endif
#if ENABLED(PSU_CONTROL)
- #if ENABLED(PSU_DEFAULT_OFF)
- powersupply_on = true; PSU_OFF();
- #else
- powersupply_on = false; PSU_ON();
- #endif
+ powersupply_on = ENABLED(PSU_DEFAULT_OFF);
+ if (ENABLED(PSU_DEFAULT_OFF)) PSU_OFF(); else PSU_ON();
#endif
}
@@ -268,9 +302,12 @@ void setup_powerhold() {
#include "pins/sensitive_pins.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wnarrowing"
+
bool pin_is_protected(const pin_t pin) {
static const pin_t sensitive_pins[] PROGMEM = SENSITIVE_PINS;
- for (uint8_t i = 0; i < COUNT(sensitive_pins); i++) {
+ LOOP_L_N(i, COUNT(sensitive_pins)) {
pin_t sensitive_pin;
memcpy_P(&sensitive_pin, &sensitive_pins[i], sizeof(pin_t));
if (pin == sensitive_pin) return true;
@@ -278,8 +315,10 @@ bool pin_is_protected(const pin_t pin) {
return false;
}
+#pragma GCC diagnostic pop
+
void protected_pin_err() {
- SERIAL_ERROR_MSG(MSG_ERR_PROTECTED_PIN);
+ SERIAL_ERROR_MSG(STR_ERR_PROTECTED_PIN);
}
void quickstop_stepper() {
@@ -290,36 +329,34 @@ void quickstop_stepper() {
}
void enable_e_steppers() {
- #define _ENA_E(N) enable_E##N();
+ #define _ENA_E(N) ENABLE_AXIS_E##N();
REPEAT(E_STEPPERS, _ENA_E)
}
void enable_all_steppers() {
- #if ENABLED(AUTO_POWER_CONTROL)
- powerManager.power_on();
- #endif
- enable_X();
- enable_Y();
- enable_Z();
+ TERN_(AUTO_POWER_CONTROL, powerManager.power_on());
+ ENABLE_AXIS_X();
+ ENABLE_AXIS_Y();
+ ENABLE_AXIS_Z();
enable_e_steppers();
}
void disable_e_steppers() {
- #define _DIS_E(N) disable_E##N();
+ #define _DIS_E(N) DISABLE_AXIS_E##N();
REPEAT(E_STEPPERS, _DIS_E)
}
void disable_e_stepper(const uint8_t e) {
- #define _CASE_DIS_E(N) case N: disable_E##N(); break;
+ #define _CASE_DIS_E(N) case N: DISABLE_AXIS_E##N(); break;
switch (e) {
REPEAT(EXTRUDERS, _CASE_DIS_E)
}
}
void disable_all_steppers() {
- disable_X();
- disable_Y();
- disable_Z();
+ DISABLE_AXIS_X();
+ DISABLE_AXIS_Y();
+ DISABLE_AXIS_Z();
disable_e_steppers();
}
@@ -341,9 +378,7 @@ void disable_all_steppers() {
}
void event_probe_recover() {
- #if ENABLED(HOST_PROMPT_SUPPORT)
- host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying"), PSTR("Dismiss"));
- #endif
+ TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying"), DISMISS_STR));
#ifdef ACTION_ON_G29_RECOVER
host_action(PSTR(ACTION_ON_G29_RECOVER));
#endif
@@ -360,6 +395,13 @@ void disable_all_steppers() {
constexpr bool did_pause_print = false;
#endif
+/**
+ * A Print Job exists when the timer is running or SD printing
+ */
+bool printJobOngoing() {
+ return print_job_timer.isRunning() || IS_SD_PRINTING();
+}
+
/**
* Printing is active when the print job timer is running
*/
@@ -376,12 +418,8 @@ bool printingIsPaused() {
void startOrResumeJob() {
if (!printingIsPaused()) {
- #if ENABLED(CANCEL_OBJECTS)
- cancelable.reset();
- #endif
- #if ENABLED(LCD_SHOW_E_TOTAL)
- e_move_accumulator = 0;
- #endif
+ TERN_(CANCEL_OBJECTS, cancelable.reset());
+ TERN_(LCD_SHOW_E_TOTAL, e_move_accumulator = 0);
#if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
ui.reset_remaining_time();
#endif
@@ -391,33 +429,35 @@ void startOrResumeJob() {
#if ENABLED(SDSUPPORT)
- void abortSDPrinting() {
- card.stopSDPrint(
- #if SD_RESORT
- true
- #endif
- );
+ inline void abortSDPrinting() {
+ card.endFilePrint(TERN_(SD_RESORT, true));
queue.clear();
quickstop_stepper();
print_job_timer.stop();
#if DISABLED(SD_ABORT_NO_COOLDOWN)
thermalManager.disable_all_heaters();
#endif
- thermalManager.zero_fan_speeds();
- wait_for_heatup = false;
- #if ENABLED(POWER_LOSS_RECOVERY)
- card.removeJobRecoveryFile();
+ #if !HAS_CUTTER
+ thermalManager.zero_fan_speeds();
+ #else
+ cutter.kill(); // Full cutter shutdown including ISR control
#endif
+ wait_for_heatup = false;
+ TERN_(POWER_LOSS_RECOVERY, recovery.purge());
#ifdef EVENT_GCODE_SD_STOP
queue.inject_P(PSTR(EVENT_GCODE_SD_STOP));
#endif
}
-#endif
+ inline void finishSDPrinting() {
+ if (queue.enqueue_one_P(PSTR("M1001")))
+ marlin_state = MF_RUNNING;
+ }
+
+#endif // SDSUPPORT
/**
- * Manage several activities:
- * - Check for Filament Runout
+ * Minimal management of Marlin's core activities:
* - Keep the command buffer full
* - Check for maximum inactive time between commands
* - Check for maximum inactive time between stepper commands
@@ -428,55 +468,46 @@ void startOrResumeJob() {
* - Check if an idle but hot extruder needs filament extruded (EXTRUDER_RUNOUT_PREVENT)
* - Pulse FET_SAFETY_PIN if it exists
*/
-
-void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
-
- #if HAS_FILAMENT_SENSOR
- runout.run();
- #endif
+inline void manage_inactivity(const bool ignore_stepper_queue=false) {
if (queue.length < BUFSIZE) queue.get_available_commands();
const millis_t ms = millis();
- if (max_inactive_time && ELAPSED(ms, gcode.previous_move_ms + max_inactive_time)) {
+ // Prevent steppers timing-out in the middle of M600
+ // unless PAUSE_PARK_NO_STEPPER_TIMEOUT is disabled
+ const bool parked_or_ignoring = ignore_stepper_queue ||
+ (BOTH(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_NO_STEPPER_TIMEOUT) && did_pause_print);
+
+ // Reset both the M18/M84 activity timeout and the M85 max 'kill' timeout
+ if (parked_or_ignoring) gcode.reset_stepper_timeout(ms);
+
+ if (gcode.stepper_max_timed_out(ms)) {
SERIAL_ERROR_START();
- SERIAL_ECHOLNPAIR(MSG_KILL_INACTIVE_TIME, parser.command_ptr);
+ SERIAL_ECHOLNPAIR(STR_KILL_INACTIVE_TIME, parser.command_ptr);
kill();
}
- // Prevent steppers timing-out in the middle of M600
- #if BOTH(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_NO_STEPPER_TIMEOUT)
- #define MOVE_AWAY_TEST !did_pause_print
- #else
- #define MOVE_AWAY_TEST true
- #endif
+ // M18 / M94 : Handle steppers inactive time timeout
+ if (gcode.stepper_inactive_time) {
- if (stepper_inactive_time) {
static bool already_shutdown_steppers; // = false
+
+ // Any moves in the planner? Resets both the M18/M84
+ // activity timeout and the M85 max 'kill' timeout
if (planner.has_blocks_queued())
- gcode.reset_stepper_timeout();
- else if (MOVE_AWAY_TEST && !ignore_stepper_queue && ELAPSED(ms, gcode.previous_move_ms + stepper_inactive_time)) {
+ gcode.reset_stepper_timeout(ms);
+ else if (!parked_or_ignoring && gcode.stepper_inactive_timeout()) {
if (!already_shutdown_steppers) {
already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this
- #if ENABLED(DISABLE_INACTIVE_X)
- disable_X();
- #endif
- #if ENABLED(DISABLE_INACTIVE_Y)
- disable_Y();
- #endif
- #if ENABLED(DISABLE_INACTIVE_Z)
- disable_Z();
- #endif
- #if ENABLED(DISABLE_INACTIVE_E)
- disable_e_steppers();
- #endif
- #if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL)
- if (ubl.lcd_map_control) {
- ubl.lcd_map_control = false;
- ui.defer_status_screen(false);
- }
- #endif
+
+ // Individual axes will be disabled if configured
+ if (ENABLED(DISABLE_INACTIVE_X)) DISABLE_AXIS_X();
+ if (ENABLED(DISABLE_INACTIVE_Y)) DISABLE_AXIS_Y();
+ if (ENABLED(DISABLE_INACTIVE_Z)) DISABLE_AXIS_Z();
+ if (ENABLED(DISABLE_INACTIVE_E)) disable_e_steppers();
+
+ TERN_(AUTO_BED_LEVELING_UBL, ubl.steppers_were_disabled());
}
}
else
@@ -497,9 +528,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
// -------------------------------------------------------------------------------
static int killCount = 0; // make the inactivity button a bit less responsive
const int KILL_DELAY = 750;
- if (!READ(KILL_PIN) && !KILL_PIN_INVERTING)
- killCount++;
- else if (READ(KILL_PIN) && KILL_PIN_INVERTING)
+ if (kill_state())
killCount++;
else if (killCount > 0)
killCount--;
@@ -508,7 +537,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
// KILL the machine
// ----------------------------------------------------------------
if (killCount >= KILL_DELAY) {
- SERIAL_ERROR_MSG(MSG_KILL_BUTTON);
+ SERIAL_ERROR_MSG(STR_KILL_BUTTON);
kill();
}
#endif
@@ -527,27 +556,28 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
}
#endif
- #if ENABLED(USE_CONTROLLER_FAN)
- controllerfan_update(); // Check if fan should be turned on to cool stepper drivers down
- #endif
+ TERN_(USE_CONTROLLER_FAN, controllerFan.update()); // Check if fan should be turned on to cool stepper drivers down
- #if ENABLED(AUTO_POWER_CONTROL)
- powerManager.check();
- #endif
+ TERN_(AUTO_POWER_CONTROL, powerManager.check());
+
+ TERN_(HOTEND_IDLE_TIMEOUT, hotend_idle.check());
#if ENABLED(EXTRUDER_RUNOUT_PREVENT)
if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP
- && ELAPSED(ms, gcode.previous_move_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL)
+ && ELAPSED(ms, gcode.previous_move_ms + SEC_TO_MS(EXTRUDER_RUNOUT_SECONDS))
&& !planner.has_blocks_queued()
) {
#if ENABLED(SWITCHING_EXTRUDER)
bool oldstatus;
switch (active_extruder) {
- default: oldstatus = E0_ENABLE_READ(); enable_E0(); break;
+ default: oldstatus = E0_ENABLE_READ(); ENABLE_AXIS_E0(); break;
#if E_STEPPERS > 1
- case 2: case 3: oldstatus = E1_ENABLE_READ(); enable_E1(); break;
+ case 2: case 3: oldstatus = E1_ENABLE_READ(); ENABLE_AXIS_E1(); break;
#if E_STEPPERS > 2
- case 4: case 5: oldstatus = E2_ENABLE_READ(); enable_E2(); break;
+ case 4: case 5: oldstatus = E2_ENABLE_READ(); ENABLE_AXIS_E2(); break;
+ #if E_STEPPERS > 3
+ case 6: case 7: oldstatus = E3_ENABLE_READ(); ENABLE_AXIS_E3(); break;
+ #endif // E_STEPPERS > 3
#endif // E_STEPPERS > 2
#endif // E_STEPPERS > 1
}
@@ -555,7 +585,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
bool oldstatus;
switch (active_extruder) {
default:
- #define _CASE_EN(N) case N: oldstatus = E##N##_ENABLE_READ(); enable_E##N(); break;
+ #define _CASE_EN(N) case N: oldstatus = E##N##_ENABLE_READ(); ENABLE_AXIS_E##N(); break;
REPEAT(E_STEPPERS, _CASE_EN);
}
#endif
@@ -584,7 +614,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
}
#endif // !SWITCHING_EXTRUDER
- gcode.reset_stepper_timeout();
+ gcode.reset_stepper_timeout(ms);
}
#endif // EXTRUDER_RUNOUT_PREVENT
@@ -594,21 +624,15 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
// travel moves have been received so enact them
delayed_move_time = 0xFFFFFFFFUL; // force moves to be done
destination = current_position;
- prepare_move_to_destination();
+ prepare_line_to_destination();
}
#endif
- #if ENABLED(TEMP_STAT_LEDS)
- handle_status_leds();
- #endif
+ TERN_(TEMP_STAT_LEDS, handle_status_leds());
- #if ENABLED(MONITOR_DRIVER_STATUS)
- monitor_tmc_drivers();
- #endif
+ TERN_(MONITOR_DRIVER_STATUS, monitor_tmc_drivers());
- #if ENABLED(MONITOR_L6470_DRIVER_STATUS)
- L6470.monitor_driver();
- #endif
+ TERN_(MONITOR_L6470_DRIVER_STATUS, L64xxManager.monitor_driver());
// Limit check_axes_activity frequency to 10Hz
static millis_t next_check_axes_ms = 0;
@@ -620,7 +644,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
#if PIN_EXISTS(FET_SAFETY)
static millis_t FET_next;
if (ELAPSED(ms, FET_next)) {
- FET_next = ms + FET_SAFETY_DELAY; // 2uS pulse every FET_SAFETY_DELAY mS
+ FET_next = ms + FET_SAFETY_DELAY; // 2µs pulse every FET_SAFETY_DELAY mS
OUT_WRITE(FET_SAFETY_PIN, !FET_SAFETY_INVERTED);
DELAY_US(2);
WRITE(FET_SAFETY_PIN, FET_SAFETY_INVERTED);
@@ -629,54 +653,81 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
}
/**
- * Standard idle routine keeps the machine alive
+ * Standard idle routine keeps the machine alive:
+ * - Core Marlin activities
+ * - Manage heaters (and Watchdog)
+ * - Max7219 heartbeat, animation, etc.
+ *
+ * Only after setup() is complete:
+ * - Handle filament runout sensors
+ * - Run HAL idle tasks
+ * - Handle Power-Loss Recovery
+ * - Run StallGuard endstop checks
+ * - Handle SD Card insert / remove
+ * - Handle USB Flash Drive insert / remove
+ * - Announce Host Keepalive state (if any)
+ * - Update the Print Job Timer state
+ * - Update the Beeper queue
+ * - Read Buttons and Update the LCD
+ * - Run i2c Position Encoders
+ * - Auto-report Temperatures / SD Status
+ * - Update the Prusa MMU2
+ * - Handle Joystick jogging
*/
-void idle(
- #if ENABLED(ADVANCED_PAUSE_FEATURE)
- bool no_stepper_sleep/*=false*/
+void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
+
+ // Core Marlin activities
+ manage_inactivity(TERN_(ADVANCED_PAUSE_FEATURE, no_stepper_sleep));
+
+ // Manage Heaters (and Watchdog)
+ thermalManager.manage_heater();
+
+ // Max7219 heartbeat, animation, etc
+ TERN_(MAX7219_DEBUG, max7219.idle_tasks());
+
+ // Return if setup() isn't completed
+ if (marlin_state == MF_INITIALIZING) return;
+
+ // Handle filament runout sensors
+ TERN_(HAS_FILAMENT_SENSOR, runout.run());
+
+ // Run HAL idle tasks
+ #ifdef HAL_IDLETASK
+ HAL_idletask();
#endif
-) {
+
+ // Handle Power-Loss Recovery
#if ENABLED(POWER_LOSS_RECOVERY) && PIN_EXISTS(POWER_LOSS)
- recovery.outage();
+ if (printJobOngoing()) recovery.outage();
#endif
+ // Run StallGuard endstop checks
#if ENABLED(SPI_ENDSTOPS)
if (endstops.tmc_spi_homing.any
- #if ENABLED(IMPROVE_HOMING_RELIABILITY)
- && ELAPSED(millis(), sg_guard_period)
- #endif
- ) {
- for (uint8_t i = 4; i--;) // Read SGT 4 times per idle loop
+ && TERN1(IMPROVE_HOMING_RELIABILITY, ELAPSED(millis(), sg_guard_period))
+ ) LOOP_L_N(i, 4) // Read SGT 4 times per idle loop
if (endstops.tmc_spi_homing_check()) break;
- }
#endif
- #if ENABLED(MAX7219_DEBUG)
- max7219.idle_tasks();
- #endif
+ // Handle SD Card insert / remove
+ TERN_(SDSUPPORT, card.manage_media());
- ui.update();
+ // Handle USB Flash Drive insert / remove
+ TERN_(USB_FLASH_DRIVE_SUPPORT, Sd2Card::idle());
- #if ENABLED(HOST_KEEPALIVE_FEATURE)
- gcode.host_keepalive();
- #endif
+ // Announce Host Keepalive state (if any)
+ TERN_(HOST_KEEPALIVE_FEATURE, gcode.host_keepalive());
- manage_inactivity(
- #if ENABLED(ADVANCED_PAUSE_FEATURE)
- no_stepper_sleep
- #endif
- );
+ // Update the Print Job Timer state
+ TERN_(PRINTCOUNTER, print_job_timer.tick());
- thermalManager.manage_heater();
+ // Update the Beeper queue
+ TERN_(USE_BEEPER, buzzer.tick());
- #if ENABLED(PRINTCOUNTER)
- print_job_timer.tick();
- #endif
-
- #if USE_BEEPER
- buzzer.tick();
- #endif
+ // Handle UI input / draw events
+ TERN(DWIN_CREALITY_LCD, DWIN_Update(), ui.update());
+ // Run i2c Position Encoders
#if ENABLED(I2C_POSITION_ENCODERS)
static millis_t i2cpem_next_update_ms;
if (planner.has_blocks_queued()) {
@@ -688,31 +739,25 @@ void idle(
}
#endif
- #ifdef HAL_IDLETASK
- HAL_idletask();
- #endif
-
+ // Auto-report Temperatures / SD Status
#if HAS_AUTO_REPORTING
- if (!suspend_auto_report) {
- #if ENABLED(AUTO_REPORT_TEMPERATURES)
- thermalManager.auto_report_temperatures();
- #endif
- #if ENABLED(AUTO_REPORT_SD_STATUS)
- card.auto_report_sd_status();
- #endif
+ if (!gcode.autoreport_paused) {
+ TERN_(AUTO_REPORT_TEMPERATURES, thermalManager.auto_report_temperatures());
+ TERN_(AUTO_REPORT_SD_STATUS, card.auto_report_sd_status());
}
#endif
- #if ENABLED(USB_FLASH_DRIVE_SUPPORT)
- Sd2Card::idle();
- #endif
+ // Update the Prusa MMU2
+ TERN_(PRUSA_MMU2, mmu2.mmu_loop());
- #if ENABLED(PRUSA_MMU2)
- mmu2.mmu_loop();
- #endif
+ // Handle Joystick jogging
+ TERN_(POLL_JOG, joystick.inject_jog_moves());
+
+ // Direct Stepping
+ TERN_(DIRECT_STEPPING, page_manager.write_responses());
- #if ENABLED(POLL_JOG)
- joystick.inject_jog_moves();
+ #if HAS_TFT_LVGL_UI
+ LV_TASK_HANDLER();
#endif
}
@@ -723,7 +768,9 @@ void idle(
void kill(PGM_P const lcd_error/*=nullptr*/, PGM_P const lcd_component/*=nullptr*/, const bool steppers_off/*=false*/) {
thermalManager.disable_all_heaters();
- SERIAL_ERROR_MSG(MSG_ERR_KILLED);
+ TERN_(HAS_CUTTER, cutter.kill()); // Full cutter shutdown including ISR control
+
+ SERIAL_ERROR_MSG(STR_ERR_KILLED);
#if HAS_DISPLAY
ui.kill_screen(lcd_error ?: GET_TEXT(MSG_KILLED), lcd_component ?: NUL_STR);
@@ -752,33 +799,31 @@ void minkill(const bool steppers_off/*=false*/) {
// Reiterate heaters off
thermalManager.disable_all_heaters();
+ TERN_(HAS_CUTTER, cutter.kill()); // Reiterate cutter shutdown
+
// Power off all steppers (for M112) or just the E steppers
steppers_off ? disable_all_steppers() : disable_e_steppers();
- #if ENABLED(PSU_CONTROL)
- PSU_OFF();
- #endif
+ TERN_(PSU_CONTROL, PSU_OFF());
- #if HAS_SUICIDE
- suicide();
- #endif
+ TERN_(HAS_SUICIDE, suicide());
#if HAS_KILL
// Wait for kill to be released
- while (!READ(KILL_PIN)) watchdog_refresh();
+ while (kill_state()) watchdog_refresh();
// Wait for kill to be pressed
- while (READ(KILL_PIN)) watchdog_refresh();
+ while (!kill_state()) watchdog_refresh();
- void (*resetFunc)() = 0; // Declare resetFunc() at address 0
+ void (*resetFunc)() = 0; // Declare resetFunc() at address 0
resetFunc(); // Jump to address 0
- #else // !HAS_KILL
+ #else
- for (;;) watchdog_refresh(); // Wait for reset
+ for (;;) watchdog_refresh(); // Wait for reset
- #endif // !HAS_KILL
+ #endif
}
/**
@@ -794,11 +839,10 @@ void stop() {
#endif
if (IsRunning()) {
- queue.stop();
- SERIAL_ERROR_MSG(MSG_ERR_STOPPED);
+ SERIAL_ERROR_MSG(STR_ERR_STOPPED);
LCD_MESSAGEPGM(MSG_STOPPED);
safe_delay(350); // allow enough time for messages to get out before stopping
- Running = false;
+ marlin_state = MF_STOPPED;
}
}
@@ -819,162 +863,171 @@ void stop() {
* • Digipot I2C
* • Z probe sled
* • status LEDs
+ * • Max7219
*/
void setup() {
- HAL_init();
-
- #if HAS_DRIVER(L6470)
- L6470.init(); // setup SPI and then init chips
- #endif
-
- #if ENABLED(MAX7219_DEBUG)
- max7219.init();
+ #if ENABLED(MARLIN_DEV_MODE)
+ auto log_current_ms = [&](PGM_P const msg) {
+ SERIAL_ECHO_START();
+ SERIAL_CHAR('['); SERIAL_ECHO(millis()); SERIAL_ECHOPGM("] ");
+ serialprintPGM(msg);
+ SERIAL_EOL();
+ };
+ #define SETUP_LOG(M) log_current_ms(PSTR(M))
+ #else
+ #define SETUP_LOG(...) NOOP
#endif
+ #define SETUP_RUN(C) do{ SETUP_LOG(STRINGIFY(C)); C; }while(0)
- #if ENABLED(DISABLE_DEBUG)
+ #if EITHER(DISABLE_DEBUG, DISABLE_JTAG)
// Disable any hardware debug to free up pins for IO
- #ifdef JTAGSWD_DISABLE
+ #if ENABLED(DISABLE_DEBUG) && defined(JTAGSWD_DISABLE)
JTAGSWD_DISABLE();
#elif defined(JTAG_DISABLE)
JTAG_DISABLE();
#else
- #error "DISABLE_DEBUG is not supported for the selected MCU/Board"
+ #error "DISABLE_(DEBUG|JTAG) is not supported for the selected MCU/Board."
#endif
- #elif ENABLED(DISABLE_JTAG)
- // Disable JTAG to free up pins for IO
- #ifdef JTAG_DISABLE
- JTAG_DISABLE();
- #else
- #error "DISABLE_JTAG is not supported for the selected MCU/Board"
+ #endif
+
+ #if NUM_SERIAL > 0
+ MYSERIAL0.begin(BAUDRATE);
+ uint32_t serial_connect_timeout = millis() + 1000UL;
+ while (!MYSERIAL0 && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
+ #if HAS_MULTI_SERIAL
+ MYSERIAL1.begin(BAUDRATE);
+ serial_connect_timeout = millis() + 1000UL;
+ while (!MYSERIAL1 && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
#endif
+ SERIAL_ECHO_MSG("start");
+ #endif
+
+ SETUP_RUN(HAL_init());
+
+ #if HAS_L64XX
+ SETUP_RUN(L64xxManager.init()); // Set up SPI, init drivers
+ #endif
+
+ #if ENABLED(SMART_EFFECTOR) && PIN_EXISTS(SMART_EFFECTOR_MOD)
+ OUT_WRITE(SMART_EFFECTOR_MOD_PIN, LOW); // Put Smart Effector into NORMAL mode
#endif
#if HAS_FILAMENT_SENSOR
- runout.setup();
+ SETUP_RUN(runout.setup());
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
- recovery.setup();
+ SETUP_RUN(recovery.setup());
#endif
- setup_killpin();
+ SETUP_RUN(setup_killpin());
#if HAS_TMC220x
- tmc_serial_begin();
+ SETUP_RUN(tmc_serial_begin());
#endif
- setup_powerhold();
+ SETUP_RUN(setup_powerhold());
#if HAS_STEPPER_RESET
- disableStepperDrivers();
- #endif
-
- #if NUM_SERIAL > 0
- MYSERIAL0.begin(BAUDRATE);
- #if NUM_SERIAL > 1
- MYSERIAL1.begin(BAUDRATE);
- #endif
- #endif
-
- #if NUM_SERIAL > 0
- uint32_t serial_connect_timeout = millis() + 1000UL;
- while (!MYSERIAL0 && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
- #if NUM_SERIAL > 1
- serial_connect_timeout = millis() + 1000UL;
- while (!MYSERIAL1 && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
- #endif
+ SETUP_RUN(disableStepperDrivers());
#endif
- SERIAL_ECHOLNPGM("start");
- SERIAL_ECHO_START();
-
- #if TMC_HAS_SPI
+ #if HAS_TMC_SPI
#if DISABLED(TMC_USE_SW_SPI)
- SPI.begin();
+ SETUP_RUN(SPI.begin());
#endif
- tmc_init_cs_pins();
+ SETUP_RUN(tmc_init_cs_pins());
#endif
#ifdef BOARD_INIT
+ SETUP_LOG("BOARD_INIT");
BOARD_INIT();
#endif
+ SETUP_RUN(esp_wifi_init());
+
// Check startup - does nothing if bootloader sets MCUSR to 0
- byte mcu = HAL_get_reset_source();
- if (mcu & 1) SERIAL_ECHOLNPGM(MSG_POWERUP);
- if (mcu & 2) SERIAL_ECHOLNPGM(MSG_EXTERNAL_RESET);
- if (mcu & 4) SERIAL_ECHOLNPGM(MSG_BROWNOUT_RESET);
- if (mcu & 8) SERIAL_ECHOLNPGM(MSG_WATCHDOG_RESET);
- if (mcu & 32) SERIAL_ECHOLNPGM(MSG_SOFTWARE_RESET);
+ const byte mcu = HAL_get_reset_source();
+ if (mcu & RST_POWER_ON) SERIAL_ECHOLNPGM(STR_POWERUP);
+ if (mcu & RST_EXTERNAL) SERIAL_ECHOLNPGM(STR_EXTERNAL_RESET);
+ if (mcu & RST_BROWN_OUT) SERIAL_ECHOLNPGM(STR_BROWNOUT_RESET);
+ if (mcu & RST_WATCHDOG) SERIAL_ECHOLNPGM(STR_WATCHDOG_RESET);
+ if (mcu & RST_SOFTWARE) SERIAL_ECHOLNPGM(STR_SOFTWARE_RESET);
HAL_clear_reset_source();
- SERIAL_ECHOPGM(MSG_MARLIN);
+ serialprintPGM(GET_TEXT(MSG_MARLIN));
SERIAL_CHAR(' ');
SERIAL_ECHOLNPGM(SHORT_BUILD_VERSION);
SERIAL_EOL();
#if defined(STRING_DISTRIBUTION_DATE) && defined(STRING_CONFIG_H_AUTHOR)
SERIAL_ECHO_MSG(
- MSG_CONFIGURATION_VER
+ STR_CONFIGURATION_VER
STRING_DISTRIBUTION_DATE
- MSG_AUTHOR STRING_CONFIG_H_AUTHOR
+ STR_AUTHOR STRING_CONFIG_H_AUTHOR
);
SERIAL_ECHO_MSG("Compiled: " __DATE__);
#endif
SERIAL_ECHO_START();
- SERIAL_ECHOLNPAIR(MSG_FREE_MEMORY, freeMemory(), MSG_PLANNER_BUFFER_BYTES, (int)sizeof(block_t) * (BLOCK_BUFFER_SIZE));
-
- // UI must be initialized before EEPROM
- // (because EEPROM code calls the UI).
+ SERIAL_ECHOLNPAIR(STR_FREE_MEMORY, freeMemory(), STR_PLANNER_BUFFER_BYTES, (int)sizeof(block_t) * (BLOCK_BUFFER_SIZE));
// Set up LEDs early
#if HAS_COLOR_LEDS
- leds.setup();
+ SETUP_RUN(leds.setup());
#endif
- ui.init();
- #if HAS_SPI_LCD && ENABLED(SHOW_BOOTSCREEN)
- ui.show_bootscreen();
+ #if ENABLED(USE_CONTROLLER_FAN) // Set up fan controller to initialize also the default configurations.
+ SETUP_RUN(controllerFan.setup());
#endif
- #if ENABLED(SDSUPPORT)
- card.mount(); // Mount the SD card before settings.first_load
- #endif
+ // UI must be initialized before EEPROM
+ // (because EEPROM code calls the UI).
- // Load data from EEPROM if available (or use defaults)
- // This also updates variables in the planner, elsewhere
- settings.first_load();
+ #if ENABLED(DWIN_CREALITY_LCD)
+ delay(800); // Required delay (since boot?)
+ SERIAL_ECHOPGM("\nDWIN handshake ");
+ if (DWIN_Handshake()) SERIAL_ECHOLNPGM("ok."); else SERIAL_ECHOLNPGM("error.");
+ DWIN_Frame_SetDir(1); // Orientation 90°
+ DWIN_UpdateLCD(); // Show bootscreen (first image)
+ #else
+ SETUP_RUN(ui.init());
+ #if HAS_SPI_LCD && ENABLED(SHOW_BOOTSCREEN)
+ SETUP_RUN(ui.show_bootscreen());
+ #endif
+ SETUP_RUN(ui.reset_status()); // Load welcome message early. (Retained if no errors exist.)
+ #endif
- #if ENABLED(TOUCH_BUTTONS)
- touch.init();
+ #if BOTH(SDSUPPORT, SDCARD_EEPROM_EMULATION)
+ SETUP_RUN(card.mount()); // Mount media with settings before first_load
#endif
- #if HAS_M206_COMMAND
- // Initialize current position based on home_offset
- current_position += home_offset;
+ SETUP_RUN(settings.first_load()); // Load data from EEPROM if available (or use defaults)
+ // This also updates variables in the planner, elsewhere
+
+ #if ENABLED(TOUCH_BUTTONS)
+ SETUP_RUN(touch.init());
#endif
- // Vital to init stepper/planner equivalent for current_position
- sync_plan_position();
+ TERN_(HAS_M206_COMMAND, current_position += home_offset); // Init current position based on home_offset
- thermalManager.init(); // Initialize temperature loop
+ sync_plan_position(); // Vital to init stepper/planner equivalent for current_position
- print_job_timer.init(); // Initial setup of print job timer
+ SETUP_RUN(thermalManager.init()); // Initialize temperature loop
- ui.reset_status(); // Print startup message after print statistics are loaded
+ SETUP_RUN(print_job_timer.init()); // Initial setup of print job timer
- endstops.init(); // Init endstops and pullups
+ SETUP_RUN(endstops.init()); // Init endstops and pullups
- stepper.init(); // Init stepper. This enables interrupts!
+ SETUP_RUN(stepper.init()); // Init stepper. This enables interrupts!
#if HAS_SERVOS
- servo_init();
+ SETUP_RUN(servo_init());
#endif
#if HAS_Z_SERVO_PROBE
- servo_probe_init();
+ SETUP_RUN(probe.servo_probe_init());
#endif
#if HAS_PHOTOGRAPH
@@ -982,7 +1035,7 @@ void setup() {
#endif
#if HAS_CUTTER
- cutter.init();
+ SETUP_RUN(cutter.init());
#endif
#if ENABLED(COOLANT_MIST)
@@ -993,23 +1046,19 @@ void setup() {
#endif
#if HAS_BED_PROBE
- endstops.enable_z_probe(false);
- #endif
-
- #if ENABLED(USE_CONTROLLER_FAN)
- SET_OUTPUT(CONTROLLER_FAN_PIN);
+ SETUP_RUN(endstops.enable_z_probe(false));
#endif
#if HAS_STEPPER_RESET
- enableStepperDrivers();
+ SETUP_RUN(enableStepperDrivers());
#endif
- #if ENABLED(DIGIPOT_I2C)
- digipot_i2c_init();
+ #if HAS_I2C_DIGIPOT
+ SETUP_RUN(digipot_i2c_init());
#endif
#if ENABLED(DAC_STEPPER_CURRENT)
- dac_init();
+ SETUP_RUN(dac_init());
#endif
#if EITHER(Z_PROBE_SLED, SOLENOID_PROBE) && HAS_SOLENOID_1
@@ -1032,41 +1081,44 @@ void setup() {
#if DISABLED(CASE_LIGHT_USE_NEOPIXEL)
if (PWM_PIN(CASE_LIGHT_PIN)) SET_PWM(CASE_LIGHT_PIN); else SET_OUTPUT(CASE_LIGHT_PIN);
#endif
- update_case_light();
+ SETUP_RUN(update_case_light());
#endif
#if ENABLED(MK2_MULTIPLEXER)
+ SETUP_LOG("MK2_MULTIPLEXER");
SET_OUTPUT(E_MUX0_PIN);
SET_OUTPUT(E_MUX1_PIN);
SET_OUTPUT(E_MUX2_PIN);
#endif
#if HAS_FANMUX
- fanmux_init();
+ SETUP_RUN(fanmux_init());
#endif
#if ENABLED(MIXING_EXTRUDER)
- mixer.init();
+ SETUP_RUN(mixer.init());
#endif
#if ENABLED(BLTOUCH)
- bltouch.init(/*set_voltage=*/true);
+ SETUP_RUN(bltouch.init(/*set_voltage=*/true));
#endif
#if ENABLED(I2C_POSITION_ENCODERS)
- I2CPEM.init();
+ SETUP_RUN(I2CPEM.init());
#endif
#if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0
+ SETUP_LOG("i2c...");
i2c.onReceive(i2c_on_receive);
i2c.onRequest(i2c_on_request);
#endif
#if DO_SWITCH_EXTRUDER
- move_extruder_servo(0); // Initialize extruder servo
+ SETUP_RUN(move_extruder_servo(0)); // Initialize extruder servo
#endif
#if ENABLED(SWITCHING_NOZZLE)
+ SETUP_LOG("SWITCHING_NOZZLE");
// Initialize nozzle servo(s)
#if SWITCHING_NOZZLE_TWO_SERVOS
lower_nozzle(0);
@@ -1077,71 +1129,108 @@ void setup() {
#endif
#if ENABLED(MAGNETIC_PARKING_EXTRUDER)
- mpe_settings_init();
+ SETUP_RUN(mpe_settings_init());
#endif
#if ENABLED(PARKING_EXTRUDER)
- pe_solenoid_init();
+ SETUP_RUN(pe_solenoid_init());
#endif
- #if ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
- est_init();
+ #if ENABLED(SWITCHING_TOOLHEAD)
+ SETUP_RUN(swt_init());
#endif
- #if ENABLED(POWER_LOSS_RECOVERY)
- recovery.check();
+ #if ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
+ SETUP_RUN(est_init());
#endif
#if ENABLED(USE_WATCHDOG)
- watchdog_init(); // Reinit watchdog after HAL_get_reset_source call
+ SETUP_RUN(watchdog_init()); // Reinit watchdog after HAL_get_reset_source call
#endif
#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER)
- init_closedloop();
+ SETUP_RUN(closedloop.init());
#endif
#ifdef STARTUP_COMMANDS
+ SETUP_LOG("STARTUP_COMMANDS");
queue.inject_P(PSTR(STARTUP_COMMANDS));
#endif
- #if ENABLED(INIT_SDCARD_ON_BOOT) && !HAS_SPI_LCD
- card.beginautostart();
- #endif
-
#if ENABLED(HOST_PROMPT_SUPPORT)
- host_action_prompt_end();
+ SETUP_RUN(host_action_prompt_end());
#endif
- #if HAS_TRINAMIC && DISABLED(PSU_DEFAULT_OFF)
- test_tmc_connection(true, true, true, true);
+ #if HAS_TRINAMIC_CONFIG && DISABLED(PSU_DEFAULT_OFF)
+ SETUP_RUN(test_tmc_connection(true, true, true, true));
#endif
#if ENABLED(PRUSA_MMU2)
- mmu2.init();
+ SETUP_RUN(mmu2.init());
+ #endif
+
+ #if ENABLED(IIC_BL24CXX_EEPROM)
+ BL24CXX::init();
+ const uint8_t err = BL24CXX::check();
+ SERIAL_ECHO_TERNARY(err, "BL24CXX Check ", "failed", "succeeded", "!\n");
+ #endif
+
+ #if ENABLED(DWIN_CREALITY_LCD)
+ Encoder_Configuration();
+ HMI_Init();
+ HMI_StartFrame(true);
+ #endif
+
+ #if HAS_SERVICE_INTERVALS && DISABLED(DWIN_CREALITY_LCD)
+ ui.reset_status(true); // Show service messages or keep current status
+ #endif
+
+ #if ENABLED(MAX7219_DEBUG)
+ SETUP_RUN(max7219.init());
#endif
+
+ #if ENABLED(DIRECT_STEPPING)
+ SETUP_RUN(page_manager.init());
+ #endif
+
+ #if HAS_TFT_LVGL_UI
+ if (!card.isMounted()) SETUP_RUN(card.mount()); // Mount SD to load graphics and fonts
+ SETUP_RUN(tft_lvgl_init());
+ #endif
+
+ marlin_state = MF_RUNNING;
+
+ SETUP_LOG("setup() completed.");
}
/**
* The main Marlin program loop
*
- * - Save or log commands to SD
- * - Process available commands (if not saving)
- * - Call endstop manager
- * - Call inactivity manager
+ * - Call idle() to handle all tasks between G-code commands
+ * Note that no G-codes from the queue can be executed during idle()
+ * but many G-codes can be called directly anytime like macros.
+ * - Check whether SD card auto-start is needed now.
+ * - Check whether SD print finishing is needed now.
+ * - Run one G-code command from the immediate or main command queue
+ * and open up one space. Commands in the main queue may come from sd
+ * card, host, or by direct injection. The queue will continue to fill
+ * as long as idle() or manage_inactivity() are being called.
*/
void loop() {
-
- for (;;) {
-
- idle(); // Do an idle first so boot is slightly faster
+ do {
+ idle();
#if ENABLED(SDSUPPORT)
card.checkautostart();
if (card.flag.abort_sd_printing) abortSDPrinting();
+ if (marlin_state == MF_SD_COMPLETE) finishSDPrinting();
#endif
queue.advance();
endstops.event_handler();
- }
+
+ TERN_(HAS_TFT_LVGL_UI, printer_state_polling());
+
+ } while (ENABLED(__AVR__)); // Loop forever on slower (AVR) boards
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/MarlinCore.h b/firmware/marlin2.0 for Ender3/Marlin/src/MarlinCore.h
new file mode 100644
index 00000000..81041c8e
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/MarlinCore.h
@@ -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 .
+ *
+ */
+#pragma once
+
+#include "inc/MarlinConfig.h"
+
+#ifdef DEBUG_GCODE_PARSER
+ #include "gcode/parser.h"
+#endif
+
+#include
+#include
+#include
+
+void stop();
+
+// Pass true to keep steppers from timing out
+void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep=false));
+inline void idle_no_sleep() { idle(TERN_(ADVANCED_PAUSE_FEATURE, true)); }
+
+#if ENABLED(EXPERIMENTAL_I2CBUS)
+ #include "feature/twibus.h"
+ extern TWIBus i2c;
+#endif
+
+#if ENABLED(G38_PROBE_TARGET)
+ extern uint8_t G38_move; // Flag to tell the ISR that G38 is in progress, and the type
+ extern bool G38_did_trigger; // Flag from the ISR to indicate the endstop changed
+#endif
+
+/**
+ * The axis order in all axis related arrays is X, Y, Z, E
+ */
+void enable_e_steppers();
+void enable_all_steppers();
+void disable_e_stepper(const uint8_t e);
+void disable_e_steppers();
+void disable_all_steppers();
+
+void kill(PGM_P const lcd_error=nullptr, PGM_P const lcd_component=nullptr, const bool steppers_off=false);
+void minkill(const bool steppers_off=false);
+
+void quickstop_stepper();
+
+// Global State of the firmware
+enum MarlinState : uint8_t {
+ MF_INITIALIZING = 0,
+ MF_RUNNING = _BV(0),
+ MF_PAUSED = _BV(1),
+ MF_WAITING = _BV(2),
+ MF_STOPPED = _BV(3),
+ MF_SD_COMPLETE = _BV(4),
+ MF_KILLED = _BV(7)
+};
+
+extern MarlinState marlin_state;
+inline bool IsRunning() { return marlin_state == MF_RUNNING; }
+inline bool IsStopped() { return marlin_state != MF_RUNNING; }
+
+bool printingIsActive();
+bool printingIsPaused();
+void startOrResumeJob();
+
+extern bool wait_for_heatup;
+
+#if HAS_RESUME_CONTINUE
+ extern bool wait_for_user;
+ void wait_for_user_response(millis_t ms=0, const bool no_sleep=false);
+#endif
+
+#if ENABLED(PSU_CONTROL)
+ extern bool powersupply_on;
+ #define PSU_PIN_ON() do{ OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_HIGH); powersupply_on = true; }while(0)
+ #define PSU_PIN_OFF() do{ OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_HIGH); powersupply_on = false; }while(0)
+ #if ENABLED(AUTO_POWER_CONTROL)
+ #define PSU_ON() powerManager.power_on()
+ #define PSU_OFF() powerManager.power_off()
+ #else
+ #define PSU_ON() PSU_PIN_ON()
+ #define PSU_OFF() PSU_PIN_OFF()
+ #endif
+#endif
+
+bool pin_is_protected(const pin_t pin);
+void protected_pin_err();
+
+#if HAS_SUICIDE
+ inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_INVERTING); }
+#endif
+
+#if HAS_KILL
+ #ifndef KILL_PIN_STATE
+ #define KILL_PIN_STATE LOW
+ #endif
+ inline bool kill_state() { return READ(KILL_PIN) == KILL_PIN_STATE; }
+#endif
+
+#if ENABLED(G29_RETRY_AND_RECOVER)
+ void event_probe_recover();
+ void event_probe_failure();
+#endif
+
+extern const char NUL_STR[], M112_KILL_STR[], G28_STR[], M21_STR[], M23_STR[], M24_STR[],
+ SP_A_STR[], SP_B_STR[], SP_C_STR[],
+ SP_P_STR[], SP_T_STR[], SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_E_STR[],
+ X_LBL[], Y_LBL[], Z_LBL[], E_LBL[], SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_E_LBL[];
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/core/boards.h b/firmware/marlin2.0 for Ender3/Marlin/src/core/boards.h
index cf57b1f2..6e57a437 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/core/boards.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/core/boards.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -56,51 +56,57 @@
#define BOARD_3DRAG 1100 // 3Drag Controller
#define BOARD_K8200 1101 // Velleman K8200 Controller (derived from 3Drag Controller)
#define BOARD_K8400 1102 // Velleman K8400 Controller (derived from 3Drag Controller)
-#define BOARD_BAM_DICE 1103 // 2PrintBeta BAM&DICE with STK drivers
-#define BOARD_BAM_DICE_DUE 1104 // 2PrintBeta BAM&DICE Due with STK drivers
-#define BOARD_MKS_BASE 1105 // MKS BASE v1.0
-#define BOARD_MKS_BASE_14 1106 // MKS v1.4 with A4982 stepper drivers
-#define BOARD_MKS_BASE_15 1107 // MKS v1.5 with Allegro A4982 stepper drivers
-#define BOARD_MKS_BASE_HEROIC 1108 // MKS BASE 1.0 with Heroic HR4982 stepper drivers
-#define BOARD_MKS_GEN_13 1109 // MKS GEN v1.3 or 1.4
-#define BOARD_MKS_GEN_L 1110 // MKS GEN L
-#define BOARD_KFB_2 1111 // BigTreeTech or BIQU KFB2.0
-#define BOARD_ZRIB_V20 1112 // zrib V2.0 control board (Chinese knock off RAMPS replica)
-#define BOARD_FELIX2 1113 // Felix 2.0+ Electronics Board (RAMPS like)
-#define BOARD_RIGIDBOARD 1114 // Invent-A-Part RigidBoard
-#define BOARD_RIGIDBOARD_V2 1115 // Invent-A-Part RigidBoard V2
-#define BOARD_SAINSMART_2IN1 1116 // Sainsmart 2-in-1 board
-#define BOARD_ULTIMAKER 1117 // Ultimaker
-#define BOARD_ULTIMAKER_OLD 1118 // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
-#define BOARD_AZTEEG_X3 1119 // Azteeg X3
-#define BOARD_AZTEEG_X3_PRO 1120 // Azteeg X3 Pro
-#define BOARD_ULTIMAIN_2 1121 // Ultimainboard 2.x (Uses TEMP_SENSOR 20)
-#define BOARD_RUMBA 1122 // Rumba
-#define BOARD_RUMBA_RAISE3D 1123 // Raise3D N series Rumba derivative
-#define BOARD_RL200 1124 // Rapide Lite 200 (v1, low-cost RUMBA clone with drv)
-#define BOARD_FORMBOT_TREX2PLUS 1125 // Formbot T-Rex 2 Plus
-#define BOARD_FORMBOT_TREX3 1126 // Formbot T-Rex 3
-#define BOARD_FORMBOT_RAPTOR 1127 // Formbot Raptor
-#define BOARD_FORMBOT_RAPTOR2 1128 // Formbot Raptor 2
-#define BOARD_BQ_ZUM_MEGA_3D 1129 // bq ZUM Mega 3D
-#define BOARD_MAKEBOARD_MINI 1130 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake
-#define BOARD_TRIGORILLA_13 1131 // TriGorilla Anycubic version 1.3-based on RAMPS EFB
-#define BOARD_TRIGORILLA_14 1132 // ... Ver 1.4
-#define BOARD_TRIGORILLA_14_11 1133 // ... Rev 1.1 (new servo pin order)
-#define BOARD_RAMPS_ENDER_4 1134 // Creality: Ender-4, CR-8
-#define BOARD_RAMPS_CREALITY 1135 // Creality: CR10S, CR20, CR-X
-#define BOARD_RAMPS_DAGOMA 1136 // Dagoma F5
-#define BOARD_FYSETC_F6_13 1137 // FYSETC F6
-#define BOARD_DUPLICATOR_I3_PLUS 1138 // Wanhao Duplicator i3 Plus
-#define BOARD_VORON 1139 // VORON Design
-#define BOARD_TRONXY_V3_1_0 1140 // Tronxy TRONXY-V3-1.0
-#define BOARD_Z_BOLT_X_SERIES 1141 // Z-Bolt X Series
-#define BOARD_TT_OSCAR 1142 // TT OSCAR
-#define BOARD_OVERLORD 1143 // Overlord/Overlord Pro
-#define BOARD_HJC2560C_REV1 1144 // ADIMLab Gantry v1
-#define BOARD_HJC2560C_REV2 1145 // ADIMLab Gantry v2
-#define BOARD_TANGO 1146 // BIQU Tango V1
-#define BOARD_MKS_GEN_L_V2 1147 // MKS GEN L V2
+#define BOARD_K8600 1103 // Velleman K8600 Controller (Vertex Nano)
+#define BOARD_BAM_DICE 1104 // 2PrintBeta BAM&DICE with STK drivers
+#define BOARD_BAM_DICE_DUE 1105 // 2PrintBeta BAM&DICE Due with STK drivers
+#define BOARD_MKS_BASE 1106 // MKS BASE v1.0
+#define BOARD_MKS_BASE_14 1107 // MKS BASE v1.4 with Allegro A4982 stepper drivers
+#define BOARD_MKS_BASE_15 1108 // MKS BASE v1.5 with Allegro A4982 stepper drivers
+#define BOARD_MKS_BASE_16 1109 // MKS BASE v1.6 with Allegro A4982 stepper drivers
+#define BOARD_MKS_BASE_HEROIC 1110 // MKS BASE 1.0 with Heroic HR4982 stepper drivers
+#define BOARD_MKS_GEN_13 1111 // MKS GEN v1.3 or 1.4
+#define BOARD_MKS_GEN_L 1112 // MKS GEN L
+#define BOARD_KFB_2 1113 // BigTreeTech or BIQU KFB2.0
+#define BOARD_ZRIB_V20 1114 // zrib V2.0 control board (Chinese knock off RAMPS replica)
+#define BOARD_FELIX2 1115 // Felix 2.0+ Electronics Board (RAMPS like)
+#define BOARD_RIGIDBOARD 1116 // Invent-A-Part RigidBoard
+#define BOARD_RIGIDBOARD_V2 1117 // Invent-A-Part RigidBoard V2
+#define BOARD_SAINSMART_2IN1 1118 // Sainsmart 2-in-1 board
+#define BOARD_ULTIMAKER 1119 // Ultimaker
+#define BOARD_ULTIMAKER_OLD 1120 // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
+#define BOARD_AZTEEG_X3 1121 // Azteeg X3
+#define BOARD_AZTEEG_X3_PRO 1122 // Azteeg X3 Pro
+#define BOARD_ULTIMAIN_2 1123 // Ultimainboard 2.x (Uses TEMP_SENSOR 20)
+#define BOARD_RUMBA 1124 // Rumba
+#define BOARD_RUMBA_RAISE3D 1125 // Raise3D N series Rumba derivative
+#define BOARD_RL200 1126 // Rapide Lite 200 (v1, low-cost RUMBA clone with drv)
+#define BOARD_FORMBOT_TREX2PLUS 1127 // Formbot T-Rex 2 Plus
+#define BOARD_FORMBOT_TREX3 1128 // Formbot T-Rex 3
+#define BOARD_FORMBOT_RAPTOR 1129 // Formbot Raptor
+#define BOARD_FORMBOT_RAPTOR2 1130 // Formbot Raptor 2
+#define BOARD_BQ_ZUM_MEGA_3D 1131 // bq ZUM Mega 3D
+#define BOARD_MAKEBOARD_MINI 1132 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake
+#define BOARD_TRIGORILLA_13 1133 // TriGorilla Anycubic version 1.3-based on RAMPS EFB
+#define BOARD_TRIGORILLA_14 1134 // ... Ver 1.4
+#define BOARD_TRIGORILLA_14_11 1135 // ... Rev 1.1 (new servo pin order)
+#define BOARD_RAMPS_ENDER_4 1136 // Creality: Ender-4, CR-8
+#define BOARD_RAMPS_CREALITY 1137 // Creality: CR10S, CR20, CR-X
+#define BOARD_RAMPS_DAGOMA 1138 // Dagoma F5
+#define BOARD_FYSETC_F6_13 1139 // FYSETC F6 1.3
+#define BOARD_FYSETC_F6_14 1140 // FYSETC F6 1.4
+#define BOARD_DUPLICATOR_I3_PLUS 1141 // Wanhao Duplicator i3 Plus
+#define BOARD_VORON 1142 // VORON Design
+#define BOARD_TRONXY_V3_1_0 1143 // Tronxy TRONXY-V3-1.0
+#define BOARD_Z_BOLT_X_SERIES 1144 // Z-Bolt X Series
+#define BOARD_TT_OSCAR 1145 // TT OSCAR
+#define BOARD_OVERLORD 1146 // Overlord/Overlord Pro
+#define BOARD_HJC2560C_REV1 1147 // ADIMLab Gantry v1
+#define BOARD_HJC2560C_REV2 1148 // ADIMLab Gantry v2
+#define BOARD_TANGO 1149 // BIQU Tango V1
+#define BOARD_MKS_GEN_L_V2 1150 // MKS GEN L V2
+#define BOARD_COPYMASTER_3D 1151 // Copymaster 3D
+#define BOARD_ORTUR_4 1152 // Ortur 4
+#define BOARD_TENLOG_D3_HERO 1153 // Tenlog D3 Hero IDEX printer
//
// RAMBo and derivatives
@@ -138,6 +144,10 @@
#define BOARD_GT2560_V3_A20 1318 // Geeetech GT2560 Rev B for A20(M/D)
#define BOARD_EINSTART_S 1319 // Einstart retrofit
#define BOARD_WANHAO_ONEPLUS 1320 // Wanhao 0ne+ i3 Mini
+#define BOARD_LEAPFROG_XEED2015 1321 // Leapfrog Xeed 2015
+#define BOARD_PICA_REVB 1322 // PICA Shield (original version)
+#define BOARD_PICA 1323 // PICA Shield (rev C or later)
+#define BOARD_INTAMSYS40 1324 // Intamsys 4.0 (Funmat HT)
//
// ATmega1281, ATmega2561
@@ -153,13 +163,14 @@
#define BOARD_SANGUINOLOLU_11 1500 // Sanguinololu < 1.2
#define BOARD_SANGUINOLOLU_12 1501 // Sanguinololu 1.2 and above
#define BOARD_MELZI 1502 // Melzi
-#define BOARD_MELZI_MAKR3D 1503 // Melzi with ATmega1284 (MaKr3d version)
-#define BOARD_MELZI_CREALITY 1504 // Melzi Creality3D board (for CR-10 etc)
-#define BOARD_MELZI_MALYAN 1505 // Melzi Malyan M150 board
-#define BOARD_MELZI_TRONXY 1506 // Tronxy X5S
-#define BOARD_STB_11 1507 // STB V1.1
-#define BOARD_AZTEEG_X1 1508 // Azteeg X1
-#define BOARD_ANET_10 1509 // Anet 1.0 (Melzi clone)
+#define BOARD_MELZI_V2 1503 // Melzi V2
+#define BOARD_MELZI_MAKR3D 1504 // Melzi with ATmega1284 (MaKr3d version)
+#define BOARD_MELZI_CREALITY 1505 // Melzi Creality3D board (for CR-10 etc)
+#define BOARD_MELZI_MALYAN 1506 // Melzi Malyan M150 board
+#define BOARD_MELZI_TRONXY 1507 // Tronxy X5S
+#define BOARD_STB_11 1508 // STB V1.1
+#define BOARD_AZTEEG_X1 1509 // Azteeg X1
+#define BOARD_ANET_10 1510 // Anet 1.0 (Melzi clone)
//
// Other ATmega644P, ATmega644, ATmega1284P
@@ -201,22 +212,28 @@
#define BOARD_RAMPS_14_RE_ARM_SF 2004 // Re-ARM with RAMPS 1.4 (Power outputs: Spindle, Controller Fan)
#define BOARD_MKS_SBASE 2005 // MKS-Sbase (Power outputs: Hotend0, Hotend1, Bed, Fan)
#define BOARD_AZSMZ_MINI 2006 // AZSMZ Mini
-#define BOARD_AZTEEG_X5_GT 2007 // Azteeg X5 GT (Power outputs: Hotend0, Hotend1, Bed, Fan)
-#define BOARD_BIQU_BQ111_A4 2008 // BIQU BQ111-A4 (Power outputs: Hotend, Fan, Bed)
-#define BOARD_SELENA_COMPACT 2009 // Selena Compact (Power outputs: Hotend0, Hotend1, Bed0, Bed1, Fan0, Fan1)
-#define BOARD_COHESION3D_REMIX 2010 // Cohesion3D ReMix
-#define BOARD_COHESION3D_MINI 2011 // Cohesion3D Mini
-#define BOARD_SMOOTHIEBOARD 2012 // Smoothieboard
-#define BOARD_AZTEEG_X5_MINI_WIFI 2013 // Azteeg X5 Mini Wifi (Power outputs: Hotend0, Bed, Fan)
-#define BOARD_BIQU_B300_V1_0 2014 // BIQU B300_V1.0 (Power outputs: Hotend0, Fan, Bed, SPI Driver)
-#define BOARD_AZTEEG_X5_MINI 2015 // Azteeg X5 Mini (Power outputs: Hotend0, Bed, Fan)
-#define BOARD_MKS_SGEN 2016 // MKS-SGen (Power outputs: Hotend0, Hotend1, Bed, Fan)
-#define BOARD_MKS_SGEN_L 2017 // MKS-SGen-L (Power outputs: Hotend0, Hotend1, Bed, Fan)
-#define BOARD_TH3D_EZBOARD 2018 // TH3D EZBoard v1.0
-#define BOARD_GMARSH_X6_REV1 2019 // GMARSH X6 board, revision 1 prototype
-#define BOARD_BIGTREE_SKR_V1_1 2020 // BigTreeTech SKR v1.1 (Power outputs: Hotend0, Hotend1, Fan, Bed)
-#define BOARD_BIGTREE_SKR_V1_3 2021 // BigTreeTech SKR v1.3 (Power outputs: Hotend0, Hotend1, Fan, Bed)
-#define BOARD_BIGTREE_SKR_V1_4 2022 // BigTreeTech SKR v1.4 (Power outputs: Hotend0, Hotend1, Fan, Bed)
+#define BOARD_BIQU_BQ111_A4 2007 // BIQU BQ111-A4 (Power outputs: Hotend, Fan, Bed)
+#define BOARD_SELENA_COMPACT 2008 // Selena Compact (Power outputs: Hotend0, Hotend1, Bed0, Bed1, Fan0, Fan1)
+#define BOARD_BIQU_B300_V1_0 2009 // BIQU B300_V1.0 (Power outputs: Hotend0, Fan, Bed, SPI Driver)
+#define BOARD_MKS_SGEN_L 2010 // MKS-SGen-L (Power outputs: Hotend0, Hotend1, Bed, Fan)
+#define BOARD_GMARSH_X6_REV1 2011 // GMARSH X6 board, revision 1 prototype
+#define BOARD_BTT_SKR_V1_1 2012 // BigTreeTech SKR v1.1 (Power outputs: Hotend0, Hotend1, Fan, Bed)
+#define BOARD_BTT_SKR_V1_3 2013 // BigTreeTech SKR v1.3 (Power outputs: Hotend0, Hotend1, Fan, Bed)
+#define BOARD_BTT_SKR_V1_4 2014 // BigTreeTech SKR v1.4 (Power outputs: Hotend0, Hotend1, Fan, Bed)
+
+//
+// LPC1769 ARM Cortex M3
+//
+
+#define BOARD_MKS_SGEN 2500 // MKS-SGen (Power outputs: Hotend0, Hotend1, Bed, Fan)
+#define BOARD_AZTEEG_X5_GT 2501 // Azteeg X5 GT (Power outputs: Hotend0, Hotend1, Bed, Fan)
+#define BOARD_AZTEEG_X5_MINI 2502 // Azteeg X5 Mini (Power outputs: Hotend0, Bed, Fan)
+#define BOARD_AZTEEG_X5_MINI_WIFI 2503 // Azteeg X5 Mini Wifi (Power outputs: Hotend0, Bed, Fan)
+#define BOARD_COHESION3D_REMIX 2504 // Cohesion3D ReMix
+#define BOARD_COHESION3D_MINI 2505 // Cohesion3D Mini
+#define BOARD_SMOOTHIEBOARD 2506 // Smoothieboard
+#define BOARD_TH3D_EZBOARD 2507 // TH3D EZBoard v1.0
+#define BOARD_BTT_SKR_V1_4_TURBO 2508 // BigTreeTech SKR v1.4 TURBO (Power outputs: Hotend0, Hotend1, Fan, Bed)
//
// SAM3X8E ARM Cortex M3
@@ -248,6 +265,7 @@
#define BOARD_ARCHIM1 3023 // UltiMachine Archim1 (with DRV8825 drivers)
#define BOARD_ARCHIM2 3024 // UltiMachine Archim2 (with TMC2130 drivers)
#define BOARD_ALLIGATOR 3025 // Alligator Board R2
+#define BOARD_CNCONTROLS_15D 3026 // Cartesio CN Controls V15 on DUE
//
// SAM3X8C ARM Cortex M3
@@ -262,29 +280,39 @@
#define BOARD_STM32F103RE 4000 // STM32F103RE Libmaple-based STM32F1 controller
#define BOARD_MALYAN_M200 4001 // STM32C8T6 Libmaple-based STM32F1 controller
-#define BOARD_STM3R_MINI 4002 // STM32F103RE Libmaple-based STM32F1 controller
-#define BOARD_GTM32_PRO_VB 4003 // STM32F103VET6 controller
-#define BOARD_MORPHEUS 4004 // STM32F103C8 / STM32F103CB Libmaple-based STM32F1 controller
-#define BOARD_CHITU3D 4005 // Chitu3D (STM32F103RET6)
-#define BOARD_MKS_ROBIN 4006 // MKS Robin (STM32F103ZET6)
-#define BOARD_MKS_ROBIN_MINI 4007 // MKS Robin Mini (STM32F103VET6)
-#define BOARD_MKS_ROBIN_NANO 4008 // MKS Robin Nano (STM32F103VET6)
-#define BOARD_MKS_ROBIN_LITE 4009 // MKS Robin Lite/Lite2 (STM32F103RCT6)
-#define BOARD_MKS_ROBIN_LITE3 4010 // MKS Robin Lite3 (STM32F103RCT6)
-#define BOARD_MKS_ROBIN_PRO 4011 // MKS Robin Pro (STM32F103ZET6)
-#define BOARD_BIGTREE_SKR_MINI_V1_1 4012 // BigTreeTech SKR Mini v1.1 (STM32F103RC)
-#define BOARD_BTT_SKR_MINI_E3_V1_0 4013 // BigTreeTech SKR Mini E3 (STM32F103RC)
-#define BOARD_BTT_SKR_MINI_E3_V1_2 4014 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
-#define BOARD_BIGTREE_SKR_E3_DIP 4015 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
-#define BOARD_JGAURORA_A5S_A1 4016 // JGAurora A5S A1 (STM32F103ZET6)
-#define BOARD_FYSETC_AIO_II 4017 // FYSETC AIO_II
-#define BOARD_FYSETC_CHEETAH 4018 // FYSETC Cheetah
-#define BOARD_FYSETC_CHEETAH_V12 4019 // FYSETC Cheetah V1.2
-#define BOARD_LONGER3D_LK 4020 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6
-#define BOARD_GTM32_MINI 4021 // STM32F103VET6 controller
-#define BOARD_GTM32_MINI_A30 4022 // STM32F103VET6 controller
-#define BOARD_GTM32_REV_B 4023 // STM32F103VET6 controller
-
+#define BOARD_MALYAN_M200_V2 4002 // STM32F070RB Libmaple-based STM32F0 controller
+#define BOARD_STM3R_MINI 4003 // STM32F103RE Libmaple-based STM32F1 controller
+#define BOARD_GTM32_PRO_VB 4004 // STM32F103VET6 controller
+#define BOARD_MORPHEUS 4005 // STM32F103C8 / STM32F103CB Libmaple-based STM32F1 controller
+#define BOARD_CHITU3D 4006 // Chitu3D (STM32F103RET6)
+#define BOARD_MKS_ROBIN 4007 // MKS Robin (STM32F103ZET6)
+#define BOARD_MKS_ROBIN_MINI 4008 // MKS Robin Mini (STM32F103VET6)
+#define BOARD_MKS_ROBIN_NANO 4009 // MKS Robin Nano (STM32F103VET6)
+#define BOARD_MKS_ROBIN_NANO_V2 4010 // MKS Robin Nano V2 (STM32F103VET6)
+#define BOARD_MKS_ROBIN_LITE 4011 // MKS Robin Lite/Lite2 (STM32F103RCT6)
+#define BOARD_MKS_ROBIN_LITE3 4012 // MKS Robin Lite3 (STM32F103RCT6)
+#define BOARD_MKS_ROBIN_PRO 4013 // MKS Robin Pro (STM32F103ZET6)
+#define BOARD_BTT_SKR_MINI_V1_1 4014 // BigTreeTech SKR Mini v1.1 (STM32F103RC)
+#define BOARD_BTT_SKR_MINI_E3_V1_0 4015 // BigTreeTech SKR Mini E3 (STM32F103RC)
+#define BOARD_BTT_SKR_MINI_E3_V1_2 4016 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
+#define BOARD_BTT_SKR_MINI_E3_V2_0 4017 // BigTreeTech SKR Mini E3 V2.0 (STM32F103RC)
+#define BOARD_BTT_SKR_E3_DIP 4018 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
+#define BOARD_JGAURORA_A5S_A1 4019 // JGAurora A5S A1 (STM32F103ZET6)
+#define BOARD_FYSETC_AIO_II 4020 // FYSETC AIO_II
+#define BOARD_FYSETC_CHEETAH 4021 // FYSETC Cheetah
+#define BOARD_FYSETC_CHEETAH_V12 4022 // FYSETC Cheetah V1.2
+#define BOARD_LONGER3D_LK 4023 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6
+#define BOARD_GTM32_MINI 4024 // STM32F103VET6 controller
+#define BOARD_GTM32_MINI_A30 4025 // STM32F103VET6 controller
+#define BOARD_GTM32_REV_B 4026 // STM32F103VET6 controller
+#define BOARD_MKS_ROBIN_E3D 4027 // MKS Robin E3D (STM32F103RCT6)
+#define BOARD_MKS_ROBIN_E3 4028 // MKS Robin E3 (STM32F103RCT6)
+#define BOARD_MALYAN_M300 4029 // STM32F070-based delta
+#define BOARD_CCROBOT_MEEB_3DP 4030 // ccrobot-online.com MEEB_3DP (STM32F103RC)
+#define BOARD_CHITU3D_V5 4031 // Chitu3D TronXY X5SA V5 Board
+#define BOARD_CHITU3D_V6 4032 // Chitu3D TronXY X5SA V5 Board
+#define BOARD_CREALITY_V4 4033 // Creality v4.x (STM32F103RE)
+#define BOARD_TRIGORILLA_PRO 4034 // Trigorilla Pro (STM32F103ZET6)
//
// ARM Cortex-M4F
@@ -300,20 +328,23 @@
#define BOARD_BEAST 4200 // STM32F4xxVxT6 Libmaple-based STM32F4 controller
#define BOARD_GENERIC_STM32F4 4201 // STM32 STM32GENERIC-based STM32F4 controller
#define BOARD_ARMED 4202 // Arm'ed STM32F4-based controller
-#define BOARD_RUMBA32 4203 // RUMBA32 STM32F4-based controller
-#define BOARD_BLACK_STM32F407VE 4204 // BLACK_STM32F407VE
-#define BOARD_BLACK_STM32F407ZE 4205 // BLACK_STM32F407ZE
-#define BOARD_STEVAL 4206 // STEVAL-3DP001V1 3D PRINTER BOARD
-#define BOARD_BIGTREE_SKR_PRO_V1_1 4207 // BigTreeTech SKR Pro v1.1 (STM32F407ZG)
-#define BOARD_BIGTREE_BTT002_V1_0 4208 // BigTreeTech BTT002 v1.0 (STM32F407VE)
-#define BOARD_LERDGE_K 4209 // Lerdge K (STM32F407ZG)
-#define BOARD_LERDGE_X 4210 // Lerdge X (STM32F407VE)
-#define BOARD_VAKE403D 4211 // VAkE 403D (STM32F446VET6)
-#define BOARD_FYSETC_S6 4212 // FYSETC S6 board
-#define BOARD_FLYF407ZG 4213 // FLYF407ZG board (STM32F407ZG)
-#define BOARD_MKS_ROBIN2 4214 // MKS_ROBIN2 (STM32F407ZE)
-#define BOARD_MKS_ROBIN_E3 4215 // MKS Robin E3 (STM32F103RCT6)
-#define BOARD_MKS_ROBIN_E3D 4216 // MKS Robin E3D (STM32F103RCT6)
+#define BOARD_RUMBA32_V1_0 4203 // RUMBA32 STM32F446VET6 based controller from Aus3D
+#define BOARD_RUMBA32_V1_1 4204 // RUMBA32 STM32F446VET6 based controller from Aus3D
+#define BOARD_RUMBA32_MKS 4205 // RUMBA32 STM32F446VET6 based controller from Makerbase
+#define BOARD_BLACK_STM32F407VE 4206 // BLACK_STM32F407VE
+#define BOARD_BLACK_STM32F407ZE 4207 // BLACK_STM32F407ZE
+#define BOARD_STEVAL_3DP001V1 4208 // STEVAL-3DP001V1 3D PRINTER BOARD
+#define BOARD_BTT_SKR_PRO_V1_1 4209 // BigTreeTech SKR Pro v1.1 (STM32F407ZG)
+#define BOARD_BTT_SKR_PRO_V1_2 4210 // BigTreeTech SKR Pro v1.2 (STM32F407ZG)
+#define BOARD_BTT_BTT002_V1_0 4211 // BigTreeTech BTT002 v1.0 (STM32F407VG)
+#define BOARD_BTT_GTR_V1_0 4212 // BigTreeTech GTR v1.0 (STM32F407IGT)
+#define BOARD_LERDGE_K 4213 // Lerdge K (STM32F407ZG)
+#define BOARD_LERDGE_S 4214 // Lerdge S (STM32F407VE)
+#define BOARD_LERDGE_X 4215 // Lerdge X (STM32F407VE)
+#define BOARD_VAKE403D 4216 // VAkE 403D (STM32F446VET6)
+#define BOARD_FYSETC_S6 4217 // FYSETC S6 board
+#define BOARD_FLYF407ZG 4218 // FLYF407ZG board (STM32F407ZG)
+#define BOARD_MKS_ROBIN2 4219 // MKS_ROBIN2 (STM32F407ZE)
//
// ARM Cortex M7
@@ -325,9 +356,15 @@
//
// Espressif ESP32 WiFi
//
-#define BOARD_ESPRESSIF_ESP32 6000
-#define BOARD_MRR_ESPA 6001
-#define BOARD_MRR_ESPE 6002
+#define BOARD_ESPRESSIF_ESP32 6000 // Generic ESP32
+#define BOARD_MRR_ESPA 6001 // MRR ESPA board based on ESP32 (native pins only)
+#define BOARD_MRR_ESPE 6002 // MRR ESPE board based on ESP32 (with I2S stepper stream)
+#define BOARD_E4D_BOX 6003 // E4d@BOX
+
+//
+// SAMD51 ARM Cortex M4
+//
+#define BOARD_AGCM4_RAMPS_144 6100 // RAMPS 1.4.4
//
// Simulations
@@ -338,4 +375,4 @@
#define _MB_1(B) (defined(BOARD_##B) && MOTHERBOARD==BOARD_##B)
#define MB(V...) DO(MB,||,V)
-#define IS_MELZI MB(MELZI, MELZI_CREALITY, MELZI_MAKR3D, MELZI_MALYAN, MELZI_TRONXY)
+#define IS_MELZI MB(MELZI, MELZI_CREALITY, MELZI_MAKR3D, MELZI_MALYAN, MELZI_TRONXY, MELZI_V2)
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/core/debug_out.h b/firmware/marlin2.0 for Ender3/Marlin/src/core/debug_out.h
index 07bdad7f..6ae1b9d8 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/core/debug_out.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/core/debug_out.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
@@ -26,11 +26,13 @@
// (or not) in a given .cpp file
//
+#undef DEBUG_SECTION
#undef DEBUG_PRINT_P
#undef DEBUG_ECHO_START
#undef DEBUG_ERROR_START
#undef DEBUG_CHAR
#undef DEBUG_ECHO
+#undef DEBUG_DECIMAL
#undef DEBUG_ECHO_F
#undef DEBUG_ECHOLN
#undef DEBUG_ECHOPGM
@@ -46,16 +48,23 @@
#undef DEBUG_ECHO_MSG
#undef DEBUG_ERROR_MSG
#undef DEBUG_EOL
+#undef DEBUG_FLUSH
#undef DEBUG_POS
#undef DEBUG_XYZ
#undef DEBUG_DELAY
+#undef DEBUG_SYNCHRONIZE
#if DEBUG_OUT
+
+ #include "debug_section.h"
+ #define DEBUG_SECTION(N,S,D) SectionLog N(PSTR(S),D)
+
#define DEBUG_PRINT_P(P) serialprintPGM(P)
#define DEBUG_ECHO_START SERIAL_ECHO_START
#define DEBUG_ERROR_START SERIAL_ERROR_START
#define DEBUG_CHAR SERIAL_CHAR
#define DEBUG_ECHO SERIAL_ECHO
+ #define DEBUG_DECIMAL SERIAL_DECIMAL
#define DEBUG_ECHO_F SERIAL_ECHO_F
#define DEBUG_ECHOLN SERIAL_ECHOLN
#define DEBUG_ECHOPGM SERIAL_ECHOPGM
@@ -71,15 +80,21 @@
#define DEBUG_ECHO_MSG SERIAL_ECHO_MSG
#define DEBUG_ERROR_MSG SERIAL_ERROR_MSG
#define DEBUG_EOL SERIAL_EOL
+ #define DEBUG_FLUSH SERIAL_FLUSH
#define DEBUG_POS SERIAL_POS
#define DEBUG_XYZ SERIAL_XYZ
#define DEBUG_DELAY(ms) serial_delay(ms)
+ #define DEBUG_SYNCHRONIZE() planner.synchronize()
+
#else
+
+ #define DEBUG_SECTION(...) NOOP
#define DEBUG_PRINT_P(P) NOOP
#define DEBUG_ECHO_START() NOOP
#define DEBUG_ERROR_START() NOOP
#define DEBUG_CHAR(...) NOOP
#define DEBUG_ECHO(...) NOOP
+ #define DEBUG_DECIMAL(...) NOOP
#define DEBUG_ECHO_F(...) NOOP
#define DEBUG_ECHOLN(...) NOOP
#define DEBUG_ECHOPGM(...) NOOP
@@ -95,9 +110,12 @@
#define DEBUG_ECHO_MSG(...) NOOP
#define DEBUG_ERROR_MSG(...) NOOP
#define DEBUG_EOL() NOOP
+ #define DEBUG_FLUSH() NOOP
#define DEBUG_POS(...) NOOP
#define DEBUG_XYZ(...) NOOP
#define DEBUG_DELAY(...) NOOP
+ #define DEBUG_SYNCHRONIZE() NOOP
+
#endif
#undef DEBUG_OUT
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/core/debug_section.h b/firmware/marlin2.0 for Ender3/Marlin/src/core/debug_section.h
new file mode 100644
index 00000000..7f39bc74
--- /dev/null
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/core/debug_section.h
@@ -0,0 +1,49 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#include "serial.h"
+#include "../module/motion.h"
+
+class SectionLog {
+public:
+ SectionLog(PGM_P const msg=nullptr, bool inbug=true) {
+ the_msg = msg;
+ if ((debug = inbug)) echo_msg(PSTR(">>>"));
+ }
+
+ ~SectionLog() { if (debug) echo_msg(PSTR("<<<")); }
+
+private:
+ PGM_P the_msg;
+ bool debug;
+
+ void echo_msg(PGM_P const pre) {
+ serialprintPGM(pre);
+ if (the_msg) {
+ SERIAL_CHAR(' ');
+ serialprintPGM(the_msg);
+ }
+ SERIAL_CHAR(' ');
+ print_xyz(current_position);
+ }
+};
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/core/drivers.h b/firmware/marlin2.0 for Ender3/Marlin/src/core/drivers.h
index 44434581..3a0e6209 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/core/drivers.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/core/drivers.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,129 +16,182 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
-#include "../inc/MarlinConfigPre.h"
-
-#define _A4988 0x001
-#define _A5984 0x002
-#define _DRV8825 0x003
-#define _LV8729 0x004
-#define _L6470 0x105
-#define _TB6560 0x006
-#define _TB6600 0x007
-#define _TMC2100 0x008
-#define _TMC2130 2130
-#define _TMC2130_STANDALONE 0x009
-#define _TMC2160 2160
-#define _TMC2160_STANDALONE 2161
-#define _TMC2208 2208
-#define _TMC2208_STANDALONE 0x00A
-#define _TMC2209 2209
-#define _TMC2209_STANDALONE 0x00D
-#define _TMC26X 0x10B
-#define _TMC26X_STANDALONE 0x00B
-#define _TMC2660 2660
-#define _TMC2660_STANDALONE 0x00C
-#define _TMC5130 5130
-#define _TMC5130_STANDALONE 5131
-#define _TMC5160 5160
-#define _TMC5160_STANDALONE 5161
+//
+// Included by MarlinConfigPre.h ahead of Configuration_adv.h.
+// Don't use #if in this file for anything not defined early!
+//
+
+#define _A4988 0x4988
+#define _A5984 0x5984
+#define _DRV8825 0x8825
+#define _LV8729 0x8729
+#define _L6470 0x6470
+#define _L6474 0x6474
+#define _L6480 0x6480
+#define _POWERSTEP01 0xF00D
+#define _TB6560 0x6560
+#define _TB6600 0x6600
+#define _TMC2100 0x2100
+#define _TMC2130 0x2130A
+#define _TMC2130_STANDALONE 0x2130B
+#define _TMC2160 0x2160A
+#define _TMC2160_STANDALONE 0x2160B
+#define _TMC2208 0x2208A
+#define _TMC2208_STANDALONE 0x2208B
+#define _TMC2209 0x2209A
+#define _TMC2209_STANDALONE 0x2209B
+#define _TMC26X 0x2600A
+#define _TMC26X_STANDALONE 0x2600B
+#define _TMC2660 0x2660A
+#define _TMC2660_STANDALONE 0x2660B
+#define _TMC5130 0x5130A
+#define _TMC5130_STANDALONE 0x5130B
+#define _TMC5160 0x5160A
+#define _TMC5160_STANDALONE 0x5160B
#define _DRIVER_ID(V) _CAT(_, V)
-#define _AXIS_DRIVER_TYPE(A,T) (_DRIVER_ID(A##_DRIVER_TYPE) == _CAT(_, T))
+#define _AXIS_DRIVER_TYPE(A,T) (_DRIVER_ID(A##_DRIVER_TYPE) == _DRIVER_ID(T))
#define AXIS_DRIVER_TYPE_X(T) _AXIS_DRIVER_TYPE(X,T)
#define AXIS_DRIVER_TYPE_Y(T) _AXIS_DRIVER_TYPE(Y,T)
#define AXIS_DRIVER_TYPE_Z(T) _AXIS_DRIVER_TYPE(Z,T)
+
#define AXIS_DRIVER_TYPE_X2(T) (EITHER(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE) && _AXIS_DRIVER_TYPE(X2,T))
#define AXIS_DRIVER_TYPE_Y2(T) (ENABLED(Y_DUAL_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Y2,T))
-#define AXIS_DRIVER_TYPE_Z2(T) (Z_MULTI_STEPPER_DRIVERS && _AXIS_DRIVER_TYPE(Z2,T))
-#define AXIS_DRIVER_TYPE_Z3(T) (ENABLED(Z_TRIPLE_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Z3,T))
-#define AXIS_DRIVER_TYPE_E0(T) (E_STEPPERS > 0 && _AXIS_DRIVER_TYPE(E0,T))
-#define AXIS_DRIVER_TYPE_E1(T) (E_STEPPERS > 1 && _AXIS_DRIVER_TYPE(E1,T))
-#define AXIS_DRIVER_TYPE_E2(T) (E_STEPPERS > 2 && _AXIS_DRIVER_TYPE(E2,T))
-#define AXIS_DRIVER_TYPE_E3(T) (E_STEPPERS > 3 && _AXIS_DRIVER_TYPE(E3,T))
-#define AXIS_DRIVER_TYPE_E4(T) (E_STEPPERS > 4 && _AXIS_DRIVER_TYPE(E4,T))
-#define AXIS_DRIVER_TYPE_E5(T) (E_STEPPERS > 5 && _AXIS_DRIVER_TYPE(E5,T))
+#define AXIS_DRIVER_TYPE_Z2(T) (NUM_Z_STEPPER_DRIVERS >= 2 && _AXIS_DRIVER_TYPE(Z2,T))
+#define AXIS_DRIVER_TYPE_Z3(T) (NUM_Z_STEPPER_DRIVERS >= 3 && _AXIS_DRIVER_TYPE(Z3,T))
+#define AXIS_DRIVER_TYPE_Z4(T) (NUM_Z_STEPPER_DRIVERS >= 4 && _AXIS_DRIVER_TYPE(Z4,T))
+
+#define AXIS_DRIVER_TYPE_E(N,T) (E_STEPPERS > N && _AXIS_DRIVER_TYPE(E##N,T))
+#define AXIS_DRIVER_TYPE_E0(T) AXIS_DRIVER_TYPE_E(0,T)
+#define AXIS_DRIVER_TYPE_E1(T) AXIS_DRIVER_TYPE_E(1,T)
+#define AXIS_DRIVER_TYPE_E2(T) AXIS_DRIVER_TYPE_E(2,T)
+#define AXIS_DRIVER_TYPE_E3(T) AXIS_DRIVER_TYPE_E(3,T)
+#define AXIS_DRIVER_TYPE_E4(T) AXIS_DRIVER_TYPE_E(4,T)
+#define AXIS_DRIVER_TYPE_E5(T) AXIS_DRIVER_TYPE_E(5,T)
+#define AXIS_DRIVER_TYPE_E6(T) AXIS_DRIVER_TYPE_E(6,T)
+#define AXIS_DRIVER_TYPE_E7(T) AXIS_DRIVER_TYPE_E(7,T)
#define AXIS_DRIVER_TYPE(A,T) AXIS_DRIVER_TYPE_##A(T)
-#define HAS_E_DRIVER(T) ( AXIS_DRIVER_TYPE_E0(T) || AXIS_DRIVER_TYPE_E1(T) \
- || AXIS_DRIVER_TYPE_E2(T) || AXIS_DRIVER_TYPE_E3(T) \
- || AXIS_DRIVER_TYPE_E4(T) || AXIS_DRIVER_TYPE_E5(T) )
+#define _OR_ADTE(N,T) || AXIS_DRIVER_TYPE_E(N,T)
+#define HAS_E_DRIVER(T) (0 RREPEAT2(E_STEPPERS, _OR_ADTE, T))
-#define HAS_DRIVER(T) ( AXIS_DRIVER_TYPE_X(T) || AXIS_DRIVER_TYPE_X2(T) \
- || AXIS_DRIVER_TYPE_Y(T) || AXIS_DRIVER_TYPE_Y2(T) \
- || AXIS_DRIVER_TYPE_Z(T) || AXIS_DRIVER_TYPE_Z2(T) || AXIS_DRIVER_TYPE_Z3(T) \
- || HAS_E_DRIVER(T) )
+#define HAS_DRIVER(T) ( AXIS_DRIVER_TYPE_X(T) || AXIS_DRIVER_TYPE_Y(T) || AXIS_DRIVER_TYPE_Z(T) \
+ || AXIS_DRIVER_TYPE_X2(T) || AXIS_DRIVER_TYPE_Y2(T) || AXIS_DRIVER_TYPE_Z2(T) \
+ || AXIS_DRIVER_TYPE_Z3(T) || AXIS_DRIVER_TYPE_Z4(T) || HAS_E_DRIVER(T) )
+
+//
+// Trinamic Stepper Drivers
+//
// Test for supported TMC drivers that require advanced configuration
// Does not match standalone configurations
-#define HAS_TRINAMIC ( HAS_DRIVER(TMC2130) \
- || HAS_DRIVER(TMC2160) \
- || HAS_DRIVER(TMC2208) \
- || HAS_DRIVER(TMC2209) \
- || HAS_DRIVER(TMC2660) \
- || HAS_DRIVER(TMC5130) \
- || HAS_DRIVER(TMC5160) )
-
-#define HAS_TMC220x (HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209))
-
-#define AXIS_IS_TMC(A) ( AXIS_DRIVER_TYPE(A,TMC2130) \
- || AXIS_DRIVER_TYPE(A,TMC2160) \
- || AXIS_DRIVER_TYPE(A,TMC2208) \
- || AXIS_DRIVER_TYPE(A,TMC2209) \
+#if ( HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2160) \
+ || HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209) \
+ || HAS_DRIVER(TMC2660) \
+ || HAS_DRIVER(TMC5130) || HAS_DRIVER(TMC5160) )
+ #define HAS_TRINAMIC_CONFIG 1
+#endif
+
+#define HAS_TRINAMIC HAS_TRINAMIC_CONFIG
+
+#if ( HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2160_STANDALONE) \
+ || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC2209_STANDALONE) \
+ || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) \
+ || HAS_DRIVER(TMC5130_STANDALONE) || HAS_DRIVER(TMC5160_STANDALONE) )
+ #define HAS_TRINAMIC_STANDALONE 1
+#endif
+
+#if HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2160) || HAS_DRIVER(TMC5130) || HAS_DRIVER(TMC5160)
+ #define HAS_TMCX1X0 1
+#endif
+
+#if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209)
+ #define HAS_TMC220x 1
+#endif
+
+#define AXIS_IS_TMC(A) ( AXIS_DRIVER_TYPE(A,TMC2130) || AXIS_DRIVER_TYPE(A,TMC2160) \
+ || AXIS_DRIVER_TYPE(A,TMC2208) || AXIS_DRIVER_TYPE(A,TMC2209) \
|| AXIS_DRIVER_TYPE(A,TMC2660) \
- || AXIS_DRIVER_TYPE(A,TMC5130) \
- || AXIS_DRIVER_TYPE(A,TMC5160) )
+ || AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) )
// Test for a driver that uses SPI - this allows checking whether a _CS_ pin
// is considered sensitive
-#define AXIS_HAS_SPI(A) ( AXIS_DRIVER_TYPE(A,TMC2130) \
- || AXIS_DRIVER_TYPE(A,TMC2160) \
+#define AXIS_HAS_SPI(A) ( AXIS_DRIVER_TYPE(A,TMC2130) || AXIS_DRIVER_TYPE(A,TMC2160) \
|| AXIS_DRIVER_TYPE(A,TMC2660) \
- || AXIS_DRIVER_TYPE(A,TMC5130) \
- || AXIS_DRIVER_TYPE(A,TMC5160) )
+ || AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) )
+
+#define AXIS_HAS_UART(A) ( AXIS_DRIVER_TYPE(A,TMC2208) || AXIS_DRIVER_TYPE(A,TMC2209) )
+
+#define AXIS_HAS_RXTX AXIS_HAS_UART
-#define AXIS_HAS_UART(A) ( AXIS_DRIVER_TYPE(A,TMC2208) \
- || AXIS_DRIVER_TYPE(A,TMC2209) )
+#define AXIS_HAS_HW_SERIAL(A) ( AXIS_HAS_UART(A) && defined(A##_HARDWARE_SERIAL) )
+#define AXIS_HAS_SW_SERIAL(A) ( AXIS_HAS_UART(A) && !defined(A##_HARDWARE_SERIAL) )
-#define AXIS_HAS_STALLGUARD(A) ( AXIS_DRIVER_TYPE(A,TMC2130) \
- || AXIS_DRIVER_TYPE(A,TMC2160) \
+#define AXIS_HAS_STALLGUARD(A) ( AXIS_DRIVER_TYPE(A,TMC2130) || AXIS_DRIVER_TYPE(A,TMC2160) \
|| AXIS_DRIVER_TYPE(A,TMC2209) \
|| AXIS_DRIVER_TYPE(A,TMC2660) \
- || AXIS_DRIVER_TYPE(A,TMC5130) \
- || AXIS_DRIVER_TYPE(A,TMC5160) )
+ || AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) )
-#define AXIS_HAS_STEALTHCHOP(A) ( AXIS_DRIVER_TYPE(A,TMC2130) \
- || AXIS_DRIVER_TYPE(A,TMC2160) \
- || AXIS_DRIVER_TYPE(A,TMC2208) \
+#define AXIS_HAS_STEALTHCHOP(A) ( AXIS_DRIVER_TYPE(A,TMC2130) || AXIS_DRIVER_TYPE(A,TMC2160) \
+ || AXIS_DRIVER_TYPE(A,TMC2208) || AXIS_DRIVER_TYPE(A,TMC2209) \
+ || AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) )
+
+#define AXIS_HAS_SG_RESULT(A) ( AXIS_DRIVER_TYPE(A,TMC2130) || AXIS_DRIVER_TYPE(A,TMC2160) \
+ || AXIS_DRIVER_TYPE(A,TMC2208) || AXIS_DRIVER_TYPE(A,TMC2209) )
+
+#define AXIS_HAS_COOLSTEP(A) ( AXIS_DRIVER_TYPE(A,TMC2130) \
|| AXIS_DRIVER_TYPE(A,TMC2209) \
- || AXIS_DRIVER_TYPE(A,TMC5130) \
- || AXIS_DRIVER_TYPE(A,TMC5160) )
-
-#define HAS_TMC_E_DRIVER ( HAS_E_DRIVER(TMC2130) \
- || HAS_E_DRIVER(TMC2160) \
- || HAS_E_DRIVER(TMC2660) \
- || HAS_E_DRIVER(TMC2209) \
- || HAS_E_DRIVER(TMC5130) \
- || HAS_E_DRIVER(TMC5160) )
-
-#define HAS_TMC_STANDALONE_E_DRIVER ( HAS_E_DRIVER(TMC2130_STANDALONE) \
- || HAS_E_DRIVER(TMC2160_STANDALONE) \
- || HAS_E_DRIVER(TMC2660_STANDALONE) \
- || HAS_E_DRIVER(TMC2209_STANDALONE) \
- || HAS_E_DRIVER(TMC5130_STANDALONE) \
- || HAS_E_DRIVER(TMC5160_STANDALONE) )
+ || AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) )
+
+#define _OR_EAH(N,T) || AXIS_HAS_##T(E##N)
+#define E_AXIS_HAS(T) (0 _OR_EAH(0,T) _OR_EAH(1,T) _OR_EAH(2,T) _OR_EAH(3,T) _OR_EAH(4,T) _OR_EAH(5,T) _OR_EAH(6,T) _OR_EAH(7,T))
+
+#define ANY_AXIS_HAS(T) ( AXIS_HAS_##T(X) || AXIS_HAS_##T(Y) || AXIS_HAS_##T(Z) \
+ || AXIS_HAS_##T(X2) || AXIS_HAS_##T(Y2) || AXIS_HAS_##T(Z2) \
+ || AXIS_HAS_##T(Z3) || AXIS_HAS_##T(Z4) || E_AXIS_HAS(T) )
+
+#if ANY_AXIS_HAS(STEALTHCHOP)
+ #define HAS_STEALTHCHOP 1
+#endif
+#if ANY_AXIS_HAS(STALLGUARD)
+ #define HAS_STALLGUARD 1
+#endif
+#if ANY_AXIS_HAS(SG_RESULT)
+ #define HAS_SG_RESULT 1
+#endif
+#if ANY_AXIS_HAS(COOLSTEP)
+ #define HAS_COOLSTEP 1
+#endif
+#if ANY_AXIS_HAS(RXTX)
+ #define HAS_TMC_UART 1
+#endif
+#if ANY_AXIS_HAS(SPI)
+ #define HAS_TMC_SPI 1
+#endif
+
+//
+// TMC26XX Stepper Drivers
//
-// Stretching 'drivers.h' to include LPC/SAMD51 SD options
+#if HAS_DRIVER(TMC26X)
+ #define HAS_TMC26X 1
+#endif
+
+//
+// L64XX Stepper Drivers
//
-#define _SDCARD_LCD 1
-#define _SDCARD_ONBOARD 2
-#define _SDCARD_CUSTOM_CABLE 3
-#define _SDCARD_ID(V) _CAT(_SDCARD_, V)
-#define SD_CONNECTION_IS(V) (_SDCARD_ID(SDCARD_CONNECTION) == _SDCARD_ID(V))
+
+#if HAS_DRIVER(L6470) || HAS_DRIVER(L6474) || HAS_DRIVER(L6480) || HAS_DRIVER(POWERSTEP01)
+ #define HAS_L64XX 1
+#endif
+#if HAS_L64XX && !HAS_DRIVER(L6474)
+ #define HAS_L64XX_NOT_L6474 1
+#endif
+
+#define AXIS_IS_L64XX(A) (AXIS_DRIVER_TYPE_##A(L6470) || AXIS_DRIVER_TYPE_##A(L6474) || AXIS_DRIVER_TYPE_##A(L6480) || AXIS_DRIVER_TYPE_##A(POWERSTEP01))
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/core/language.h b/firmware/marlin2.0 for Ender3/Marlin/src/core/language.h
index cfce9d9a..5208b3e1 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/core/language.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/core/language.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -39,7 +39,7 @@
//
// ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRA_LCD" / "SDSUPPORT" #define IN "Configuration.h"
// ==> ALSO TRY ALL AVAILABLE LANGUAGE OPTIONS
-// See also http://marlinfw.org/docs/development/lcd_language.html
+// See also https://marlinfw.org/docs/development/lcd_language.html
// Languages
// an Aragonese
@@ -57,6 +57,7 @@
// fr French
// gl Galician
// hr Croatian
+// hu Hungarian
// it Italian
// jp_kana Japanese
// ko_KR Korean (South Korea)
@@ -64,6 +65,7 @@
// pl Polish
// pt Portuguese
// pt_br Portuguese (Brazilian)
+// ro Romanian
// ru Russian
// sk Slovak
// tr Turkish
@@ -80,23 +82,222 @@
#ifdef CUSTOM_MACHINE_NAME
#undef MACHINE_NAME
#define MACHINE_NAME CUSTOM_MACHINE_NAME
-#else
- #ifdef DEFAULT_MACHINE_NAME
- #undef MACHINE_NAME
- #define MACHINE_NAME DEFAULT_MACHINE_NAME
- #endif
+#elif defined(DEFAULT_MACHINE_NAME)
+ #undef MACHINE_NAME
+ #define MACHINE_NAME DEFAULT_MACHINE_NAME
#endif
#ifndef MACHINE_UUID
#define MACHINE_UUID DEFAULT_MACHINE_UUID
#endif
-#define MARLIN_WEBSITE_URL "http://marlinfw.org"
+#define MARLIN_WEBSITE_URL "https://marlinfw.org"
//#if !defined(STRING_SPLASH_LINE3) && defined(WEBSITE_URL)
// #define STRING_SPLASH_LINE3 WEBSITE_URL
//#endif
+//
+// Common Serial Console Messages
+// Don't change these strings because serial hosts look for them.
+//
+
+#define STR_ENQUEUEING "enqueueing \""
+#define STR_POWERUP "PowerUp"
+#define STR_EXTERNAL_RESET " External Reset"
+#define STR_BROWNOUT_RESET " Brown out Reset"
+#define STR_WATCHDOG_RESET " Watchdog Reset"
+#define STR_SOFTWARE_RESET " Software Reset"
+#define STR_AUTHOR " | Author: "
+#define STR_CONFIGURATION_VER " Last Updated: "
+#define STR_FREE_MEMORY " Free Memory: "
+#define STR_PLANNER_BUFFER_BYTES " PlannerBufferBytes: "
+#define STR_OK "ok"
+#define STR_WAIT "wait"
+#define STR_STATS "Stats: "
+#define STR_FILE_SAVED "Done saving file."
+#define STR_ERR_LINE_NO "Line Number is not Last Line Number+1, Last Line: "
+#define STR_ERR_CHECKSUM_MISMATCH "checksum mismatch, Last Line: "
+#define STR_ERR_NO_CHECKSUM "No Checksum with line number, Last Line: "
+#define STR_FILE_PRINTED "Done printing file"
+#define STR_BEGIN_FILE_LIST "Begin file list"
+#define STR_END_FILE_LIST "End file list"
+#define STR_INVALID_EXTRUDER "Invalid extruder"
+#define STR_INVALID_E_STEPPER "Invalid E stepper"
+#define STR_E_STEPPER_NOT_SPECIFIED "E stepper not specified"
+#define STR_INVALID_SOLENOID "Invalid solenoid"
+#define STR_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " (" __DATE__ " " __TIME__ ") SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID
+#define STR_COUNT_X " Count X:"
+#define STR_COUNT_A " Count A:"
+#define STR_WATCHDOG_FIRED "Watchdog timeout. Reset required."
+#define STR_ERR_KILLED "Printer halted. kill() called!"
+#define STR_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)"
+#define STR_BUSY_PROCESSING "busy: processing"
+#define STR_BUSY_PAUSED_FOR_USER "busy: paused for user"
+#define STR_BUSY_PAUSED_FOR_INPUT "busy: paused for input"
+#define STR_Z_MOVE_COMP "Z_move_comp"
+#define STR_RESEND "Resend: "
+#define STR_UNKNOWN_COMMAND "Unknown command: \""
+#define STR_ACTIVE_EXTRUDER "Active Extruder: "
+#define STR_X_MIN "x_min"
+#define STR_X_MAX "x_max"
+#define STR_X2_MIN "x2_min"
+#define STR_X2_MAX "x2_max"
+#define STR_Y_MIN "y_min"
+#define STR_Y_MAX "y_max"
+#define STR_Y2_MIN "y2_min"
+#define STR_Y2_MAX "y2_max"
+#define STR_Z_MIN "z_min"
+#define STR_Z_MAX "z_max"
+#define STR_Z2_MIN "z2_min"
+#define STR_Z2_MAX "z2_max"
+#define STR_Z3_MIN "z3_min"
+#define STR_Z3_MAX "z3_max"
+#define STR_Z4_MIN "z4_min"
+#define STR_Z4_MAX "z4_max"
+#define STR_Z_PROBE "z_probe"
+#define STR_FILAMENT_RUNOUT_SENSOR "filament"
+#define STR_PROBE_OFFSET "Probe Offset"
+#define STR_SKEW_MIN "min_skew_factor: "
+#define STR_SKEW_MAX "max_skew_factor: "
+#define STR_ERR_MATERIAL_INDEX "M145 S out of range (0-1)"
+#define STR_ERR_M421_PARAMETERS "M421 incorrect parameter usage"
+#define STR_ERR_BAD_PLANE_MODE "G5 requires XY plane mode"
+#define STR_ERR_MESH_XY "Mesh point out of range"
+#define STR_ERR_ARC_ARGS "G2/G3 bad parameters"
+#define STR_ERR_PROTECTED_PIN "Protected Pin"
+#define STR_ERR_M420_FAILED "Failed to enable Bed Leveling"
+#define STR_ERR_M428_TOO_FAR "Too far from reference point"
+#define STR_ERR_M303_DISABLED "PIDTEMP disabled"
+#define STR_M119_REPORT "Reporting endstop status"
+#define STR_ON "ON"
+#define STR_OFF "OFF"
+#define STR_ENDSTOP_HIT "TRIGGERED"
+#define STR_ENDSTOP_OPEN "open"
+#define STR_HOTEND_OFFSET "Hotend offsets:"
+#define STR_DUPLICATION_MODE "Duplication mode: "
+#define STR_SOFT_ENDSTOPS "Soft endstops: "
+#define STR_SOFT_MIN " Min: "
+#define STR_SOFT_MAX " Max: "
+
+#define STR_SAVED_POS "Position saved"
+#define STR_RESTORING_POS "Restoring position"
+#define STR_INVALID_POS_SLOT "Invalid slot. Total: "
+
+#define STR_SD_CANT_OPEN_SUBDIR "Cannot open subdir "
+#define STR_SD_INIT_FAIL "No SD card"
+#define STR_SD_VOL_INIT_FAIL "volume.init failed"
+#define STR_SD_OPENROOT_FAIL "openRoot failed"
+#define STR_SD_CARD_OK "SD card ok"
+#define STR_SD_WORKDIR_FAIL "workDir open failed"
+#define STR_SD_OPEN_FILE_FAIL "open failed, File: "
+#define STR_SD_FILE_OPENED "File opened: "
+#define STR_SD_SIZE " Size: "
+#define STR_SD_FILE_SELECTED "File selected"
+#define STR_SD_WRITE_TO_FILE "Writing to file: "
+#define STR_SD_PRINTING_BYTE "SD printing byte "
+#define STR_SD_NOT_PRINTING "Not SD printing"
+#define STR_SD_ERR_WRITE_TO_FILE "error writing to file"
+#define STR_SD_ERR_READ "SD read error"
+#define STR_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: "
+
+#define STR_ENDSTOPS_HIT "endstops hit: "
+#define STR_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented"
+#define STR_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented"
+#define STR_ERR_HOTEND_TOO_COLD "Hotend too cold"
+#define STR_ERR_EEPROM_WRITE "Error writing to EEPROM!"
+
+#define STR_FILAMENT_CHANGE_HEAT_LCD "Press button to heat nozzle"
+#define STR_FILAMENT_CHANGE_INSERT_LCD "Insert filament and press button"
+#define STR_FILAMENT_CHANGE_WAIT_LCD "Press button to resume"
+#define STR_FILAMENT_CHANGE_HEAT_M108 "Send M108 to heat nozzle"
+#define STR_FILAMENT_CHANGE_INSERT_M108 "Insert filament and send M108"
+#define STR_FILAMENT_CHANGE_WAIT_M108 "Send M108 to resume"
+
+#define STR_STOP_BLTOUCH "!! STOP called because of BLTouch error - restart with M999"
+#define STR_STOP_UNHOMED "!! STOP called because of unhomed error - restart with M999"
+#define STR_KILL_INACTIVE_TIME "!! KILL caused by too much inactive time - current command: "
+#define STR_KILL_BUTTON "!! KILL caused by KILL button/pin"
+
+// temperature.cpp strings
+#define STR_PID_AUTOTUNE_START "PID Autotune start"
+#define STR_PID_BAD_EXTRUDER_NUM "PID Autotune failed! Bad extruder number"
+#define STR_PID_TEMP_TOO_HIGH "PID Autotune failed! Temperature too high"
+#define STR_PID_TIMEOUT "PID Autotune failed! timeout"
+#define STR_BIAS " bias: "
+#define STR_D_COLON " d: "
+#define STR_T_MIN " min: "
+#define STR_T_MAX " max: "
+#define STR_KU " Ku: "
+#define STR_TU " Tu: "
+#define STR_CLASSIC_PID " Classic PID "
+#define STR_KP " Kp: "
+#define STR_KI " Ki: "
+#define STR_KD " Kd: "
+#define STR_PID_AUTOTUNE_FINISHED "PID Autotune finished! Put the last Kp, Ki and Kd constants from below into Configuration.h"
+#define STR_PID_DEBUG " PID_DEBUG "
+#define STR_PID_DEBUG_INPUT ": Input "
+#define STR_PID_DEBUG_OUTPUT " Output "
+#define STR_PID_DEBUG_PTERM " pTerm "
+#define STR_PID_DEBUG_ITERM " iTerm "
+#define STR_PID_DEBUG_DTERM " dTerm "
+#define STR_PID_DEBUG_CTERM " cTerm "
+#define STR_INVALID_EXTRUDER_NUM " - Invalid extruder number !"
+
+#define STR_HEATER_BED "bed"
+#define STR_HEATER_CHAMBER "chamber"
+
+#define STR_STOPPED_HEATER ", system stopped! Heater_ID: "
+#define STR_REDUNDANCY "Heater switched off. Temperature difference between temp sensors is too high !"
+#define STR_T_HEATING_FAILED "Heating failed"
+#define STR_T_THERMAL_RUNAWAY "Thermal Runaway"
+#define STR_T_MAXTEMP "MAXTEMP triggered"
+#define STR_T_MINTEMP "MINTEMP triggered"
+#define STR_ERR_PROBING_FAILED "Probing Failed"
+#define STR_ZPROBE_OUT_SER "Z Probe Past Bed"
+
+// Debug
+#define STR_DEBUG_PREFIX "DEBUG:"
+#define STR_DEBUG_OFF "off"
+#define STR_DEBUG_ECHO "ECHO"
+#define STR_DEBUG_INFO "INFO"
+#define STR_DEBUG_ERRORS "ERRORS"
+#define STR_DEBUG_DRYRUN "DRYRUN"
+#define STR_DEBUG_COMMUNICATION "COMMUNICATION"
+#define STR_DEBUG_LEVELING "LEVELING"
+
+// LCD Menu Messages
+
+#define LANGUAGE_DATA_INCL_(M) STRINGIFY_(fontdata/langdata_##M.h)
+#define LANGUAGE_DATA_INCL(M) LANGUAGE_DATA_INCL_(M)
+
+#define LANGUAGE_INCL_(M) STRINGIFY_(../lcd/language/language_##M.h)
+#define LANGUAGE_INCL(M) LANGUAGE_INCL_(M)
+
+#define STR_X "X"
+#define STR_Y "Y"
+#define STR_Z "Z"
+#define STR_E "E"
+#if IS_KINEMATIC
+ #define STR_A "A"
+ #define STR_B "B"
+ #define STR_C "C"
+#else
+ #define STR_A "X"
+ #define STR_B "Y"
+ #define STR_C "Z"
+#endif
+#define STR_X2 "X2"
+#define STR_Y2 "Y2"
+#define STR_Z2 "Z2"
+#define STR_Z3 "Z3"
+#define STR_Z4 "Z4"
+
+#define LCD_STR_A STR_A
+#define LCD_STR_B STR_B
+#define LCD_STR_C STR_C
+#define LCD_STR_E STR_E
+
#if HAS_CHARACTER_LCD
// Custom characters defined in the first 8 characters of the LCD
@@ -135,210 +336,6 @@
#endif
-// Common LCD messages
-
- /* nothing here yet */
-
-// Common serial messages
-#define MSG_MARLIN "Marlin"
-
-// Serial Console Messages (do not translate those!)
-
-#define MSG_ENQUEUEING "enqueueing \""
-#define MSG_POWERUP "PowerUp"
-#define MSG_EXTERNAL_RESET " External Reset"
-#define MSG_BROWNOUT_RESET " Brown out Reset"
-#define MSG_WATCHDOG_RESET " Watchdog Reset"
-#define MSG_SOFTWARE_RESET " Software Reset"
-#define MSG_AUTHOR " | Author: "
-#define MSG_CONFIGURATION_VER " Last Updated: "
-#define MSG_FREE_MEMORY " Free Memory: "
-#define MSG_PLANNER_BUFFER_BYTES " PlannerBufferBytes: "
-#define MSG_OK "ok"
-#define MSG_WAIT "wait"
-#define MSG_STATS "Stats: "
-#define MSG_FILE_SAVED "Done saving file."
-#define MSG_ERR_LINE_NO "Line Number is not Last Line Number+1, Last Line: "
-#define MSG_ERR_CHECKSUM_MISMATCH "checksum mismatch, Last Line: "
-#define MSG_ERR_NO_CHECKSUM "No Checksum with line number, Last Line: "
-#define MSG_FILE_PRINTED "Done printing file"
-#define MSG_BEGIN_FILE_LIST "Begin file list"
-#define MSG_END_FILE_LIST "End file list"
-#define MSG_INVALID_EXTRUDER "Invalid extruder"
-#define MSG_INVALID_E_STEPPER "Invalid E stepper"
-#define MSG_E_STEPPER_NOT_SPECIFIED "E stepper not specified"
-#define MSG_INVALID_SOLENOID "Invalid solenoid"
-#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID
-#define MSG_COUNT_X " Count X:"
-#define MSG_COUNT_A " Count A:"
-#define MSG_WATCHDOG_FIRED "Watchdog timeout. Reset required."
-#define MSG_ERR_KILLED "Printer halted. kill() called!"
-#define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)"
-#define MSG_BUSY_PROCESSING "busy: processing"
-#define MSG_BUSY_PAUSED_FOR_USER "busy: paused for user"
-#define MSG_BUSY_PAUSED_FOR_INPUT "busy: paused for input"
-#define MSG_Z_MOVE_COMP "Z_move_comp"
-#define MSG_RESEND "Resend: "
-#define MSG_UNKNOWN_COMMAND "Unknown command: \""
-#define MSG_ACTIVE_EXTRUDER "Active Extruder: "
-#define MSG_X_MIN "x_min"
-#define MSG_X_MAX "x_max"
-#define MSG_X2_MIN "x2_min"
-#define MSG_X2_MAX "x2_max"
-#define MSG_Y_MIN "y_min"
-#define MSG_Y_MAX "y_max"
-#define MSG_Y2_MIN "y2_min"
-#define MSG_Y2_MAX "y2_max"
-#define MSG_Z_MIN "z_min"
-#define MSG_Z_MAX "z_max"
-#define MSG_Z2_MIN "z2_min"
-#define MSG_Z2_MAX "z2_max"
-#define MSG_Z3_MIN "z3_min"
-#define MSG_Z3_MAX "z3_max"
-#define MSG_Z_PROBE "z_probe"
-#define MSG_FILAMENT_RUNOUT_SENSOR "filament"
-#define MSG_PROBE_OFFSET "Probe Offset"
-#define MSG_SKEW_MIN "min_skew_factor: "
-#define MSG_SKEW_MAX "max_skew_factor: "
-#define MSG_ERR_MATERIAL_INDEX "M145 S out of range (0-1)"
-#define MSG_ERR_M421_PARAMETERS "M421 incorrect parameter usage"
-#define MSG_ERR_BAD_PLANE_MODE "G5 requires XY plane mode"
-#define MSG_ERR_MESH_XY "Mesh point cannot be resolved"
-#define MSG_ERR_ARC_ARGS "G2/G3 bad parameters"
-#define MSG_ERR_PROTECTED_PIN "Protected Pin"
-#define MSG_ERR_M420_FAILED "Failed to enable Bed Leveling"
-#define MSG_ERR_M428_TOO_FAR "Too far from reference point"
-#define MSG_ERR_M303_DISABLED "PIDTEMP disabled"
-#define MSG_M119_REPORT "Reporting endstop status"
-#define MSG_ON "ON"
-#define MSG_OFF "OFF"
-#define MSG_ENDSTOP_HIT "TRIGGERED"
-#define MSG_ENDSTOP_OPEN "open"
-#define MSG_HOTEND_OFFSET "Hotend offsets:"
-#define MSG_DUPLICATION_MODE "Duplication mode: "
-#define MSG_SOFT_ENDSTOPS "Soft endstops: "
-#define MSG_SOFT_MIN " Min: "
-#define MSG_SOFT_MAX " Max: "
-
-#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir "
-#define MSG_SD_INIT_FAIL "SD init fail"
-#define MSG_SD_VOL_INIT_FAIL "volume.init failed"
-#define MSG_SD_OPENROOT_FAIL "openRoot failed"
-#define MSG_SD_CARD_OK "SD card ok"
-#define MSG_SD_WORKDIR_FAIL "workDir open failed"
-#define MSG_SD_OPEN_FILE_FAIL "open failed, File: "
-#define MSG_SD_FILE_OPENED "File opened: "
-#define MSG_SD_SIZE " Size: "
-#define MSG_SD_FILE_SELECTED "File selected"
-#define MSG_SD_WRITE_TO_FILE "Writing to file: "
-#define MSG_SD_PRINTING_BYTE "SD printing byte "
-#define MSG_SD_NOT_PRINTING "Not SD printing"
-#define MSG_SD_ERR_WRITE_TO_FILE "error writing to file"
-#define MSG_SD_ERR_READ "SD read error"
-#define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: "
-
-#define MSG_STEPPER_TOO_HIGH "Steprate too high: "
-#define MSG_ENDSTOPS_HIT "endstops hit: "
-#define MSG_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented"
-#define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented"
-#define MSG_ERR_HOTEND_TOO_COLD "Hotend too cold"
-#define MSG_ERR_Z_HOMING_SER "Home XY first"
-#define MSG_ERR_EEPROM_WRITE "Error writing to EEPROM!"
-
-#define MSG_FILAMENT_CHANGE_HEAT_LCD "Press button to heat nozzle"
-#define MSG_FILAMENT_CHANGE_INSERT_LCD "Insert filament and press button"
-#define MSG_FILAMENT_CHANGE_WAIT_LCD "Press button to resume"
-#define MSG_FILAMENT_CHANGE_HEAT_M108 "Send M108 to heat nozzle"
-#define MSG_FILAMENT_CHANGE_INSERT_M108 "Insert filament and send M108"
-#define MSG_FILAMENT_CHANGE_WAIT_M108 "Send M108 to resume"
-
-#define MSG_STOP_BLTOUCH "!! STOP called because of BLTouch error - restart with M999"
-#define MSG_STOP_UNHOMED "!! STOP called because of unhomed error - restart with M999"
-#define MSG_KILL_INACTIVE_TIME "!! KILL caused by too much inactive time - current command: "
-#define MSG_KILL_BUTTON "!! KILL caused by KILL button/pin"
-
-// temperature.cpp strings
-#define MSG_PID_AUTOTUNE_PREFIX "PID Autotune"
-#define MSG_PID_AUTOTUNE_START MSG_PID_AUTOTUNE_PREFIX " start"
-#define MSG_PID_AUTOTUNE_FAILED MSG_PID_AUTOTUNE_PREFIX " failed!"
-#define MSG_PID_BAD_EXTRUDER_NUM MSG_PID_AUTOTUNE_FAILED " Bad extruder number"
-#define MSG_PID_TEMP_TOO_HIGH MSG_PID_AUTOTUNE_FAILED " Temperature too high"
-#define MSG_PID_TIMEOUT MSG_PID_AUTOTUNE_FAILED " timeout"
-#define MSG_BIAS " bias: "
-#define MSG_D " d: "
-#define MSG_T_MIN " min: "
-#define MSG_T_MAX " max: "
-#define MSG_KU " Ku: "
-#define MSG_TU " Tu: "
-#define MSG_CLASSIC_PID " Classic PID "
-#define MSG_KP " Kp: "
-#define MSG_KI " Ki: "
-#define MSG_KD " Kd: "
-#define MSG_AT " @:"
-#define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE_PREFIX " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h"
-#define MSG_PID_DEBUG " PID_DEBUG "
-#define MSG_PID_DEBUG_INPUT ": Input "
-#define MSG_PID_DEBUG_OUTPUT " Output "
-#define MSG_PID_DEBUG_PTERM " pTerm "
-#define MSG_PID_DEBUG_ITERM " iTerm "
-#define MSG_PID_DEBUG_DTERM " dTerm "
-#define MSG_PID_DEBUG_CTERM " cTerm "
-#define MSG_INVALID_EXTRUDER_NUM " - Invalid extruder number !"
-
-#define MSG_HEATER_BED "bed"
-#define MSG_HEATER_CHAMBER "chamber"
-
-#define MSG_STOPPED_HEATER ", system stopped! Heater_ID: "
-#define MSG_REDUNDANCY "Heater switched off. Temperature difference between temp sensors is too high !"
-#define MSG_T_HEATING_FAILED "Heating failed"
-#define MSG_T_THERMAL_RUNAWAY "Thermal Runaway"
-#define MSG_T_MAXTEMP "MAXTEMP triggered"
-#define MSG_T_MINTEMP "MINTEMP triggered"
-#define MSG_ERR_PROBING_FAILED "Probing Failed"
-#define MSG_ZPROBE_OUT_SER "Z Probe Past Bed"
-
-// Debug
-#define MSG_DEBUG_PREFIX "DEBUG:"
-#define MSG_DEBUG_OFF "off"
-#define MSG_DEBUG_ECHO "ECHO"
-#define MSG_DEBUG_INFO "INFO"
-#define MSG_DEBUG_ERRORS "ERRORS"
-#define MSG_DEBUG_DRYRUN "DRYRUN"
-#define MSG_DEBUG_COMMUNICATION "COMMUNICATION"
-#define MSG_DEBUG_LEVELING "LEVELING"
-
-// LCD Menu Messages
-
-#define LANGUAGE_DATA_INCL_(M) STRINGIFY_(fontdata/langdata_##M.h)
-#define LANGUAGE_DATA_INCL(M) LANGUAGE_DATA_INCL_(M)
-
-#define LANGUAGE_INCL_(M) STRINGIFY_(../lcd/language/language_##M.h)
-#define LANGUAGE_INCL(M) LANGUAGE_INCL_(M)
-
-// Never translate these strings
-#define MSG_X "X"
-#define MSG_Y "Y"
-#define MSG_Z "Z"
-#define MSG_E "E"
-#if IS_KINEMATIC
- #define MSG_A "A"
- #define MSG_B "B"
- #define MSG_C "C"
-#else
- #define MSG_A "X"
- #define MSG_B "Y"
- #define MSG_C "Z"
-#endif
-#define MSG_X2 "X2"
-#define MSG_Y2 "Y2"
-#define MSG_Z2 "Z2"
-#define MSG_Z3 "Z3"
-
-#define LCD_STR_A MSG_A
-#define LCD_STR_B MSG_B
-#define LCD_STR_C MSG_C
-#define LCD_STR_E MSG_E
-
/**
* Tool indexes for LCD display only
*
@@ -356,6 +353,8 @@
#define LCD_STR_N3 "3"
#define LCD_STR_N4 "4"
#define LCD_STR_N5 "5"
+ #define LCD_STR_N6 "6"
+ #define LCD_STR_N7 "7"
#else
#define LCD_FIRST_TOOL '1'
#define LCD_STR_N0 "1"
@@ -364,6 +363,8 @@
#define LCD_STR_N3 "4"
#define LCD_STR_N4 "5"
#define LCD_STR_N5 "6"
+ #define LCD_STR_N6 "7"
+ #define LCD_STR_N7 "8"
#endif
#define LCD_STR_E0 "E" LCD_STR_N0
@@ -372,6 +373,8 @@
#define LCD_STR_E3 "E" LCD_STR_N3
#define LCD_STR_E4 "E" LCD_STR_N4
#define LCD_STR_E5 "E" LCD_STR_N5
+#define LCD_STR_E6 "E" LCD_STR_N6
+#define LCD_STR_E7 "E" LCD_STR_N7
#include "multi_language.h" // Allow multiple languages
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/core/macros.h b/firmware/marlin2.0 for Ender3/Marlin/src/core/macros.h
index f3c9f3a8..3bd27387 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/core/macros.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/core/macros.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,11 +16,15 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
+#if !defined(__has_include)
+ #define __has_include(...) 1
+#endif
+
#define ABCE 4
#define XYZE 4
#define ABC 3
@@ -29,12 +33,23 @@
#define _AXIS(A) (A##_AXIS)
-#define _XMIN_ 100
-#define _YMIN_ 200
-#define _ZMIN_ 300
-#define _XMAX_ 101
-#define _YMAX_ 201
-#define _ZMAX_ 301
+#define _XMIN_ 100
+#define _YMIN_ 200
+#define _ZMIN_ 300
+#define _XMAX_ 101
+#define _YMAX_ 201
+#define _ZMAX_ 301
+#define _XDIAG_ 102
+#define _YDIAG_ 202
+#define _ZDIAG_ 302
+#define _E0DIAG_ 400
+#define _E1DIAG_ 401
+#define _E2DIAG_ 402
+#define _E3DIAG_ 403
+#define _E4DIAG_ 404
+#define _E5DIAG_ 405
+#define _E6DIAG_ 406
+#define _E7DIAG_ 407
#define _FORCE_INLINE_ __attribute__((__always_inline__)) __inline__
#define FORCE_INLINE __attribute__((always_inline)) inline
@@ -61,13 +76,6 @@
// Nanoseconds per cycle
#define NANOSECONDS_PER_CYCLE (1000000000.0 / F_CPU)
-// Macros to make sprintf_P read from PROGMEM (AVR extension)
-#ifdef __AVR__
- #define S_FMT "%S"
-#else
- #define S_FMT "%s"
-#endif
-
// Macros to make a string from a macro
#define STRINGIFY_(M) #M
#define STRINGIFY(M) STRINGIFY_(M)
@@ -89,12 +97,15 @@
#define CBI(A,B) (A &= ~(1 << (B)))
#endif
+#define TBI(N,B) (N ^= _BV(B))
+
#define _BV32(b) (1UL << (b))
#define TEST32(n,b) !!((n)&_BV32(b))
#define SBI32(n,b) (n |= _BV32(b))
#define CBI32(n,b) (n &= ~_BV32(b))
+#define TBI32(N,B) (N ^= _BV32(B))
-#define cu(x) ((x)*(x)*(x))
+#define cu(x) ({__typeof__(x) _x = (x); (_x)*(_x)*(_x);})
#define RADIANS(d) ((d)*float(M_PI)/180.0f)
#define DEGREES(r) ((r)*180.0f/float(M_PI))
#define HYPOT2(x,y) (sq(x)+sq(y))
@@ -102,7 +113,7 @@
#define CIRCLE_AREA(R) (float(M_PI) * sq(float(R)))
#define CIRCLE_CIRC(R) (2 * float(M_PI) * float(R))
-#define SIGN(a) ((a>0)-(a<0))
+#define SIGN(a) ({__typeof__(a) _a = (a); (_a>0)-(_a<0);})
#define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1)))
// Macros to constrain values
@@ -122,8 +133,6 @@
#else
- // Using GCC extensions, but Travis GCC version does not like it and gives
- // "error: statement-expressions are not allowed outside functions nor in template-argument lists"
#define NOLESS(v, n) \
do{ \
__typeof__(n) _n = (n); \
@@ -166,18 +175,26 @@
// Macros to support option testing
#define _CAT(a,V...) a##V
#define CAT(a,V...) _CAT(a,V)
-#define SWITCH_ENABLED_false 0
-#define SWITCH_ENABLED_true 1
-#define SWITCH_ENABLED_0 0
-#define SWITCH_ENABLED_1 1
-#define SWITCH_ENABLED_0x0 0
-#define SWITCH_ENABLED_0x1 1
-#define SWITCH_ENABLED_ 1
-#define _ENA_1(O) _CAT(SWITCH_ENABLED_, O)
-#define _DIS_1(O) !_ENA_1(O)
+
+#define _ISENA_ ~,1
+#define _ISENA_1 ~,1
+#define _ISENA_0x1 ~,1
+#define _ISENA_true ~,1
+#define _ISENA(V...) IS_PROBE(V)
+
+#define _ENA_1(O) _ISENA(CAT(_IS,CAT(ENA_, O)))
+#define _DIS_1(O) NOT(_ENA_1(O))
#define ENABLED(V...) DO(ENA,&&,V)
#define DISABLED(V...) DO(DIS,&&,V)
+#define TERN(O,A,B) _TERN(_ENA_1(O),B,A) // OPTION converted to '0' or '1'
+#define TERN0(O,A) _TERN(_ENA_1(O),0,A) // OPTION converted to A or '0'
+#define TERN1(O,A) _TERN(_ENA_1(O),1,A) // OPTION converted to A or '1'
+#define TERN_(O,A) _TERN(_ENA_1(O),,A) // OPTION converted to A or ''
+#define _TERN(E,V...) __TERN(_CAT(T_,E),V) // Prepend 'T_' to get 'T_0' or 'T_1'
+#define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1'
+#define ___TERN(P,V...) THIRD(P,V) // If first argument has a comma, A. Else B.
+
#define ANY(V...) !DISABLED(V)
#define NONE(V...) DISABLED(V)
#define ALL(V...) ENABLED(V)
@@ -185,12 +202,14 @@
#define EITHER(V1,V2) ANY(V1,V2)
// Macros to support pins/buttons exist testing
-#define _PINEX_1(PN) (defined(PN##_PIN) && PN##_PIN >= 0)
-#define PIN_EXISTS(V...) DO(PINEX,&&,V)
+#define PIN_EXISTS(PN) (defined(PN##_PIN) && PN##_PIN >= 0)
+#define _PINEX_1 PIN_EXISTS
+#define PINS_EXIST(V...) DO(PINEX,&&,V)
#define ANY_PIN(V...) DO(PINEX,||,V)
-#define _BTNEX_1(BN) (defined(BTN_##BN) && BTN_##BN >= 0)
-#define BUTTON_EXISTS(V...) DO(BTNEX,&&,V)
+#define BUTTON_EXISTS(BN) (defined(BTN_##BN) && BTN_##BN >= 0)
+#define _BTNEX_1 BUTTON_EXISTS
+#define BUTTONS_EXIST(V...) DO(BTNEX,&&,V)
#define ANY_BUTTON(V...) DO(BTNEX,||,V)
#define WITHIN(N,L,H) ((N) >= (L) && (N) <= (H))
@@ -230,6 +249,11 @@
#define _JOIN_1(O) (O)
#define JOIN_N(N,C,V...) (DO(JOIN,C,LIST_N(N,V)))
+#define LOOP_S_LE_N(VAR, S, N) for (uint8_t VAR=(S); VAR<=(N); VAR++)
+#define LOOP_S_L_N(VAR, S, N) for (uint8_t VAR=(S); VAR<(N); VAR++)
+#define LOOP_LE_N(VAR, N) LOOP_S_LE_N(VAR, 0, N)
+#define LOOP_L_N(VAR, N) LOOP_S_L_N(VAR, 0, N)
+
#define NOOP (void(0))
#define CEILING(x,y) (((x) + (y) - 1) / (y))
@@ -246,7 +270,7 @@
#define NEAR(x,y) NEAR_ZERO((x)-(y))
#define RECIPROCAL(x) (NEAR_ZERO(x) ? 0 : (1 / float(x)))
-#define FIXFLOAT(f) (f + (f < 0 ? -0.00005f : 0.00005f))
+#define FIXFLOAT(f) ({__typeof__(f) _f = (f); _f + (_f < 0 ? -0.0000005f : 0.0000005f);})
//
// Maths macros that can be overridden by HAL
@@ -262,12 +286,6 @@
#define FMOD(x, y) fmodf(x, y)
#define HYPOT(x,y) SQRT(HYPOT2(x,y))
-#ifdef TARGET_LPC1768
- #define I2C_ADDRESS(A) ((A) << 1)
-#else
- #define I2C_ADDRESS(A) A
-#endif
-
// Use NUM_ARGS(__VA_ARGS__) to get the number of variadic arguments
#define _NUM_ARGS(_,Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A,OUT,...) OUT
#define NUM_ARGS(V...) _NUM_ARGS(0,V,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)
@@ -377,8 +395,9 @@
//
// Primitives supporting precompiler REPEAT
//
-#define FIRST(a,...) a
-#define SECOND(a,b,...) b
+#define FIRST(a,...) a
+#define SECOND(a,b,...) b
+#define THIRD(a,b,c,...) c
// Defer expansion
#define EMPTY()
@@ -446,3 +465,32 @@
// Repeat a macro passing 0...N-1 plus additional arguments.
#define REPEAT2_S(S,N,OP,V...) EVAL(_REPEAT2(S,SUB##S(N),OP,V))
#define REPEAT2(N,OP,V...) REPEAT2_S(0,N,OP,V)
+
+// Use RREPEAT macros with REPEAT macros for nesting
+#define _RREPEAT(_RPT_I,_RPT_N,_RPT_OP) \
+ _RPT_OP(_RPT_I) \
+ IF_ELSE(SUB1(_RPT_N)) \
+ ( DEFER2(__RREPEAT)()(ADD1(_RPT_I),SUB1(_RPT_N),_RPT_OP) ) \
+ ( /* Do nothing */ )
+#define __RREPEAT() _RREPEAT
+#define _RREPEAT2(_RPT_I,_RPT_N,_RPT_OP,V...) \
+ _RPT_OP(_RPT_I,V) \
+ IF_ELSE(SUB1(_RPT_N)) \
+ ( DEFER2(__RREPEAT2)()(ADD1(_RPT_I),SUB1(_RPT_N),_RPT_OP,V) ) \
+ ( /* Do nothing */ )
+#define __RREPEAT2() _RREPEAT2
+#define RREPEAT_S(S,N,OP) EVAL1024(_RREPEAT(S,SUB##S(N),OP))
+#define RREPEAT(N,OP) RREPEAT_S(0,N,OP)
+#define RREPEAT2_S(S,N,OP,V...) EVAL1024(_RREPEAT2(S,SUB##S(N),OP,V))
+#define RREPEAT2(N,OP,V...) RREPEAT2_S(0,N,OP,V)
+
+// See https://github.com/swansontec/map-macro
+#define MAP_OUT
+#define MAP_END(...)
+#define MAP_GET_END() 0, MAP_END
+#define MAP_NEXT0(test, next, ...) next MAP_OUT
+#define MAP_NEXT1(test, next) MAP_NEXT0 (test, next, 0)
+#define MAP_NEXT(test, next) MAP_NEXT1 (MAP_GET_END test, next)
+#define MAP0(f, x, peek, ...) f(x) MAP_NEXT (peek, MAP1) (f, peek, __VA_ARGS__)
+#define MAP1(f, x, peek, ...) f(x) MAP_NEXT (peek, MAP0) (f, peek, __VA_ARGS__)
+#define MAP(f, ...) EVAL512 (MAP1 (f, __VA_ARGS__, (), 0))
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/core/millis_t.h b/firmware/marlin2.0 for Ender3/Marlin/src/core/millis_t.h
index 7ff231f8..95bc40e1 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/core/millis_t.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/core/millis_t.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -25,5 +25,9 @@
typedef uint32_t millis_t;
+#define SEC_TO_MS(N) millis_t((N)*1000UL)
+#define MIN_TO_MS(N) SEC_TO_MS((N)*60UL)
+#define MS_TO_SEC(N) millis_t((N)/1000UL)
+
#define PENDING(NOW,SOON) ((int32_t)(NOW-(SOON))<0)
#define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON))
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/core/multi_language.h b/firmware/marlin2.0 for Ender3/Marlin/src/core/multi_language.h
index 98020b1e..5852c439 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/core/multi_language.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/core/multi_language.h
@@ -16,13 +16,13 @@
* GNU General Public License for more details. *
* *
* To view a copy of the GNU General Public License, go to the following *
- * location: . *
+ * location: . *
****************************************************************************/
#pragma once
typedef const char Language_Str[];
-#if defined(LCD_LANGUAGE_5)
+#ifdef LCD_LANGUAGE_5
#define NUM_LANGUAGES 5
#elif defined(LCD_LANGUAGE_4)
#define NUM_LANGUAGES 4
@@ -76,4 +76,8 @@ typedef const char Language_Str[];
#endif
#define GET_TEXT_F(MSG) (const __FlashStringHelper*)GET_TEXT(MSG)
-#define MSG_CONCAT(A,B) pgm_p_pair_t(GET_TEXT(A),GET_TEXT(B))
+#define GET_LANGUAGE_NAME(INDEX) GET_LANG(LCD_LANGUAGE_##INDEX)::LANGUAGE
+
+#define MSG_1_LINE(A) A "\0" "\0"
+#define MSG_2_LINE(A,B) A "\0" B "\0"
+#define MSG_3_LINE(A,B,C) A "\0" B "\0" C
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/core/serial.cpp b/firmware/marlin2.0 for Ender3/Marlin/src/core/serial.cpp
index 4a5214f5..77854d0f 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/core/serial.cpp
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/core/serial.cpp
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,20 +16,20 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#include "serial.h"
-#include "language.h"
+#include "../inc/MarlinConfig.h"
uint8_t marlin_debug_flags = MARLIN_DEBUG_NONE;
-static const char errormagic[] PROGMEM = "Error:";
-static const char echomagic[] PROGMEM = "echo:";
+static PGMSTR(errormagic, "Error:");
+static PGMSTR(echomagic, "echo:");
-#if NUM_SERIAL > 1
- int8_t serial_port_index = SERIAL_PORT;
+#if HAS_MULTI_SERIAL
+ int8_t serial_port_index = 0;
#endif
void serialprintPGM(PGM_P str) {
@@ -42,8 +42,8 @@ void serial_echopair_PGM(PGM_P const s_P, const char *v) { serialprintPGM(s_P)
void serial_echopair_PGM(PGM_P const s_P, char v) { serialprintPGM(s_P); SERIAL_CHAR(v); }
void serial_echopair_PGM(PGM_P const s_P, int v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
void serial_echopair_PGM(PGM_P const s_P, long v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
-void serial_echopair_PGM(PGM_P const s_P, float v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
-void serial_echopair_PGM(PGM_P const s_P, double v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
+void serial_echopair_PGM(PGM_P const s_P, float v) { serialprintPGM(s_P); SERIAL_DECIMAL(v); }
+void serial_echopair_PGM(PGM_P const s_P, double v) { serialprintPGM(s_P); SERIAL_DECIMAL(v); }
void serial_echopair_PGM(PGM_P const s_P, unsigned int v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
void serial_echopair_PGM(PGM_P const s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
@@ -54,16 +54,14 @@ void serial_ternary(const bool onoff, PGM_P const pre, PGM_P const on, PGM_P con
serialprintPGM(onoff ? on : off);
if (post) serialprintPGM(post);
}
-void serialprint_onoff(const bool onoff) { serialprintPGM(onoff ? PSTR(MSG_ON) : PSTR(MSG_OFF)); }
+void serialprint_onoff(const bool onoff) { serialprintPGM(onoff ? PSTR(STR_ON) : PSTR(STR_OFF)); }
void serialprintln_onoff(const bool onoff) { serialprint_onoff(onoff); SERIAL_EOL(); }
void serialprint_truefalse(const bool tf) { serialprintPGM(tf ? PSTR("true") : PSTR("false")); }
-void print_bin(const uint16_t val) {
- uint16_t mask = 0x8000;
+void print_bin(uint16_t val) {
for (uint8_t i = 16; i--;) {
- if (i && !(i % 4)) SERIAL_CHAR(' ');
- SERIAL_CHAR((val & mask) ? '1' : '0');
- mask >>= 1;
+ SERIAL_CHAR('0' + TEST(val, i));
+ if (!(i & 0x3) && i) SERIAL_CHAR(' ');
}
}
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/core/serial.h b/firmware/marlin2.0 for Ender3/Marlin/src/core/serial.h
index bdf3ba46..fc830736 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/core/serial.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/core/serial.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -47,14 +47,20 @@ extern uint8_t marlin_debug_flags;
#define DEBUGGING(F) (marlin_debug_flags & (MARLIN_DEBUG_## F))
#define SERIAL_BOTH 0x7F
-#if NUM_SERIAL > 1
+#if HAS_MULTI_SERIAL
extern int8_t serial_port_index;
#define _PORT_REDIRECT(n,p) REMEMBER(n,serial_port_index,p)
#define _PORT_RESTORE(n) RESTORE(n)
- #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); \
- }while(0)
+
+ #ifdef SERIAL_CATCHALL
+ #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); \
+ }while(0)
+ #endif
+
#define SERIAL_ASSERT(P) if(serial_port_index!=(P)){ debugger(); }
#else
#define _PORT_REDIRECT(n,p) NOOP
@@ -66,7 +72,6 @@ extern uint8_t marlin_debug_flags;
#define PORT_REDIRECT(p) _PORT_REDIRECT(1,p)
#define PORT_RESTORE() _PORT_RESTORE(1)
-#define SERIAL_CHAR(x) SERIAL_OUT(write, x)
#define SERIAL_ECHO(x) SERIAL_OUT(print, x)
#define SERIAL_ECHO_F(V...) SERIAL_OUT(print, V)
#define SERIAL_ECHOLN(x) SERIAL_OUT(println, x)
@@ -83,6 +88,22 @@ extern uint8_t marlin_debug_flags;
#define SERIAL_FLUSHTX()
#endif
+// Print up to 10 chars from a list
+#define __CHAR_N(N,V...) _CHAR_##N(V)
+#define _CHAR_N(N,V...) __CHAR_N(N,V)
+#define _CHAR_1(c) SERIAL_OUT(write, c)
+#define _CHAR_2(a,b) do{ _CHAR_1(a); _CHAR_1(b); }while(0)
+#define _CHAR_3(a,V...) do{ _CHAR_1(a); _CHAR_2(V); }while(0)
+#define _CHAR_4(a,V...) do{ _CHAR_1(a); _CHAR_3(V); }while(0)
+#define _CHAR_5(a,V...) do{ _CHAR_1(a); _CHAR_4(V); }while(0)
+#define _CHAR_6(a,V...) do{ _CHAR_1(a); _CHAR_5(V); }while(0)
+#define _CHAR_7(a,V...) do{ _CHAR_1(a); _CHAR_6(V); }while(0)
+#define _CHAR_8(a,V...) do{ _CHAR_1(a); _CHAR_7(V); }while(0)
+#define _CHAR_9(a,V...) do{ _CHAR_1(a); _CHAR_8(V); }while(0)
+#define _CHAR_10(a,V...) do{ _CHAR_1(a); _CHAR_9(V); }while(0)
+
+#define SERIAL_CHAR(V...) _CHAR_N(NUM_ARGS(V),V)
+
// Print up to 12 pairs of values. Odd elements auto-wrapped in PSTR().
#define __SEP_N(N,V...) _SEP_##N(V)
#define _SEP_N(N,V...) __SEP_N(N,V)
@@ -169,7 +190,13 @@ extern uint8_t marlin_debug_flags;
#define _SELP_21(a,b,V...) do{ _SEP_2(a,b); _SELP_19(V); }while(0)
#define _SELP_22(a,b,V...) do{ _SEP_2(a,b); _SELP_20(V); }while(0)
#define _SELP_23(a,b,V...) do{ _SEP_2(a,b); _SELP_21(V); }while(0)
-#define _SELP_24(a,b,V...) do{ _SEP_2(a,b); _SELP_22(V); }while(0) // Eat two args, pass the rest up
+#define _SELP_24(a,b,V...) do{ _SEP_2(a,b); _SELP_22(V); }while(0)
+#define _SELP_25(a,b,V...) do{ _SEP_2(a,b); _SELP_23(V); }while(0)
+#define _SELP_26(a,b,V...) do{ _SEP_2(a,b); _SELP_24(V); }while(0)
+#define _SELP_27(a,b,V...) do{ _SEP_2(a,b); _SELP_25(V); }while(0)
+#define _SELP_28(a,b,V...) do{ _SEP_2(a,b); _SELP_26(V); }while(0)
+#define _SELP_29(a,b,V...) do{ _SEP_2(a,b); _SELP_27(V); }while(0)
+#define _SELP_30(a,b,V...) do{ _SEP_2(a,b); _SELP_28(V); }while(0) // Eat two args, pass the rest up
#define SERIAL_ECHOLNPAIR(V...) _SELP_N(NUM_ARGS(V),V)
@@ -199,7 +226,13 @@ extern uint8_t marlin_debug_flags;
#define _SELP_21_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_19_P(V); }while(0)
#define _SELP_22_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_20_P(V); }while(0)
#define _SELP_23_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_21_P(V); }while(0)
-#define _SELP_24_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_22_P(V); }while(0) // Eat two args, pass the rest up
+#define _SELP_24_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_22_P(V); }while(0)
+#define _SELP_25_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_23_P(V); }while(0)
+#define _SELP_26_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_24_P(V); }while(0)
+#define _SELP_27_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_25_P(V); }while(0)
+#define _SELP_28_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_26_P(V); }while(0)
+#define _SELP_29_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_27_P(V); }while(0)
+#define _SELP_30_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_28_P(V); }while(0) // Eat two args, pass the rest up
#define SERIAL_ECHOLNPAIR_P(V...) _SELP_N_P(NUM_ARGS(V),V)
@@ -230,10 +263,11 @@ extern uint8_t marlin_debug_flags;
#define SERIAL_ECHOLIST(pre,V...) do{ SERIAL_ECHOPGM(pre); _SLST_N(NUM_ARGS(V),V); }while(0)
#define SERIAL_ECHOLIST_N(N,V...) _SLST_N(N,LIST_N(N,V))
-#define SERIAL_ECHO_P(P) (serialprintPGM(P))
+#define SERIAL_ECHOPGM_P(P) (serialprintPGM(P))
+#define SERIAL_ECHOLNPGM_P(P) (serialprintPGM(P "\n"))
-#define SERIAL_ECHOPGM(S) (SERIAL_ECHO_P(PSTR(S)))
-#define SERIAL_ECHOLNPGM(S) (SERIAL_ECHO_P(PSTR(S "\n")))
+#define SERIAL_ECHOPGM(S) (serialprintPGM(PSTR(S)))
+#define SERIAL_ECHOLNPGM(S) (serialprintPGM(PSTR(S "\n")))
#define SERIAL_ECHOPAIR_F_P(P,V...) do{ serialprintPGM(P); SERIAL_ECHO_F(V); }while(0)
#define SERIAL_ECHOLNPAIR_F_P(V...) do{ SERIAL_ECHOPAIR_F_P(V); SERIAL_EOL(); }while(0)
@@ -245,13 +279,19 @@ extern uint8_t marlin_debug_flags;
#define SERIAL_ERROR_START() serial_error_start()
#define SERIAL_EOL() SERIAL_CHAR('\n')
-#define SERIAL_ECHO_MSG(S) do{ SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(S); }while(0)
-#define SERIAL_ERROR_MSG(S) do{ SERIAL_ERROR_START(); SERIAL_ECHOLNPGM(S); }while(0)
+#define SERIAL_ECHO_MSG(V...) do{ SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(V); }while(0)
+#define SERIAL_ERROR_MSG(V...) do{ SERIAL_ERROR_START(); SERIAL_ECHOLNPAIR(V); }while(0)
#define SERIAL_ECHO_SP(C) serial_spaces(C)
#define SERIAL_ECHO_TERNARY(TF, PRE, ON, OFF, POST) serial_ternary(TF, PSTR(PRE), PSTR(ON), PSTR(OFF), PSTR(POST))
+#if SERIAL_FLOAT_PRECISION
+ #define SERIAL_DECIMAL(V) SERIAL_PRINT(V, SERIAL_FLOAT_PRECISION)
+#else
+ #define SERIAL_DECIMAL(V) SERIAL_ECHO(V)
+#endif
+
//
// Functions for serial printing from PROGMEM. (Saves loads of SRAM.)
//
@@ -277,7 +317,6 @@ void serialprint_truefalse(const bool tf);
void serial_spaces(uint8_t count);
void print_bin(const uint16_t val);
-
void print_xyz(const float &x, const float &y, const float &z, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr);
inline void print_xyz(const xyz_pos_t &xyz, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr) {
diff --git a/firmware/marlin2.0 for Ender3/Marlin/src/core/types.h b/firmware/marlin2.0 for Ender3/Marlin/src/core/types.h
index 72578faa..a5b78caa 100644
--- a/firmware/marlin2.0 for Ender3/Marlin/src/core/types.h
+++ b/firmware/marlin2.0 for Ender3/Marlin/src/core/types.h
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
- * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -16,7 +16,7 @@
* 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 .
+ * along with this program. If not, see .
*
*/
#pragma once
@@ -24,7 +24,7 @@
#include
#include
-#include "millis_t.h"
+#include "../inc/MarlinConfigPre.h"
class __FlashStringHelper;
typedef const __FlashStringHelper *progmem_str;
@@ -43,23 +43,13 @@ enum AxisEnum : uint8_t {
E_AXIS = 3,
X_HEAD = 4, Y_HEAD = 5, Z_HEAD = 6,
E0_AXIS = 3,
- E1_AXIS = 4,
- E2_AXIS = 5,
- E3_AXIS = 6,
- E4_AXIS = 7,
- E5_AXIS = 8,
+ E1_AXIS, E2_AXIS, E3_AXIS, E4_AXIS, E5_AXIS, E6_AXIS, E7_AXIS,
ALL_AXES = 0xFE, NO_AXIS = 0xFF
};
//
// Loop over XYZE axes
//
-
-#define LOOP_S_LE_N(VAR, S, N) for (uint8_t VAR=(S); VAR<=(N); VAR++)
-#define LOOP_S_L_N(VAR, S, N) for (uint8_t VAR=(S); VAR<(N); VAR++)
-#define LOOP_LE_N(VAR, N) LOOP_S_LE_N(VAR, 0, N)
-#define LOOP_L_N(VAR, N) LOOP_S_L_N(VAR, 0, N)
-
#define LOOP_XYZ(VAR) LOOP_S_LE_N(VAR, X_AXIS, Z_AXIS)
#define LOOP_XYZE(VAR) LOOP_S_LE_N(VAR, X_AXIS, E_AXIS)
#define LOOP_XYZE_N(VAR) LOOP_S_L_N(VAR, X_AXIS, XYZE_N)
@@ -191,6 +181,12 @@ struct XYval {
};
FI void set(const T px) { x = px; }
FI void set(const T px, const T py) { x = px; y = py; }
+ FI void set(const T (&arr)[XY]) { x = arr[0]; y = arr[1]; }
+ FI void set(const T (&arr)[XYZ]) { x = arr[0]; y = arr[1]; }
+ FI void set(const T (&arr)[XYZE]) { x = arr[0]; y = arr[1]; }
+ #if XYZE_N > XYZE
+ FI void set(const T (&arr)[XYZE_N]) { x = arr[0]; y = arr[1]; }
+ #endif
FI void reset() { x = y = 0; }
FI T magnitude() const { return (T)sqrtf(x*x + y*y); }
FI operator T* () { return pos; }
@@ -201,6 +197,8 @@ struct XYval {
FI XYval asInt() const { return { int16_t(x), int16_t(y) }; }
FI XYval asLong() { return { int32_t(x), int32_t(y) }; }
FI XYval asLong() const { return { int32_t(x), int32_t(y) }; }
+ FI XYval ROUNDL() { return { int32_t(LROUND(x)), int32_t(LROUND(y)) }; }
+ FI XYval ROUNDL() const { return { int32_t(LROUND(x)), int32_t(LROUND(y)) }; }
FI XYval asFloat() { return { float(x), float(y) }; }
FI XYval asFloat() const { return { float(x), float(y) }; }
FI XYval reciprocal() const { return { _RECIP(x), _RECIP(y) }; }
@@ -294,6 +292,12 @@ struct XYZval {
FI void set(const T px, const T py) { x = px; y = py; }
FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; }
FI void set(const XYval pxy, const T pz) { x = pxy.x; y = pxy.y; z = pz; }
+ FI void set(const T (&arr)[XY]) { x = arr[0]; y = arr[1]; }
+ FI void set(const T (&arr)[XYZ]) { x = arr[0]; y = arr[1]; z = arr[2]; }
+ FI void set(const T (&arr)[XYZE]) { x = arr[0]; y = arr[1]; z = arr[2]; }
+ #if XYZE_N > XYZE
+ FI void set(const T (&arr)[XYZE_N]) { x = arr[0]; y = arr[1]; z = arr[2]; }
+ #endif
FI void reset() { x = y = z = 0; }
FI T magnitude() const { return (T)sqrtf(x*x + y*y + z*z); }
FI operator T* () { return pos; }
@@ -304,6 +308,8 @@ struct XYZval {
FI XYZval asInt() const { return { int16_t(x), int16_t(y), int16_t(z) }; }
FI XYZval asLong() { return { int32_t(x), int32_t(y), int32_t(z) }; }
FI XYZval asLong() const { return { int32_t(x), int32_t(y), int32_t(z) }; }
+ FI XYZval ROUNDL() { return { int32_t(LROUND(x)), int32_t(LROUND(y)), int32_t(LROUND(z)) }; }
+ FI XYZval ROUNDL() const { return { int32_t(LROUND(x)), int32_t(LROUND(y)), int32_t(LROUND(z)) }; }
FI XYZval asFloat() { return { float(x), float(y), float(z) }; }
FI XYZval asFloat() const { return { float(x), float(y), float(z) }; }
FI XYZval reciprocal() const { return { _RECIP(x), _RECIP(y), _RECIP(z) }; }
@@ -341,14 +347,14 @@ struct XYZval {
FI XYZval operator* (const XYZEval &rs) { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; }
FI XYZval operator/ (const XYZEval &rs) const { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; }
FI XYZval operator/ (const XYZEval &rs) { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; }
- FI XYZval operator* (const float &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; }
- FI XYZval operator* (const float &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; }
- FI XYZval operator* (const int &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; }
- FI XYZval operator* (const int &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; }
- FI XYZval operator/ (const float &v) const { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; }
- FI XYZval operator/ (const float &v) { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; }
- FI XYZval operator/ (const int &v) const { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; }
- FI XYZval operator/ (const int &v) { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; }
+ FI XYZval operator* (const float &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; return ls; }
+ FI XYZval operator* (const float &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; return ls; }
+ FI XYZval operator* (const int &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; return ls; }
+ FI XYZval operator* (const int &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; return ls; }
+ FI XYZval operator/ (const float &v) const { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; return ls; }
+ FI XYZval operator/ (const float &v) { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; return ls; }
+ FI XYZval operator/ (const int &v) const { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; return ls; }
+ FI XYZval operator/ (const int &v) { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; return ls; }
FI XYZval operator>>(const int &v) const { XYZval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); return ls; }
FI XYZval operator>>(const int &v) { XYZval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); return ls; }
FI XYZval operator<<(const int &v) const { XYZval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); return ls; }
@@ -401,12 +407,20 @@ struct XYZEval {
FI void set(const XYval pxy, const T pz, const T pe) { x = pxy.x; y = pxy.y; z = pz; e = pe; }
FI void set(const XYval pxy, const XYval pze) { x = pxy.x; y = pxy.y; z = pze.z; e = pze.e; }
FI void set(const XYZval pxyz, const T pe) { x = pxyz.x; y = pxyz.y; z = pxyz.z; e = pe; }
+ FI void set(const T (&arr)[XY]) { x = arr[0]; y = arr[1]; }
+ FI void set(const T (&arr)[XYZ]) { x = arr[0]; y = arr[1]; z = arr[2]; }
+ FI void set(const T (&arr)[XYZE]) { x = arr[0]; y = arr[1]; z = arr[2]; e = arr[3]; }
+ #if XYZE_N > XYZE
+ FI void set(const T (&arr)[XYZE_N]) { x = arr[0]; y = arr[1]; z = arr[2]; e = arr[3]; }
+ #endif
FI XYZEval copy() const { return *this; }
FI XYZEval ABS() const { return { T(_ABS(x)), T(_ABS(y)), T(_ABS(z)), T(_ABS(e)) }; }
FI XYZEval asInt() { return { int16_t(x), int16_t(y), int16_t(z), int16_t(e) }; }
FI XYZEval asInt() const { return { int16_t(x), int16_t(y), int16_t(z), int16_t(e) }; }
- FI XYZEval asLong() const { return { int32_t(x), int32_t(y), int32_t(z), int32_t(e) }; }
FI XYZEval asLong() { return { int32_t(x), int32_t(y), int32_t(z), int32_t(e) }; }
+ FI XYZEval asLong() const { return { int32_t(x), int32_t(y), int32_t(z), int32_t(e) }; }
+ FI XYZEval