From 69917690f3ca522f927b9dd000f59c65a8d2149f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 2 Oct 2020 17:05:45 -0500 Subject: [PATCH] Adjust HAL platform defines, comments --- Marlin/src/HAL/DUE/HAL.cpp | 4 +--- Marlin/src/HAL/DUE/HAL.h | 4 +--- Marlin/src/HAL/DUE/HAL_SPI.cpp | 2 +- Marlin/src/HAL/DUE/timers.cpp | 4 +--- Marlin/src/HAL/DUE/timers.h | 4 +--- Marlin/src/HAL/ESP32/HAL.h | 2 +- Marlin/src/HAL/TEENSY31_32/HAL.cpp | 3 +-- Marlin/src/HAL/TEENSY31_32/HAL.h | 7 ++++--- Marlin/src/HAL/TEENSY31_32/Servo.cpp | 1 - Marlin/src/HAL/TEENSY31_32/eeprom.cpp | 3 +-- Marlin/src/HAL/TEENSY31_32/timers.cpp | 2 +- Marlin/src/HAL/TEENSY31_32/timers.h | 3 +-- Marlin/src/HAL/TEENSY35_36/HAL.cpp | 2 +- Marlin/src/HAL/TEENSY35_36/HAL.h | 11 +++++------ Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp | 5 +++++ Marlin/src/HAL/TEENSY35_36/Servo.cpp | 6 +++++- Marlin/src/HAL/TEENSY35_36/Servo.h | 4 ++++ Marlin/src/HAL/TEENSY35_36/eeprom.cpp | 9 ++++----- Marlin/src/HAL/TEENSY35_36/endstop_interrupts.h | 2 +- Marlin/src/HAL/TEENSY35_36/pinsDebug.h | 4 ++++ Marlin/src/HAL/TEENSY35_36/spi_pins.h | 4 ++++ Marlin/src/HAL/TEENSY35_36/timers.cpp | 3 +-- Marlin/src/HAL/TEENSY35_36/timers.h | 4 +--- Marlin/src/HAL/TEENSY40_41/HAL.cpp | 2 +- Marlin/src/HAL/TEENSY40_41/HAL.h | 7 ++++--- Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp | 5 +++++ Marlin/src/HAL/TEENSY40_41/Servo.cpp | 6 +++++- Marlin/src/HAL/TEENSY40_41/Servo.h | 4 ++++ Marlin/src/HAL/TEENSY40_41/eeprom.cpp | 3 +-- Marlin/src/HAL/TEENSY40_41/endstop_interrupts.h | 2 +- Marlin/src/HAL/TEENSY40_41/fastio.h | 2 +- Marlin/src/HAL/TEENSY40_41/pinsDebug.h | 4 ++++ Marlin/src/HAL/TEENSY40_41/spi_pins.h | 4 ++++ Marlin/src/HAL/TEENSY40_41/timers.cpp | 2 +- Marlin/src/HAL/TEENSY40_41/timers.h | 3 +-- Marlin/src/HAL/TEENSY40_41/watchdog.cpp | 6 +++++- Marlin/src/HAL/TEENSY40_41/watchdog.h | 2 +- Marlin/src/gcode/calibrate/M100.cpp | 2 +- Marlin/src/pins/teensy3/pins_TEENSY31_32.h | 2 +- Marlin/src/pins/teensy3/pins_TEENSY35_36.h | 2 +- Marlin/src/pins/teensy4/pins_T41U5XBB.h | 6 +++--- Marlin/src/pins/teensy4/pins_TEENSY41.h | 6 +++--- Marlin/src/sd/Sd2Card.h | 8 +++----- Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h | 13 +++++++------ README.md | 4 ++-- 45 files changed, 108 insertions(+), 80 deletions(-) diff --git a/Marlin/src/HAL/DUE/HAL.cpp b/Marlin/src/HAL/DUE/HAL.cpp index 4b9260c359..6ce85a4643 100644 --- a/Marlin/src/HAL/DUE/HAL.cpp +++ b/Marlin/src/HAL/DUE/HAL.cpp @@ -19,9 +19,7 @@ */ /** - * Description: HAL for Arduino Due and compatible (SAM3X8E) - * - * For ARDUINO_ARCH_SAM + * HAL for Arduino Due and compatible (SAM3X8E) */ #ifdef ARDUINO_ARCH_SAM diff --git a/Marlin/src/HAL/DUE/HAL.h b/Marlin/src/HAL/DUE/HAL.h index 7a057fdae4..dbb84e2ac7 100644 --- a/Marlin/src/HAL/DUE/HAL.h +++ b/Marlin/src/HAL/DUE/HAL.h @@ -22,9 +22,7 @@ #pragma once /** - * Description: HAL for Arduino Due and compatible (SAM3X8E) - * - * For ARDUINO_ARCH_SAM + * HAL for Arduino Due and compatible (SAM3X8E) */ #define CPU_32_BIT diff --git a/Marlin/src/HAL/DUE/HAL_SPI.cpp b/Marlin/src/HAL/DUE/HAL_SPI.cpp index 54ae8eceb1..0451d8bcc4 100644 --- a/Marlin/src/HAL/DUE/HAL_SPI.cpp +++ b/Marlin/src/HAL/DUE/HAL_SPI.cpp @@ -30,7 +30,7 @@ */ /** - * Description: HAL for Arduino Due and compatible (SAM3X8E) + * HAL for Arduino Due and compatible (SAM3X8E) * * For ARDUINO_ARCH_SAM */ diff --git a/Marlin/src/HAL/DUE/timers.cpp b/Marlin/src/HAL/DUE/timers.cpp index 795cdad66a..9b937d1a7c 100644 --- a/Marlin/src/HAL/DUE/timers.cpp +++ b/Marlin/src/HAL/DUE/timers.cpp @@ -21,9 +21,7 @@ */ /** - * Description: HAL for Arduino Due and compatible (SAM3X8E) - * - * For ARDUINO_ARCH_SAM + * HAL Timers for Arduino Due and compatible (SAM3X8E) */ #ifdef ARDUINO_ARCH_SAM diff --git a/Marlin/src/HAL/DUE/timers.h b/Marlin/src/HAL/DUE/timers.h index 9defe39a0a..0e1ea07cc2 100644 --- a/Marlin/src/HAL/DUE/timers.h +++ b/Marlin/src/HAL/DUE/timers.h @@ -21,9 +21,7 @@ #pragma once /** - * HAL for Arduino Due and compatible (SAM3X8E) - * - * For ARDUINO_ARCH_SAM + * HAL Timers for Arduino Due and compatible (SAM3X8E) */ #include diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h index f6fa46dd93..aa3bcc775d 100644 --- a/Marlin/src/HAL/ESP32/HAL.h +++ b/Marlin/src/HAL/ESP32/HAL.h @@ -20,7 +20,7 @@ #pragma once /** - * Description: HAL for Espressif ESP32 WiFi + * HAL for Espressif ESP32 WiFi */ #define CPU_32_BIT diff --git a/Marlin/src/HAL/TEENSY31_32/HAL.cpp b/Marlin/src/HAL/TEENSY31_32/HAL.cpp index d276a4c880..8c3dd83377 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL.cpp +++ b/Marlin/src/HAL/TEENSY31_32/HAL.cpp @@ -20,9 +20,8 @@ * */ - /** - * Description: HAL for Teensy32 (MK20DX256) + * HAL for Teensy 3.2 (MK20DX256) */ #ifdef __MK20DX256__ diff --git a/Marlin/src/HAL/TEENSY31_32/HAL.h b/Marlin/src/HAL/TEENSY31_32/HAL.h index 31ceb8b87c..b434b9de76 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL.h +++ b/Marlin/src/HAL/TEENSY31_32/HAL.h @@ -22,7 +22,7 @@ #pragma once /** - * Description: HAL for Teensy 3.5 and Teensy 3.6 + * HAL for Teensy 3.2 (MK20DX256) */ #define CPU_32_BIT @@ -44,8 +44,9 @@ //#undef MOTHERBOARD //#define MOTHERBOARD BOARD_TEENSY31_32 -#ifdef __MK20DX256__ - #define IS_32BIT_TEENSY 1 +#define IS_32BIT_TEENSY 1 +#define IS_TEENSY_31_32 1 +#ifndef IS_TEENSY31 #define IS_TEENSY32 1 #endif diff --git a/Marlin/src/HAL/TEENSY31_32/Servo.cpp b/Marlin/src/HAL/TEENSY31_32/Servo.cpp index 544892cb7d..19d57cf1b3 100644 --- a/Marlin/src/HAL/TEENSY31_32/Servo.cpp +++ b/Marlin/src/HAL/TEENSY31_32/Servo.cpp @@ -51,5 +51,4 @@ void libServo::move(const int value) { } #endif // HAS_SERVOS - #endif // __MK20DX256__ diff --git a/Marlin/src/HAL/TEENSY31_32/eeprom.cpp b/Marlin/src/HAL/TEENSY31_32/eeprom.cpp index f663132255..cc5c56f7d5 100644 --- a/Marlin/src/HAL/TEENSY31_32/eeprom.cpp +++ b/Marlin/src/HAL/TEENSY31_32/eeprom.cpp @@ -23,8 +23,7 @@ #if USE_WIRED_EEPROM /** - * PersistentStore for Arduino-style EEPROM interface - * with implementations supplied by the framework. + * HAL PersistentStore for Teensy 3.2 (MK20DX256) */ #include "../shared/eeprom_api.h" diff --git a/Marlin/src/HAL/TEENSY31_32/timers.cpp b/Marlin/src/HAL/TEENSY31_32/timers.cpp index bf756af8a1..7e01a38f89 100644 --- a/Marlin/src/HAL/TEENSY31_32/timers.cpp +++ b/Marlin/src/HAL/TEENSY31_32/timers.cpp @@ -21,7 +21,7 @@ */ /** - * Teensy3.2 __MK20DX256__ + * HAL Timers for Teensy 3.2 (MK20DX256) */ #ifdef __MK20DX256__ diff --git a/Marlin/src/HAL/TEENSY31_32/timers.h b/Marlin/src/HAL/TEENSY31_32/timers.h index 4f004ef751..135b328830 100644 --- a/Marlin/src/HAL/TEENSY31_32/timers.h +++ b/Marlin/src/HAL/TEENSY31_32/timers.h @@ -22,8 +22,7 @@ #pragma once /** - * Description: HAL for - * Teensy3.2 (__MK20DX256__) + * HAL Timers for Teensy 3.2 (MK20DX256) */ #include diff --git a/Marlin/src/HAL/TEENSY35_36/HAL.cpp b/Marlin/src/HAL/TEENSY35_36/HAL.cpp index bcbee1d4c5..92907353b8 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL.cpp +++ b/Marlin/src/HAL/TEENSY35_36/HAL.cpp @@ -21,7 +21,7 @@ */ /** - * Description: HAL for Teensy35 (MK64FX512) + * HAL for Teensy 3.5 (MK64FX512) and Teensy 3.6 (MK66FX1M0) */ #if defined(__MK64FX512__) || defined(__MK66FX1M0__) diff --git a/Marlin/src/HAL/TEENSY35_36/HAL.h b/Marlin/src/HAL/TEENSY35_36/HAL.h index 11f0fb941e..f454e7af51 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL.h +++ b/Marlin/src/HAL/TEENSY35_36/HAL.h @@ -22,7 +22,7 @@ #pragma once /** - * Description: HAL for Teensy 3.5 and Teensy 3.6 + * HAL for Teensy 3.5 (MK64FX512) and Teensy 3.6 (MK66FX1M0) */ #define CPU_32_BIT @@ -45,13 +45,12 @@ // Defines // ------------------------ -#ifdef __MK64FX512__ - #define IS_32BIT_TEENSY 1 - #define IS_TEENSY35 1 -#endif +#define IS_32BIT_TEENSY 1 +#define IS_TEENSY_35_36 1 #ifdef __MK66FX1M0__ - #define IS_32BIT_TEENSY 1 #define IS_TEENSY36 1 +#else // __MK64FX512__ + #define IS_TEENSY35 1 #endif #define _MSERIAL(X) Serial##X diff --git a/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp index 812aa90c83..b36900a321 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp @@ -19,6 +19,11 @@ * along with this program. If not, see . * */ + +/** + * HAL SPI for Teensy 3.5 (MK64FX512) and Teensy 3.6 (MK66FX1M0) + */ + #if defined(__MK64FX512__) || defined(__MK66FX1M0__) #include "HAL.h" diff --git a/Marlin/src/HAL/TEENSY35_36/Servo.cpp b/Marlin/src/HAL/TEENSY35_36/Servo.cpp index d1390187a7..033858594f 100644 --- a/Marlin/src/HAL/TEENSY35_36/Servo.cpp +++ b/Marlin/src/HAL/TEENSY35_36/Servo.cpp @@ -19,6 +19,11 @@ * along with this program. If not, see . * */ + +/** + * HAL Servo for Teensy 3.5 (MK64FX512) and Teensy 3.6 (MK66FX1M0) + */ + #if defined(__MK64FX512__) || defined(__MK66FX1M0__) #include "../../inc/MarlinConfig.h" @@ -51,5 +56,4 @@ void libServo::move(const int value) { } #endif // HAS_SERVOS - #endif // __MK64FX512__ || __MK66FX1M0__ diff --git a/Marlin/src/HAL/TEENSY35_36/Servo.h b/Marlin/src/HAL/TEENSY35_36/Servo.h index ae904f0e2e..719011f102 100644 --- a/Marlin/src/HAL/TEENSY35_36/Servo.h +++ b/Marlin/src/HAL/TEENSY35_36/Servo.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * HAL Servo for Teensy 3.5 (MK64FX512) and Teensy 3.6 (MK66FX1M0) + */ + #include // Inherit and expand on core Servo library diff --git a/Marlin/src/HAL/TEENSY35_36/eeprom.cpp b/Marlin/src/HAL/TEENSY35_36/eeprom.cpp index d2d7324cdd..ccbdc6b116 100644 --- a/Marlin/src/HAL/TEENSY35_36/eeprom.cpp +++ b/Marlin/src/HAL/TEENSY35_36/eeprom.cpp @@ -22,15 +22,14 @@ */ #if defined(__MK64FX512__) || defined(__MK66FX1M0__) +/** + * HAL PersistentStore for Teensy 3.5 (MK64FX512) and Teensy 3.6 (MK66FX1M0) + */ + #include "../../inc/MarlinConfig.h" #if USE_WIRED_EEPROM -/** - * PersistentStore for Arduino-style EEPROM interface - * with implementations supplied by the framework. - */ - #include "../shared/eeprom_api.h" #include diff --git a/Marlin/src/HAL/TEENSY35_36/endstop_interrupts.h b/Marlin/src/HAL/TEENSY35_36/endstop_interrupts.h index 92e22efc0f..87e6a7507a 100644 --- a/Marlin/src/HAL/TEENSY35_36/endstop_interrupts.h +++ b/Marlin/src/HAL/TEENSY35_36/endstop_interrupts.h @@ -22,7 +22,7 @@ #pragma once /** - * Endstop Interrupts + * HAL Endstop Interrupts for Teensy 3.5 (MK64FX512) and Teensy 3.6 (MK66FX1M0) * * Without endstop interrupts the endstop pins must be polled continually in * the temperature-ISR via endstops.update(), most of the time finding no change. diff --git a/Marlin/src/HAL/TEENSY35_36/pinsDebug.h b/Marlin/src/HAL/TEENSY35_36/pinsDebug.h index e57c73c595..e529fa93be 100644 --- a/Marlin/src/HAL/TEENSY35_36/pinsDebug.h +++ b/Marlin/src/HAL/TEENSY35_36/pinsDebug.h @@ -18,6 +18,10 @@ */ #pragma once +/** + * HAL Pins Debugging for Teensy 3.5 (MK64FX512) and Teensy 3.6 (MK66FX1M0) + */ + #define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS #define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin diff --git a/Marlin/src/HAL/TEENSY35_36/spi_pins.h b/Marlin/src/HAL/TEENSY35_36/spi_pins.h index 276d4f456a..c76344d075 100644 --- a/Marlin/src/HAL/TEENSY35_36/spi_pins.h +++ b/Marlin/src/HAL/TEENSY35_36/spi_pins.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * HAL SPI Pins for Teensy 3.5 (MK64FX512) and Teensy 3.6 (MK66FX1M0) + */ + #define SCK_PIN 13 #define MISO_PIN 12 #define MOSI_PIN 11 diff --git a/Marlin/src/HAL/TEENSY35_36/timers.cpp b/Marlin/src/HAL/TEENSY35_36/timers.cpp index 5725e83a85..8067d091dd 100644 --- a/Marlin/src/HAL/TEENSY35_36/timers.cpp +++ b/Marlin/src/HAL/TEENSY35_36/timers.cpp @@ -21,8 +21,7 @@ */ /** - * Teensy3.5 __MK64FX512__ - * Teensy3.6 __MK66FX1M0__ + * HAL Timers for Teensy 3.5 (MK64FX512) and Teensy 3.6 (MK66FX1M0) */ #if defined(__MK64FX512__) || defined(__MK66FX1M0__) diff --git a/Marlin/src/HAL/TEENSY35_36/timers.h b/Marlin/src/HAL/TEENSY35_36/timers.h index ad6629f40d..5c623cd801 100644 --- a/Marlin/src/HAL/TEENSY35_36/timers.h +++ b/Marlin/src/HAL/TEENSY35_36/timers.h @@ -21,9 +21,7 @@ #pragma once /** - * Description: HAL for - * Teensy3.5 (__MK64FX512__) - * Teensy3.6 (__MK66FX1M0__) + * HAL Timers for Teensy 3.5 (MK64FX512) and Teensy 3.6 (MK66FX1M0) */ #include diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.cpp b/Marlin/src/HAL/TEENSY40_41/HAL.cpp index f5d37f5fc4..5b1b4272f5 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.cpp +++ b/Marlin/src/HAL/TEENSY40_41/HAL.cpp @@ -21,7 +21,7 @@ */ /** - * Description: HAL for Teensy40 (IMXRT1062) + * HAL for Teensy 4.0 / 4.1 (IMXRT1062) */ #ifdef __IMXRT1062__ diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.h b/Marlin/src/HAL/TEENSY40_41/HAL.h index b3b0144d13..1aff6eed8e 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.h +++ b/Marlin/src/HAL/TEENSY40_41/HAL.h @@ -22,7 +22,7 @@ #pragma once /** - * Description: HAL for Teensy 4.0 and Teensy 4.1 + * HAL for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) */ #define CPU_32_BIT @@ -45,8 +45,9 @@ // Defines // ------------------------ -#ifdef __IMXRT1062__ - #define IS_32BIT_TEENSY 1 +#define IS_32BIT_TEENSY 1 +#define IS_TEENSY_40_41 1 +#ifndef IS_TEENSY40 #define IS_TEENSY41 1 #endif diff --git a/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp index 9ccbb3a1f4..20b472aa35 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp @@ -19,6 +19,11 @@ * along with this program. If not, see . * */ + +/** + * HAL SPI for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) + */ + #ifdef __IMXRT1062__ #include "HAL.h" diff --git a/Marlin/src/HAL/TEENSY40_41/Servo.cpp b/Marlin/src/HAL/TEENSY40_41/Servo.cpp index e3d0d03449..ffb1102b14 100644 --- a/Marlin/src/HAL/TEENSY40_41/Servo.cpp +++ b/Marlin/src/HAL/TEENSY40_41/Servo.cpp @@ -19,6 +19,11 @@ * along with this program. If not, see . * */ + +/** + * HAL Servo for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) + */ + #ifdef __IMXRT1062__ #include "../../inc/MarlinConfig.h" @@ -53,5 +58,4 @@ void libServo::detach() { } #endif // HAS_SERVOS - #endif // __IMXRT1062__ diff --git a/Marlin/src/HAL/TEENSY40_41/Servo.h b/Marlin/src/HAL/TEENSY40_41/Servo.h index ce910ed8a8..699fd700c9 100644 --- a/Marlin/src/HAL/TEENSY40_41/Servo.h +++ b/Marlin/src/HAL/TEENSY40_41/Servo.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * HAL Servo for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) + */ + #include // Inherit and expand on core Servo library diff --git a/Marlin/src/HAL/TEENSY40_41/eeprom.cpp b/Marlin/src/HAL/TEENSY40_41/eeprom.cpp index 5491e04fbc..030a8c38af 100644 --- a/Marlin/src/HAL/TEENSY40_41/eeprom.cpp +++ b/Marlin/src/HAL/TEENSY40_41/eeprom.cpp @@ -27,8 +27,7 @@ #if USE_WIRED_EEPROM /** - * PersistentStore for Arduino-style EEPROM interface - * with implementations supplied by the framework. + * HAL PersistentStore for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) */ #include "../shared/eeprom_api.h" diff --git a/Marlin/src/HAL/TEENSY40_41/endstop_interrupts.h b/Marlin/src/HAL/TEENSY40_41/endstop_interrupts.h index 92e22efc0f..a05e911668 100644 --- a/Marlin/src/HAL/TEENSY40_41/endstop_interrupts.h +++ b/Marlin/src/HAL/TEENSY40_41/endstop_interrupts.h @@ -22,7 +22,7 @@ #pragma once /** - * Endstop Interrupts + * HAL Endstop Interrupts for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) * * Without endstop interrupts the endstop pins must be polled continually in * the temperature-ISR via endstops.update(), most of the time finding no change. diff --git a/Marlin/src/HAL/TEENSY40_41/fastio.h b/Marlin/src/HAL/TEENSY40_41/fastio.h index 19b8114509..52f991dfb8 100644 --- a/Marlin/src/HAL/TEENSY40_41/fastio.h +++ b/Marlin/src/HAL/TEENSY40_41/fastio.h @@ -23,7 +23,7 @@ #pragma once /** - * Fast I/O interfaces for Teensy 4 + * Fast I/O interfaces for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) * These use GPIO functions instead of Direct Port Manipulation, as on AVR. */ diff --git a/Marlin/src/HAL/TEENSY40_41/pinsDebug.h b/Marlin/src/HAL/TEENSY40_41/pinsDebug.h index 890f668650..4ad62d00fe 100644 --- a/Marlin/src/HAL/TEENSY40_41/pinsDebug.h +++ b/Marlin/src/HAL/TEENSY40_41/pinsDebug.h @@ -18,6 +18,10 @@ */ #pragma once +/** + * HAL Pins Debugging for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) + */ + #warning "PINS_DEBUGGING is not fully supported for Teensy 4.0 / 4.1 so 'M43' may cause hangs." #define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS diff --git a/Marlin/src/HAL/TEENSY40_41/spi_pins.h b/Marlin/src/HAL/TEENSY40_41/spi_pins.h index 276d4f456a..d6f8d41bf6 100644 --- a/Marlin/src/HAL/TEENSY40_41/spi_pins.h +++ b/Marlin/src/HAL/TEENSY40_41/spi_pins.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * HAL SPI Pins for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) + */ + #define SCK_PIN 13 #define MISO_PIN 12 #define MOSI_PIN 11 diff --git a/Marlin/src/HAL/TEENSY40_41/timers.cpp b/Marlin/src/HAL/TEENSY40_41/timers.cpp index 15f5185a6b..81c9b08c17 100644 --- a/Marlin/src/HAL/TEENSY40_41/timers.cpp +++ b/Marlin/src/HAL/TEENSY40_41/timers.cpp @@ -21,7 +21,7 @@ */ /** - * Teensy4.0/4.1 (__IMXRT1062__) + * HAL Timers for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) */ #ifdef __IMXRT1062__ diff --git a/Marlin/src/HAL/TEENSY40_41/timers.h b/Marlin/src/HAL/TEENSY40_41/timers.h index 81891c366b..7e4cd080cb 100644 --- a/Marlin/src/HAL/TEENSY40_41/timers.h +++ b/Marlin/src/HAL/TEENSY40_41/timers.h @@ -21,8 +21,7 @@ #pragma once /** - * Description: HAL for - * Teensy4.0/4.1 (__IMXRT1062__) + * HAL Timers for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) */ #include diff --git a/Marlin/src/HAL/TEENSY40_41/watchdog.cpp b/Marlin/src/HAL/TEENSY40_41/watchdog.cpp index 4253944f2b..8b05ddb153 100644 --- a/Marlin/src/HAL/TEENSY40_41/watchdog.cpp +++ b/Marlin/src/HAL/TEENSY40_41/watchdog.cpp @@ -19,6 +19,11 @@ * along with this program. If not, see . * */ + +/** + * HAL Watchdog for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) + */ + #ifdef __IMXRT1062__ #include "../../inc/MarlinConfig.h" @@ -48,5 +53,4 @@ void HAL_watchdog_refresh() { } #endif // USE_WATCHDOG - #endif // __IMXRT1062__ diff --git a/Marlin/src/HAL/TEENSY40_41/watchdog.h b/Marlin/src/HAL/TEENSY40_41/watchdog.h index f10ecb5aef..03ab151b07 100644 --- a/Marlin/src/HAL/TEENSY40_41/watchdog.h +++ b/Marlin/src/HAL/TEENSY40_41/watchdog.h @@ -22,7 +22,7 @@ #pragma once /** - * Watchdog for Teensy4.0/4.1 (__IMXRT1062__) + * HAL Watchdog for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A) */ void watchdog_init(); diff --git a/Marlin/src/gcode/calibrate/M100.cpp b/Marlin/src/gcode/calibrate/M100.cpp index 5ec709fb40..9ac2380e79 100644 --- a/Marlin/src/gcode/calibrate/M100.cpp +++ b/Marlin/src/gcode/calibrate/M100.cpp @@ -60,7 +60,7 @@ #define TEST_BYTE ((char) 0xE5) -#if defined(__AVR__) || IS_32BIT_TEENSY +#if EITHER(__AVR__, IS_32BIT_TEENSY) extern char __bss_end; char *end_bss = &__bss_end, diff --git a/Marlin/src/pins/teensy3/pins_TEENSY31_32.h b/Marlin/src/pins/teensy3/pins_TEENSY31_32.h index 45d1231f8e..0edb5cb19d 100644 --- a/Marlin/src/pins/teensy3/pins_TEENSY31_32.h +++ b/Marlin/src/pins/teensy3/pins_TEENSY31_32.h @@ -27,7 +27,7 @@ * https://www.pjrc.com/teensy/teensyduino.html */ -#if NOT_TARGET(IS_32BIT_TEENSY) +#if NOT_TARGET(IS_TEENSY_31_32) #error "Oops! Select 'Teensy 3.1' or 'Teensy 3.2' in 'Tools > Board.'" #endif diff --git a/Marlin/src/pins/teensy3/pins_TEENSY35_36.h b/Marlin/src/pins/teensy3/pins_TEENSY35_36.h index b1cd3d1612..2e09c8a425 100644 --- a/Marlin/src/pins/teensy3/pins_TEENSY35_36.h +++ b/Marlin/src/pins/teensy3/pins_TEENSY35_36.h @@ -27,7 +27,7 @@ * https://www.pjrc.com/teensy/teensyduino.html ****************************************************************************************/ -#if NOT_TARGET(IS_32BIT_TEENSY) +#if NOT_TARGET(IS_TEENSY_35_36) #error "Oops! Select 'Teensy 3.5' or 'Teensy 3.6' in 'Tools > Board.'" #endif diff --git a/Marlin/src/pins/teensy4/pins_T41U5XBB.h b/Marlin/src/pins/teensy4/pins_T41U5XBB.h index cb4c0ea879..830637bebd 100644 --- a/Marlin/src/pins/teensy4/pins_T41U5XBB.h +++ b/Marlin/src/pins/teensy4/pins_T41U5XBB.h @@ -27,12 +27,12 @@ * https://www.pjrc.com/teensy/teensyduino.html ****************************************************************************************/ -#if NOT_TARGET(IS_32BIT_TEENSY) || NOT_TARGET(IS_TEENSY41) +#if NOT_TARGET(IS_TEENSY41) #error "Oops! Select 'Teensy 4.1' in 'Tools > Board.'" -#else - #define BOARD_INFO_NAME "Teensy4.1" #endif +#define BOARD_INFO_NAME "Teensy4.1" + /** * Plan for Teensy 4.0 and Teensy 4.1: * USB diff --git a/Marlin/src/pins/teensy4/pins_TEENSY41.h b/Marlin/src/pins/teensy4/pins_TEENSY41.h index cc7341bc23..31c6fda5c9 100644 --- a/Marlin/src/pins/teensy4/pins_TEENSY41.h +++ b/Marlin/src/pins/teensy4/pins_TEENSY41.h @@ -27,12 +27,12 @@ * https://www.pjrc.com/teensy/teensyduino.html ****************************************************************************************/ -#if NOT_TARGET(IS_32BIT_TEENSY) || NOT_TARGET(IS_TEENSY41) +#if NOT_TARGET(IS_TEENSY41) #error "Oops! Select 'Teensy 4.1' in 'Tools > Board.'" -#else - #define BOARD_INFO_NAME "Teensy4.1" #endif +#define BOARD_INFO_NAME "Teensy4.1" + /** * Plan for Teensy 4.0 and Teensy 4.1: * USB diff --git a/Marlin/src/sd/Sd2Card.h b/Marlin/src/sd/Sd2Card.h index da19283ef1..5a7ed375e5 100644 --- a/Marlin/src/sd/Sd2Card.h +++ b/Marlin/src/sd/Sd2Card.h @@ -78,13 +78,11 @@ uint8_t const SD_CARD_TYPE_SD1 = 1, // Standard capacity V1 SD_CARD_TYPE_SDHC = 3; // High Capacity SD card /** - * define SOFTWARE_SPI to use bit-bang SPI + * Define SOFTWARE_SPI to use bit-bang SPI */ -#if MEGA_SOFT_SPI +#if EITHER(MEGA_SOFT_SPI, USE_SOFTWARE_SPI) #define SOFTWARE_SPI -#elif USE_SOFTWARE_SPI - #define SOFTWARE_SPI -#endif // MEGA_SOFT_SPI +#endif /** * \class Sd2Card diff --git a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h index 55a1099a3a..8ca95ba706 100644 --- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h +++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h @@ -30,19 +30,20 @@ #include "../SdInfo.h" /** - * define SOFTWARE_SPI to use bit-bang SPI + * Define SOFTWARE_SPI to use bit-bang SPI */ -#if MEGA_SOFT_SPI || USE_SOFTWARE_SPI +#if EITHER(MEGA_SOFT_SPI, USE_SOFTWARE_SPI) #define SOFTWARE_SPI #endif // SPI pin definitions - do not edit here - change in SdFatConfig.h -#if DISABLED(SOFTWARE_SPI) +#if ENABLED(SOFTWARE_SPI) + #warning "Auto-assigning '10' as the SD_CHIP_SELECT_PIN." + #define SD_CHIP_SELECT_PIN 10 // Software SPI chip select pin for the SD +#else // hardware pin defs #define SD_CHIP_SELECT_PIN SS_PIN // The default chip select pin for the SD card is SS. -#else // SOFTWARE_SPI - #define SD_CHIP_SELECT_PIN 10 // Software SPI chip select pin for the SD -#endif // SOFTWARE_SPI +#endif class Sd2Card { private: diff --git a/README.md b/README.md index 839b9f3f65..27becb9db6 100644 --- a/README.md +++ b/README.md @@ -100,8 +100,8 @@ Marlin 2.0 introduces a layer of abstraction so that all the existing high-level boards|processor|speed|flash|sram|logic|fpu ----|---------|-----|-----|----|-----|--- - [Teensy 4.0](https://www.pjrc.com/store/teensy40.html)|[IMXRT1062](https://www.mouser.com/new/nxp-semiconductors/nxp-imx-rt1060-crossover-processor/) ARM-Cortex M7|600MHz|1M|2M|3.3V|yes - [Teensy 4.1](https://www.pjrc.com/store/teensy41.html)|[IMXRT1062](https://www.mouser.com/new/nxp-semiconductors/nxp-imx-rt1060-crossover-processor/) ARM-Cortex M7|600MHz|1M|2M|3.3V|yes + [Teensy 4.0](https://www.pjrc.com/store/teensy40.html)|[IMXRT1062DVL6A](https://www.mouser.com/new/nxp-semiconductors/nxp-imx-rt1060-crossover-processor/) ARM-Cortex M7|600MHz|1M|2M|3.3V|yes + [Teensy 4.1](https://www.pjrc.com/store/teensy41.html)|[IMXRT1062DVJ6A](https://www.mouser.com/new/nxp-semiconductors/nxp-imx-rt1060-crossover-processor/) ARM-Cortex M7|600MHz|1M|2M|3.3V|yes ## Submitting Patches