Skip to content

Commit 38413dc

Browse files
committed
Merge branch 'bugfix-2.0.x' into 2.0.x-Sapphire-Pro
2 parents 7c15cbd + b7f86bf commit 38413dc

File tree

18 files changed

+251
-54
lines changed

18 files changed

+251
-54
lines changed

Marlin/Configuration.h

+6-4
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@
360360
* -1 : thermocouple with AD595
361361
* 0 : not used
362362
* 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
363-
* 331 : (3.3V scaled thermistor 1 table)
363+
* 331 : (3.3V scaled thermistor 1 table for MEGA)
364+
* 332 : (3.3V scaled thermistor 1 table for DUE)
364365
* 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
365366
* 3 : Mendel-parts thermistor (4.7k pullup)
366367
* 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
@@ -1536,9 +1537,10 @@
15361537
// Default number of triangles
15371538
#define NOZZLE_CLEAN_TRIANGLES 3
15381539

1539-
// Specify positions as { X, Y, Z }
1540-
#define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) }
1541-
#define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) }
1540+
// Specify positions for each tool as { { X, Y, Z }, { X, Y, Z } }
1541+
// Dual hotend system may use { { -20, (Y_BED_SIZE / 2), (Z_MIN_POS + 1) }, { 420, (Y_BED_SIZE / 2), (Z_MIN_POS + 1) }}
1542+
#define NOZZLE_CLEAN_START_POINT { { 30, 30, (Z_MIN_POS + 1) } }
1543+
#define NOZZLE_CLEAN_END_POINT { { 100, 60, (Z_MIN_POS + 1) } }
15421544

15431545
// Circular pattern radius
15441546
#define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5

Marlin/Configuration_adv.h

+26-14
Original file line numberDiff line numberDiff line change
@@ -165,21 +165,21 @@
165165
* Thermal Protection parameters for the bed are just as above for hotends.
166166
*/
167167
#if ENABLED(THERMAL_PROTECTION_BED)
168-
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
169-
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
168+
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
169+
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
170170

171171
/**
172172
* As described above, except for the bed (M140/M190/M303).
173173
*/
174-
#define WATCH_BED_TEMP_PERIOD 60 // Seconds
175-
#define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
174+
#define WATCH_BED_TEMP_PERIOD 60 // Seconds
175+
#define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
176176
#endif
177177

178178
/**
179179
* Thermal Protection parameters for the heated chamber.
180180
*/
181181
#if ENABLED(THERMAL_PROTECTION_CHAMBER)
182-
#define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds
182+
#define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds
183183
#define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius
184184

185185
/**
@@ -1567,14 +1567,15 @@
15671567
//
15681568
// G2/G3 Arc Support
15691569
//
1570-
#define ARC_SUPPORT // Disable this feature to save ~3226 bytes
1570+
#define ARC_SUPPORT // Disable this feature to save ~3226 bytes
15711571
#if ENABLED(ARC_SUPPORT)
1572-
#define MM_PER_ARC_SEGMENT 1 // (mm) Length (or minimum length) of each arc segment
1573-
#define MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle
1572+
#define MM_PER_ARC_SEGMENT 1 // (mm) Length (or minimum length) of each arc segment
1573+
//#define ARC_SEGMENTS_PER_R 1 // Max segment length, MM_PER = Min
1574+
#define MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle
15741575
//#define ARC_SEGMENTS_PER_SEC 50 // Use feedrate to choose segment length (with MM_PER_ARC_SEGMENT as the minimum)
1575-
#define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections
1576-
//#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles
1577-
//#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes
1576+
#define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections
1577+
//#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles
1578+
//#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes
15781579
#endif
15791580

15801581
// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes.
@@ -1771,6 +1772,9 @@
17711772
// Z raise distance for tool-change, as needed for some extruders
17721773
#define TOOLCHANGE_ZRAISE 2 // (mm)
17731774
//#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change
1775+
#if ENABLED(TOOLCHANGE_NO_RETURN)
1776+
//#define EVENT_GCODE_AFTER_TOOLCHANGE "G12X" // G-code to run after tool-change is complete
1777+
#endif
17741778

17751779
// Retract and prime filament on tool-change
17761780
//#define TOOLCHANGE_FILAMENT_SWAP
@@ -2449,6 +2453,14 @@
24492453

24502454
#endif // HAS_L64XX
24512455

2456+
// @section i2cbus
2457+
2458+
//
2459+
// I2C Master ID for LPC176x LCD and Digital Current control
2460+
// Does not apply to other peripherals based on the Wire library.
2461+
//
2462+
//#define I2C_MASTER_ID 1 // Set a value from 0 to 2
2463+
24522464
/**
24532465
* TWI/I2C BUS
24542466
*
@@ -2477,10 +2489,10 @@
24772489
* echo:i2c-reply: from:99 bytes:5 data:hello
24782490
*/
24792491

2480-
// @section i2cbus
2481-
24822492
//#define EXPERIMENTAL_I2CBUS
2483-
#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave
2493+
#if ENABLED(EXPERIMENTAL_I2CBUS)
2494+
#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave
2495+
#endif
24842496

24852497
// @section extras
24862498

Marlin/src/HAL/HAL_LPC1768/include/i2c_util.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
#ifdef TARGET_LPC1768
2828

29-
#include "../../../inc/MarlinConfigPre.h"
3029
#include "i2c_util.h"
3130

3231
#define U8G_I2C_OPT_FAST 16 // from u8g.h
@@ -43,13 +42,13 @@ void configure_i2c(const uint8_t clock_option) {
4342
PinCfg.OpenDrain = 0;
4443
PinCfg.Pinmode = 0;
4544
PinCfg.Portnum = 0;
46-
#if USEDI2CDEV_M == 0
45+
#if I2C_MASTER_ID == 0
4746
PinCfg.Funcnum = 1;
4847
PinCfg.Pinnum = 27; // SDA0 / D57 AUX-1 ... SCL0 / D58 AUX-1
49-
#elif USEDI2CDEV_M == 1
48+
#elif I2C_MASTER_ID == 1
5049
PinCfg.Funcnum = 3;
5150
PinCfg.Pinnum = 0; // SDA1 / D20 SCA ... SCL1 / D21 SCL
52-
#elif USEDI2CDEV_M == 2
51+
#elif I2C_MASTER_ID == 2
5352
PinCfg.Funcnum = 2;
5453
PinCfg.Pinnum = 10; // SDA2 / D38 X_ENABLE_PIN ... SCL2 / D55 X_DIR_PIN
5554
#endif

Marlin/src/HAL/HAL_LPC1768/include/i2c_util.h

+7-5
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@
2525
* HAL_LPC1768/include/i2c_util.h
2626
*/
2727

28-
#ifndef USEDI2CDEV_M
29-
#define USEDI2CDEV_M 1 // By default use I2C1 controller
28+
#include "../../../inc/MarlinConfigPre.h"
29+
30+
#ifndef I2C_MASTER_ID
31+
#define I2C_MASTER_ID 1
3032
#endif
3133

32-
#if USEDI2CDEV_M == 0
34+
#if I2C_MASTER_ID == 0
3335
#define I2CDEV_M LPC_I2C0
34-
#elif USEDI2CDEV_M == 1
36+
#elif I2C_MASTER_ID == 1
3537
#define I2CDEV_M LPC_I2C1
36-
#elif USEDI2CDEV_M == 2
38+
#elif I2C_MASTER_ID == 2
3739
#define I2CDEV_M LPC_I2C2
3840
#else
3941
#error "Master I2C device not defined!"

Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525

2626
#ifdef TARGET_LPC1768
2727

28+
#include "../include/i2c_util.h"
29+
#include "../../../core/millis_t.h"
30+
2831
extern int millis();
2932

3033
#ifdef __cplusplus
3134
extern "C" {
3235
#endif
3336

34-
#include "../include/i2c_util.h"
35-
#include "../../../core/millis_t.h"
36-
3737
//////////////////////////////////////////////////////////////////////////////////////
3838

3939
// These two routines are exact copies of the lpc17xx_i2c.c routines. Couldn't link to

Marlin/src/HAL/HAL_STM32/timers.h

+29-5
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
#define TEMP_TIMER 2
5858
#endif
5959

60-
#elif defined(STM32F4xx) || defined(STM32F7xx)
60+
#elif defined(STM32F401xC) || defined(STM32F401xE)
6161

62-
#define HAL_TIMER_RATE (F_CPU/2) // frequency of timer peripherals
62+
#define HAL_TIMER_RATE (F_CPU / 2) // frequency of timer peripherals
6363

6464
// STM32F401 only has timers 1-5 & 9-11 with timers 4 & 5 usually assigned to TIMER_SERVO and TIMER_TONE
6565

@@ -71,6 +71,30 @@
7171
#define TEMP_TIMER 10
7272
#endif
7373

74+
#elif defined(STM32F4xx)
75+
76+
#define HAL_TIMER_RATE (F_CPU / 2) // frequency of timer peripherals
77+
78+
#ifndef STEP_TIMER
79+
#define STEP_TIMER 6
80+
#endif
81+
82+
#ifndef TEMP_TIMER
83+
#define TEMP_TIMER 14
84+
#endif
85+
86+
#elif defined(STM32F7xx)
87+
88+
#define HAL_TIMER_RATE (F_CPU/2) // frequency of timer peripherals
89+
90+
#ifndef STEP_TIMER
91+
#define STEP_TIMER 6
92+
#endif
93+
94+
#ifndef TEMP_TIMER
95+
#define TEMP_TIMER 14
96+
#endif
97+
7498
#endif
7599

76100
#ifndef SWSERIAL_TIMER_IRQ_PRIO
@@ -82,16 +106,16 @@
82106
#endif
83107

84108
#ifndef TEMP_TIMER_IRQ_PRIO
85-
#define TEMP_TIMER_IRQ_PRIO 14 //14 = after hardware ISRs
109+
#define TEMP_TIMER_IRQ_PRIO 14 // 14 = after hardware ISRs
86110
#endif
87111

88112
#define STEP_TIMER_NUM 0 // index of timer to use for stepper
89113
#define TEMP_TIMER_NUM 1 // index of timer to use for temperature
90114
#define PULSE_TIMER_NUM STEP_TIMER_NUM
91115

92-
#define TEMP_TIMER_FREQUENCY 1000 //Temperature::isr() is expected to be called at around 1kHz
116+
#define TEMP_TIMER_FREQUENCY 1000 // Temperature::isr() is expected to be called at around 1kHz
93117

94-
//TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp
118+
// TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp
95119
#define STEPPER_TIMER_RATE 2000000 // 2 Mhz
96120
#define STEPPER_TIMER_PRESCALE ((HAL_TIMER_RATE)/(STEPPER_TIMER_RATE))
97121
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs

Marlin/src/core/boards.h

+1
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@
256256
#define BOARD_ARCHIM1 3023 // UltiMachine Archim1 (with DRV8825 drivers)
257257
#define BOARD_ARCHIM2 3024 // UltiMachine Archim2 (with TMC2130 drivers)
258258
#define BOARD_ALLIGATOR 3025 // Alligator Board R2
259+
#define BOARD_CNCONTROLS_15D 3026 // Cartesio CN Controls V15 on DUE
259260

260261
//
261262
// SAM3X8C ARM Cortex M3

Marlin/src/gcode/bedlevel/G26.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -418,15 +418,13 @@ inline bool turn_on_heaters() {
418418
inline bool prime_nozzle() {
419419

420420
const feedRate_t fr_slow_e = planner.settings.max_feedrate_mm_s[E_AXIS] / 15.0f;
421-
#if HAS_LCD_MENU
421+
#if HAS_LCD_MENU && DISABLED(TOUCH_BUTTONS) // ui.button_pressed issue with touchscreen
422422
#if ENABLED(PREVENT_LENGTHY_EXTRUDE)
423423
float Total_Prime = 0.0;
424424
#endif
425425

426426
if (g26_prime_flag == -1) { // The user wants to control how much filament gets purged
427-
#if HAS_LCD_MENU
428-
ui.capture();
429-
#endif
427+
ui.capture();
430428
ui.set_status_P(GET_TEXT(MSG_G26_MANUAL_PRIME), 99);
431429
ui.chirp();
432430

@@ -439,7 +437,10 @@ inline bool prime_nozzle() {
439437
destination.e += 0.25;
440438
#if ENABLED(PREVENT_LENGTHY_EXTRUDE)
441439
Total_Prime += 0.25;
442-
if (Total_Prime >= EXTRUDE_MAXLENGTH) return G26_ERR;
440+
if (Total_Prime >= EXTRUDE_MAXLENGTH) {
441+
ui.release();
442+
return G26_ERR;
443+
}
443444
#endif
444445
prepare_internal_move_to_destination(fr_slow_e);
445446
destination = current_position;

Marlin/src/gcode/motion/G2_G3.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ void plan_arc(
105105

106106
const feedRate_t scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s);
107107

108-
#ifdef ARC_SEGMENTS_PER_SEC
108+
#ifdef ARC_SEGMENTS_PER_R
109+
float seg_length = MM_PER_ARC_SEGMENT * radius;
110+
LIMIT(seg_length, MM_PER_ARC_SEGMENT, ARC_SEGMENTS_PER_R);
111+
#elif ARC_SEGMENTS_PER_SEC
109112
float seg_length = scaled_fr_mm_s * RECIPROCAL(ARC_SEGMENTS_PER_SEC);
110113
NOLESS(seg_length, MM_PER_ARC_SEGMENT);
111114
#else

Marlin/src/inc/Version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* version was tagged.
4343
*/
4444
#ifndef STRING_DISTRIBUTION_DATE
45-
#define STRING_DISTRIBUTION_DATE "2020-01-20"
45+
#define STRING_DISTRIBUTION_DATE "2020-01-21"
4646
#endif
4747

4848
/**

Marlin/src/libs/nozzle.cpp

+7-9
Original file line numberDiff line numberDiff line change
@@ -157,26 +157,24 @@ Nozzle nozzle;
157157
* @param argument depends on the cleaning pattern
158158
*/
159159
void Nozzle::clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects, const uint8_t cleans) {
160-
xyz_pos_t start = NOZZLE_CLEAN_START_POINT, end = NOZZLE_CLEAN_END_POINT;
160+
xyz_pos_t start[HOTENDS] = NOZZLE_CLEAN_START_POINT, end[HOTENDS] = NOZZLE_CLEAN_END_POINT, middle[HOTENDS] = NOZZLE_CLEAN_CIRCLE_MIDDLE;
161161

162162
if (pattern == 2) {
163163
if (!(cleans & (_BV(X_AXIS) | _BV(Y_AXIS)))) {
164164
SERIAL_ECHOLNPGM("Warning : Clean Circle requires XY");
165165
return;
166166
}
167-
constexpr xyz_pos_t middle NOZZLE_CLEAN_CIRCLE_MIDDLE;
168-
end = middle;
169167
}
170168
else {
171-
if (!TEST(cleans, X_AXIS)) start.x = end.x = current_position.x;
172-
if (!TEST(cleans, Y_AXIS)) start.y = end.y = current_position.y;
169+
if (!TEST(cleans, X_AXIS)) start[active_extruder].x = end[active_extruder].x = current_position.x;
170+
if (!TEST(cleans, Y_AXIS)) start[active_extruder].y = end[active_extruder].y = current_position.y;
173171
}
174-
if (!TEST(cleans, Z_AXIS)) start.z = end.z = current_position.z;
172+
if (!TEST(cleans, Z_AXIS)) start[active_extruder].z = end[active_extruder].z = current_position.z;
175173

176174
switch (pattern) {
177-
case 1: zigzag(start, end, strokes, objects); break;
178-
case 2: circle(start, end, strokes, radius); break;
179-
default: stroke(start, end, strokes);
175+
case 1: zigzag(start[active_extruder], end[active_extruder], strokes, objects); break;
176+
case 2: circle(start[active_extruder], middle[active_extruder], strokes, radius); break;
177+
default: stroke(start[active_extruder], end[active_extruder], strokes);
180178
}
181179
}
182180

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2019 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+
#define OVM(V) OV((V)*(0.327/0.327))
25+
26+
// R25 = 100 kOhm, beta25 = 4092 K, 4.7 kOhm pull-up, bed thermistor
27+
const short temptable_332[][2] PROGMEM = {
28+
{ OVM( 268), 150 },
29+
{ OVM( 293), 145 },
30+
{ OVM( 320), 141 },
31+
{ OVM( 379), 133 },
32+
{ OVM( 445), 122 },
33+
{ OVM( 516), 108 },
34+
{ OVM( 591), 98 },
35+
{ OVM( 665), 88 },
36+
{ OVM( 737), 79 },
37+
{ OVM( 801), 70 },
38+
{ OVM( 857), 55 },
39+
{ OVM( 903), 46 },
40+
{ OVM( 939), 39 },
41+
{ OVM( 954), 33 },
42+
{ OVM( 966), 27 },
43+
{ OVM( 977), 22 },
44+
{ OVM( 999), 15 },
45+
{ OVM(1004), 5 },
46+
{ OVM(1008), 0 },
47+
{ OVM(1012), -5 },
48+
{ OVM(1016), -10 },
49+
{ OVM(1020), -15 }
50+
};

Marlin/src/module/thermistor/thermistors.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,12 @@
147147
#if ANY_THERMISTOR_IS(201) // Pt100 with LMV324 Overlord
148148
#include "thermistor_201.h"
149149
#endif
150-
#if ANY_THERMISTOR_IS(331) // Like table 1, but with 3V3 as input voltage
150+
#if ANY_THERMISTOR_IS(331) // Like table 1, but with 3V3 as input voltage for MEGA
151151
#include "thermistor_331.h"
152152
#endif
153+
#if ANY_THERMISTOR_IS(332) // Like table 1, but with 3V3 as input voltage for DUE
154+
#include "thermistor_332.h"
155+
#endif
153156
#if ANY_THERMISTOR_IS(666) // beta25 = UNK, R25 = 200K, Pull-up = 10 kOhm, "Unidentified 200K NTC thermistor (Einstart S)"
154157
#include "thermistor_666.h"
155158
#endif

0 commit comments

Comments
 (0)