Skip to content

Commit

Permalink
Merge branch 'bugfix-2.1.x' into mike-anet-evo
Browse files Browse the repository at this point in the history
* bugfix-2.1.x:
  [cron] Bump distribution date (2024-01-30)
  🎨 Misc. cleanup 29-01
  [cron] Bump distribution date (2024-01-29)
  🩹 Temp constraints followup (MarlinFirmware#26744)
  [cron] Bump distribution date (2024-01-28)
  🐛 Protect EEPROM bytes 916-926
  🧑‍💻 Fix warning, adjust tests
  [cron] Bump distribution date (2024-01-27)
  🎨 Misc. cleanup 25-01
  Add Conditionals_type.h
  [cron] Bump distribution date (2024-01-26)
  ✨🔨 EEPROM exclusion zone (MarlinFirmware#26729)
  🩹 Fix single Neo strip M150 K (MarlinFirmware#26709)
  🔧 HYBRID_THRESHOLD sanity checks (MarlinFirmware#26681)
  🩹 Followup to EDITABLE_STEPS_PER_UNIT (MarlinFirmware#26677)
  ✏️ Fix draw_dialog.cpp typo (MarlinFirmware#26684)
  ✨ Creality v2.4.S4_170 (Ender 2 Pro, HC32F460KCTA) (MarlinFirmware#26730)
  🎨 Misc. LCD pins comments
  🔧 Allow float Z_PROBE_LOW_POINT (MarlinFirmware#26711)
  🩹 Fix IA Creality IDEX case
  • Loading branch information
mikezs committed Jan 30, 2024
2 parents 2eb9949 + 70d942a commit 8dd89ea
Show file tree
Hide file tree
Showing 290 changed files with 1,036 additions and 702 deletions.
2 changes: 1 addition & 1 deletion Marlin/Marlin.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Marlin Firmware
(c) 2011-2023 MarlinFirmware
(c) 2011-2024 MarlinFirmware
Portions of Marlin are (c) by their respective authors.
All code complies with GPLv2 and/or GPLv3
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2024-01-25"
//#define STRING_DISTRIBUTION_DATE "2024-01-30"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/HAL/AVR/HAL_SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ void spiBegin() {
while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
}


/** begin spi transaction */
void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) {
// Based on Arduino SPI library
Expand Down Expand Up @@ -175,7 +174,6 @@ void spiBegin() {
SPSR = clockDiv | 0x01;
}


#else // SOFTWARE_SPI || FORCE_SOFT_SPI

// ------------------------
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/AVR/Servo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@

static volatile int8_t Channel[_Nbr_16timers]; // counter for the servo being pulsed for each timer (or -1 if refresh interval)


/************ static functions common to all instances ***********************/

static inline void handle_interrupts(const timer16_Sequence_t timer, volatile uint16_t* TCNTn, volatile uint16_t* OCRnA) {
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/HAL/AVR/eeprom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE size_t(E2END + 1)
#endif
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_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) {
uint16_t written = 0;
while (size--) {
uint8_t * const p = (uint8_t * const)pos;
uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
uint8_t v = *value;
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v);
Expand All @@ -61,7 +61,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 {
uint8_t c = eeprom_read_byte((uint8_t*)pos);
const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/AVR/endstop_interrupts.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ void endstop_ISR() { endstops.update(); }

#endif


// Install Pin change interrupt for a pin. Can be called multiple times.
void pciSetup(const int8_t pin) {
if (digitalPinHasPCICR(pin)) {
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,6 @@
#define PF7_PWM 0
#define PF7_DDR DDRF


/**
* Some of the pin mapping functions of the Teensduino extension to the Arduino IDE
* do not function the same as the other Arduino extensions.
Expand Down
22 changes: 22 additions & 0 deletions Marlin/src/HAL/AVR/inc/Conditionals_type.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
3 changes: 0 additions & 3 deletions Marlin/src/HAL/AVR/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ bool pwm_status(uint8_t pin) {
SERIAL_ECHO_SP(2);
} // pwm_status


const volatile uint8_t* const PWM_other[][3] PROGMEM = {
{ &TCCR0A, &TCCR0B, &TIMSK0 },
{ &TCCR1A, &TCCR1B, &TIMSK1 },
Expand All @@ -181,7 +180,6 @@ const volatile uint8_t* const PWM_other[][3] PROGMEM = {
#endif
};


const volatile uint8_t* const PWM_OCR[][3] PROGMEM = {

#ifdef TIMER0A
Expand Down Expand Up @@ -217,7 +215,6 @@ const volatile uint8_t* const PWM_OCR[][3] PROGMEM = {
#endif
};


#define TCCR_A(T) pgm_read_word(&PWM_other[T][0])
#define TCCR_B(T) pgm_read_word(&PWM_other[T][1])
#define TIMSK(T) pgm_read_word(&PWM_other[T][2])
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ void u8g_spiSend_sw_AVR_mode_3(uint8_t val) {
U8G_ATOMIC_END();
}


#if ENABLED(FYSETC_MINI_12864)
#define SPISEND_SW_AVR u8g_spiSend_sw_AVR_mode_3
#else
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/DUE/MarlinSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ void MarlinSerial<Cfg>::flushTX() {
}
}


// If not using the USB port as serial port
#if defined(SERIAL_PORT) && SERIAL_PORT >= 0
template class MarlinSerial< MarlinSerialCfg<SERIAL_PORT> >;
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/HAL/DUE/eeprom_flash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,14 +958,14 @@ static void ee_Init() {
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB
#endif
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_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) {
uint16_t written = 0;
while (size--) {
uint8_t * const p = (uint8_t * const)pos;
uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
uint8_t v = *value;
if (v != ee_Read(uint32_t(p))) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
ee_Write(uint32_t(p), v);
Expand All @@ -984,7 +984,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 {
uint8_t c = ee_Read(uint32_t(pos));
uint8_t c = ee_Read(uint32_t(REAL_EEPROM_ADDR(pos)));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/HAL/DUE/eeprom_wired.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
#ifndef MARLIN_EEPROM_SIZE
#error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM."
#endif
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_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) {
uint16_t written = 0;
while (size--) {
uint8_t * const p = (uint8_t * const)pos;
uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
uint8_t v = *value;
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v);
Expand All @@ -62,7 +62,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 {
uint8_t c = eeprom_read_byte((uint8_t*)pos);
const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/DUE/fastio/G2_PWM.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ extern volatile uint32_t *SODR_A, *SODR_B, *CODR_A, *CODR_B;

#define PWM_MAP_INIT_ROW(IO,ZZ) { ZZ == 'A' ? SODR_A : SODR_B, ZZ == 'A' ? CODR_A : CODR_B, 1 << _PIN(IO) }


#define PWM_MAP_INIT { PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_X_PIN, 'B'), \
PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_Y_PIN, 'B'), \
PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_Z_PIN, 'B'), \
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/DUE/fastio/G2_pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ const G2_PinDescription G2_g_APinDescription[] = {
{ PIOB, PIO_PB21, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 52
{ PIOB, PIO_PB14, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 53


// 54 .. 65 - Analog pins
// ----------------------
{ PIOA, PIO_PA16X1_AD7, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC0, ADC7, NOT_ON_PWM, NOT_ON_TIMER }, // AD0
Expand Down
22 changes: 22 additions & 0 deletions Marlin/src/HAL/DUE/inc/Conditionals_type.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
11 changes: 0 additions & 11 deletions Marlin/src/HAL/DUE/usb/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@
*/
#define COMPILER_PACK_RESET() COMPILER_PRAGMA(pack())


/**
* \brief Set aligned boundary.
*/
Expand Down Expand Up @@ -283,15 +282,13 @@ typedef double F64; //!< 64-bit floating-point number.
typedef uint32_t iram_size_t;
//! @}


/*! \name Status Types
*/
//! @{
typedef bool Status_bool_t; //!< Boolean status.
typedef U8 Status_t; //!< 8-bit-coded status.
//! @}


/*! \name Aliasing Aggregate Types
*/
//! @{
Expand Down Expand Up @@ -462,7 +459,6 @@ typedef struct
#endif
//! @}


#ifndef __ASSEMBLY__ // not for assembling.

//! \name Optimization Control
Expand Down Expand Up @@ -581,7 +577,6 @@ typedef struct

//! @}


/*! \name Zero-Bit Counting
*
* Under GCC, __builtin_clz and __builtin_ctz behave like macros when
Expand Down Expand Up @@ -692,7 +687,6 @@ typedef struct

//! @}


/*! \name Bit Reversing
*/
//! @{
Expand Down Expand Up @@ -732,7 +726,6 @@ typedef struct

//! @}


/*! \name Alignment
*/
//! @{
Expand Down Expand Up @@ -798,7 +791,6 @@ typedef struct
*/
#define Long_call(addr) ((*(void (*)(void))(addr))())


/*! \name MCU Endianism Handling
* ARM is MCU little endianism.
*/
Expand Down Expand Up @@ -868,7 +860,6 @@ typedef struct
#define CPU_TO_BE32(x) swap32(x)
//! @}


/*! \name Endianism Conversion
*
* The same considerations as for clz and ctz apply here but GCC's
Expand Down Expand Up @@ -955,7 +946,6 @@ typedef struct

//! @}


/*! \name Target Abstraction
*/
//! @{
Expand Down Expand Up @@ -997,7 +987,6 @@ typedef U8 Byte; //!< 8-bit unsigned integer.

#endif // #ifndef __ASSEMBLY__


#ifdef __ICCARM__
#define SHORTENUM __packed
#elif defined(__GNUC__)
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/HAL/DUE/usb/conf_access.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
#define LUN_0_NAME "\"SD/MMC Card\""
//! @}


/*! \name Actions Associated with Memory Accesses
*
* Write here the action to associate with each memory access.
Expand Down Expand Up @@ -112,5 +111,4 @@
#define GLOBAL_WR_PROTECT false //!< Management of a global write protection.
//! @}


#endif // _CONF_ACCESS_H_
1 change: 0 additions & 1 deletion Marlin/src/HAL/DUE/usb/conf_clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,4 @@
// - UPLL frequency: 480MHz
// - USB clock: 480 / 1 = 480MHz


#endif /* CONF_CLOCK_H_INCLUDED */
4 changes: 0 additions & 4 deletions Marlin/src/HAL/DUE/usb/conf_usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
#endif
//@}


/**
* USB Device Callbacks definitions (Optional)
* @{
Expand Down Expand Up @@ -150,7 +149,6 @@

//@}


/**
* USB Interface Configuration
* @{
Expand Down Expand Up @@ -210,7 +208,6 @@
//@}
//@}


/**
* Configuration of MSC interface
* @{
Expand Down Expand Up @@ -245,7 +242,6 @@

//@}


/**
* Description of Composite Device
* @{
Expand Down
Loading

0 comments on commit 8dd89ea

Please sign in to comment.