Skip to content

Commit dcddbf1

Browse files
committed
Merge branch 'bugfix-2.0.x' into 2.0.x-Sapphire-Pro
2 parents 2f76ba7 + 14daf1e commit dcddbf1

File tree

724 files changed

+1701
-1085
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

724 files changed

+1701
-1085
lines changed

Marlin/Configuration.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* Advanced settings can be found in Configuration_adv.h
3737
*
3838
*/
39-
#define CONFIGURATION_H_VERSION 020004
39+
#define CONFIGURATION_H_VERSION 020005
4040

4141
//===========================================================================
4242
//============================= Getting Started =============================
@@ -363,6 +363,7 @@
363363
* 331 : (3.3V scaled thermistor 1 table for MEGA)
364364
* 332 : (3.3V scaled thermistor 1 table for DUE)
365365
* 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
366+
* 202 : 200k thermistor - Copymaster 3D
366367
* 3 : Mendel-parts thermistor (4.7k pullup)
367368
* 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
368369
* 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup)
@@ -1465,6 +1466,7 @@
14651466
#define EEPROM_SETTINGS // Persistent storage with M500 and M501
14661467
//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release!
14671468
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM.
1469+
#define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load
14681470
#if ENABLED(EEPROM_SETTINGS)
14691471
#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors.
14701472
#endif

Marlin/Configuration_adv.h

+23-12
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* Basic settings can be found in Configuration.h
3232
*
3333
*/
34-
#define CONFIGURATION_ADV_H_VERSION 020004
34+
#define CONFIGURATION_ADV_H_VERSION 020005
3535

3636
// @section temperature
3737

@@ -338,15 +338,22 @@
338338
* Controller Fan
339339
* To cool down the stepper drivers and MOSFETs.
340340
*
341-
* The fan will turn on automatically whenever any stepper is enabled
342-
* and turn off after a set period after all steppers are turned off.
341+
* The fan turns on automatically whenever any driver is enabled and turns
342+
* off (or reduces to idle speed) shortly after drivers are turned off.
343+
*
343344
*/
344345
//#define USE_CONTROLLER_FAN
345346
#if ENABLED(USE_CONTROLLER_FAN)
346-
//#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan
347-
#define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled
348-
#define CONTROLLERFAN_SPEED 255 // 255 == full speed
349-
//#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled
347+
//#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan
348+
//#define CONTROLLER_FAN_USE_Z_ONLY // With this option only the Z axis is considered
349+
#define CONTROLLERFAN_SPEED_MIN 0 // (0-255) Minimum speed. (If set below this value the fan is turned off.)
350+
#define CONTROLLERFAN_SPEED_ACTIVE 255 // (0-255) Active speed, used when any motor is enabled
351+
#define CONTROLLERFAN_SPEED_IDLE 0 // (0-255) Idle speed, used when motors are disabled
352+
#define CONTROLLERFAN_IDLE_TIME 60 // (seconds) Extra time to keep the fan running after disabling motors
353+
//#define CONTROLLER_FAN_EDITABLE // Enable M710 configurable settings
354+
#if ENABLED(CONTROLLER_FAN_EDITABLE)
355+
#define CONTROLLER_FAN_MENU // Enable the Controller Fan submenu
356+
#endif
350357
#endif
351358

352359
// When first starting the main fan, run it at full speed for the
@@ -753,8 +760,12 @@
753760
// Minimum time that a segment needs to take if the buffer is emptied
754761
#define DEFAULT_MINSEGMENTTIME 20000 // (ms)
755762

756-
// If defined the movements slow down when the look ahead buffer is only half full
763+
// Slow down the machine if the look ahead buffer is (by default) half full.
764+
// Increase the slowdown divisor for larger buffer sizes.
757765
#define SLOWDOWN
766+
#if ENABLED(SLOWDOWN)
767+
#define SLOWDOWN_DIVISOR 2
768+
#endif
758769

759770
// Frequency limit
760771
// See nophead's blog for more info
@@ -999,7 +1010,7 @@
9991010
#define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)
10001011
#endif
10011012

1002-
#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS
1013+
#if HAS_GRAPHICAL_LCD && EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
10031014
//#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits
10041015
//#define SHOW_REMAINING_TIME // Display estimated time to completion
10051016
#if ENABLED(SHOW_REMAINING_TIME)
@@ -1008,7 +1019,7 @@
10081019
#endif
10091020
#endif
10101021

1011-
#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS
1022+
#if HAS_CHARACTER_LCD && EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
10121023
//#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing
10131024
#if ENABLED(LCD_PROGRESS_BAR)
10141025
#define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar
@@ -1302,9 +1313,9 @@
13021313
#define DGUS_PREHEAT_UI // Display a preheat screen during heatup
13031314

13041315
#if ENABLED(DGUS_LCD_UI_FYSETC)
1305-
//#define DUGS_UI_MOVE_DIS_OPTION // Disabled by default for UI_FYSETC
1316+
//#define DGUS_UI_MOVE_DIS_OPTION // Disabled by default for UI_FYSETC
13061317
#else
1307-
#define DUGS_UI_MOVE_DIS_OPTION // Enabled by default for UI_HIPRECY
1318+
#define DGUS_UI_MOVE_DIS_OPTION // Enabled by default for UI_HIPRECY
13081319
#endif
13091320

13101321
#define DGUS_FILAMENT_LOADUNLOAD

Marlin/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1147)
267267
else ifeq ($(HARDWARE_MOTHERBOARD),1148)
268268
# MKS GEN L V2
269269
else ifeq ($(HARDWARE_MOTHERBOARD),1149)
270+
# Copymaster 3D
271+
else ifeq ($(HARDWARE_MOTHERBOARD),1150)
270272

271273
#
272274
# RAMBo and derivatives
File renamed without changes.
File renamed without changes.

Marlin/src/HAL/HAL_AVR/HAL_SPI.cpp Marlin/src/HAL/AVR/HAL_SPI.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void spiBegin() {
197197
// output pin high - like sending 0xFF
198198
WRITE(MOSI_PIN, HIGH);
199199

200-
for (uint8_t i = 0; i < 8; i++) {
200+
LOOP_L_N(i, 8) {
201201
WRITE(SCK_PIN, HIGH);
202202

203203
nop; // adjust so SCK is nice
@@ -224,7 +224,7 @@ void spiBegin() {
224224
void spiSend(uint8_t data) {
225225
// no interrupts during byte send - about 8µs
226226
cli();
227-
for (uint8_t i = 0; i < 8; i++) {
227+
LOOP_L_N(i, 8) {
228228
WRITE(SCK_PIN, LOW);
229229
WRITE(MOSI_PIN, data & 0x80);
230230
data <<= 1;

Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp Marlin/src/HAL/AVR/MarlinSerial.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
// A SW memory barrier, to ensure GCC does not overoptimize loops
5656
#define sw_barrier() asm volatile("": : :"memory");
5757

58-
#include "../../feature/emergency_parser.h"
58+
#include "../../feature/e_parser.h"
5959

6060
// "Atomically" read the RX head index value without disabling interrupts:
6161
// This MUST be called with RX interrupts enabled, and CAN'T be called
@@ -682,7 +682,7 @@
682682

683683
// Round correctly so that print(1.999, 2) prints as "2.00"
684684
double rounding = 0.5;
685-
for (uint8_t i = 0; i < digits; ++i) rounding *= 0.1;
685+
LOOP_L_N(i, digits) rounding *= 0.1;
686686
number += rounding;
687687

688688
// Extract the integer part of the number and print it
File renamed without changes.
File renamed without changes.
File renamed without changes.

Marlin/src/HAL/HAL_AVR/fast_pwm.cpp Marlin/src/HAL/AVR/fast_pwm.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ void set_pwm_frequency(const pin_t pin, int f_desired) {
167167
uint16_t prescaler[] = { 0, 1, 8, /*TIMER2 ONLY*/32, 64, /*TIMER2 ONLY*/128, 256, 1024 };
168168

169169
// loop over prescaler values
170-
for (uint8_t i = 1; i < 8; i++) {
170+
LOOP_S_L_N(i, 1, 8) {
171171
uint16_t res_temp_fast = 255, res_temp_phase_correct = 255;
172172
if (timer.n == 2) {
173173
// No resolution calculation for TIMER2 unless enabled USE_OCR2A_AS_TOP
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Marlin/src/HAL/HAL_AVR/pinsDebug.h Marlin/src/HAL/AVR/pinsDebug.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@
7070

7171
void PRINT_ARRAY_NAME(uint8_t x) {
7272
char *name_mem_pointer = (char*)pgm_read_ptr(&pin_array[x].name);
73-
for (uint8_t y = 0; y < MAX_NAME_LENGTH; y++) {
73+
LOOP_L_N(y, MAX_NAME_LENGTH) {
7474
char temp_char = pgm_read_byte(name_mem_pointer + y);
7575
if (temp_char != 0)
7676
SERIAL_CHAR(temp_char);
7777
else {
78-
for (uint8_t i = 0; i < MAX_NAME_LENGTH - y; i++) SERIAL_CHAR(' ');
78+
LOOP_L_N(i, MAX_NAME_LENGTH - y) SERIAL_CHAR(' ');
7979
break;
8080
}
8181
}
File renamed without changes.

Marlin/src/HAL/HAL_AVR/u8g_com_HAL_AVR_sw_spi.cpp Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void u8g_spiSend_sw_AVR_mode_0(uint8_t val) {
8888
volatile uint8_t *outData = u8g_outData,
8989
*outClock = u8g_outClock;
9090
U8G_ATOMIC_START();
91-
for (uint8_t i = 0; i < 8; i++) {
91+
LOOP_L_N(i, 8) {
9292
if (val & 0x80)
9393
*outData |= bitData;
9494
else
@@ -108,7 +108,7 @@ void u8g_spiSend_sw_AVR_mode_3(uint8_t val) {
108108
volatile uint8_t *outData = u8g_outData,
109109
*outClock = u8g_outClock;
110110
U8G_ATOMIC_START();
111-
for (uint8_t i = 0; i < 8; i++) {
111+
LOOP_L_N(i, 8) {
112112
*outClock &= bitNotClock;
113113
if (val & 0x80)
114114
*outData |= bitData;
File renamed without changes.
File renamed without changes.
File renamed without changes.

Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp Marlin/src/HAL/DUE/EepromEmulation.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
#include "../../inc/MarlinConfig.h"
5656

57-
#if ENABLED(EEPROM_SETTINGS) && NONE(I2C_EEPROM, SPI_EEPROM)
57+
#if ENABLED(FLASH_EEPROM_EMULATION)
5858

5959
#include "../shared/Marduino.h"
6060
#include "../shared/persistent_store_api.h"
@@ -1016,5 +1016,5 @@ void eeprom_flush() {
10161016
ee_Flush();
10171017
}
10181018

1019-
#endif // EEPROM_SETTINGS && (!I2C_EEPROM && !SPI_EEPROM)
1019+
#endif // FLASH_EEPROM_EMULATION
10201020
#endif // ARDUINO_ARCH_AVR
File renamed without changes.
File renamed without changes.
File renamed without changes.

Marlin/src/HAL/HAL_DUE/MarlinSerial.cpp Marlin/src/HAL/DUE/MarlinSerial.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSeria
4545
// A SW memory barrier, to ensure GCC does not overoptimize loops
4646
#define sw_barrier() asm volatile("": : :"memory");
4747

48-
#include "../../feature/emergency_parser.h"
48+
#include "../../feature/e_parser.h"
4949

5050
// (called with RX interrupts disabled)
5151
template<typename Cfg>
@@ -606,7 +606,7 @@ void MarlinSerial<Cfg>::printFloat(double number, uint8_t digits) {
606606

607607
// Round correctly so that print(1.999, 2) prints as "2.00"
608608
double rounding = 0.5;
609-
for (uint8_t i = 0; i < digits; ++i) rounding *= 0.1;
609+
LOOP_L_N(i, digits) rounding *= 0.1;
610610
number += rounding;
611611

612612
// Extract the integer part of the number and print it
File renamed without changes.

Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.cpp Marlin/src/HAL/DUE/MarlinSerialUSB.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "MarlinSerialUSB.h"
3535

3636
#if ENABLED(EMERGENCY_PARSER)
37-
#include "../../feature/emergency_parser.h"
37+
#include "../../feature/e_parser.h"
3838
#endif
3939

4040
// Imports from Atmel USB Stack/CDC implementation
@@ -259,7 +259,7 @@ void MarlinSerialUSB::printFloat(double number, uint8_t digits) {
259259

260260
// Round correctly so that print(1.999, 2) prints as "2.00"
261261
double rounding = 0.5;
262-
for (uint8_t i = 0; i < digits; ++i)
262+
LOOP_L_N(i, digits)
263263
rounding *= 0.1;
264264

265265
number += rounding;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Pio *SCK_pPio, *MOSI_pPio;
8080
uint32_t SCK_dwMask, MOSI_dwMask;
8181

8282
void u8g_spiSend_sw_DUE_mode_0(uint8_t val) { // 3MHz
83-
for (uint8_t i = 0; i < 8; i++) {
83+
LOOP_L_N(i, 8) {
8484
if (val & 0x80)
8585
MOSI_pPio->PIO_SODR = MOSI_dwMask;
8686
else
@@ -94,7 +94,7 @@ void u8g_spiSend_sw_DUE_mode_0(uint8_t val) { // 3MHz
9494
}
9595

9696
void u8g_spiSend_sw_DUE_mode_3(uint8_t val) { // 3.5MHz
97-
for (uint8_t i = 0; i < 8; i++) {
97+
LOOP_L_N(i, 8) {
9898
SCK_pPio->PIO_CODR = SCK_dwMask;
9999
DELAY_NS(50);
100100
if (val & 0x80)
File renamed without changes.
File renamed without changes.

Marlin/src/HAL/HAL_DUE/fastio/G2_PWM.h Marlin/src/HAL/DUE/fastio/G2_PWM.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ extern PWM_map ISR_table[NUM_PWMS];
6363
extern uint32_t motor_current_setting[3];
6464

6565
#define IR_BIT(p) (WITHIN(p, 0, 3) ? (p) : (p) + 4)
66-
#define COPY_ACTIVE_TABLE() do{ for (uint8_t i = 0; i < 6 ; i++) work_table[i] = active_table[i]; }while(0)
66+
#define COPY_ACTIVE_TABLE() do{ LOOP_L_N(i, 6) work_table[i] = active_table[i]; }while(0)
6767

6868
#define PWM_MR0 19999 // base repetition rate minus one count - 20mS
6969
#define PWM_PR 24 // prescaler value - prescaler divide by 24 + 1 - 1 MHz output
File renamed without changes.

Marlin/src/HAL/HAL_SAMD51/inc/Conditionals_post.h Marlin/src/HAL/DUE/inc/Conditionals_post.h

+6
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@
2020
*
2121
*/
2222
#pragma once
23+
24+
#if USE_EMULATED_EEPROM
25+
#undef SRAM_EEPROM_EMULATION
26+
#undef SDCARD_EEPROM_EMULATION
27+
#define FLASH_EEPROM_EMULATION
28+
#endif
File renamed without changes.

Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp Marlin/src/HAL/DUE/persistent_store_eeprom.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "../../inc/MarlinConfig.h"
3030
#include "../shared/persistent_store_api.h"
3131

32-
#if !defined(E2END) && NONE(I2C_EEPROM, SPI_EEPROM)
32+
#if !defined(E2END) && ENABLED(FLASH_EEPROM_EMULATION)
3333
#define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp)
3434
#endif
3535

@@ -38,7 +38,7 @@ extern void eeprom_flush();
3838
bool PersistentStore::access_start() { return true; }
3939

4040
bool PersistentStore::access_finish() {
41-
#if NONE(I2C_EEPROM, SPI_EEPROM)
41+
#if ENABLED(FLASH_EEPROM_EMULATION)
4242
eeprom_flush();
4343
#endif
4444
return true;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4+
*
5+
* Based on Sprinter and grbl.
6+
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
#pragma once
23+
24+
// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation
25+
#if ENABLED(EEPROM_SETTINGS) && NONE(USE_REAL_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
26+
#define SDCARD_EEPROM_EMULATION
27+
#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h

-22
This file was deleted.

Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h

-22
This file was deleted.

Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h

-22
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)