1
2
3
4
5
6
7
8
9
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
/**
* 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 <https://www.gnu.org/licenses/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(REPETIER_GCODE_M360)
#include "../gcode.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#if EXTRUDERS
#include "../../module/temperature.h"
#endif
static void config_prefix(PGM_P const name, PGM_P const pref=nullptr, const int8_t ind=-1) {
SERIAL_ECHOPGM("Config:");
if (pref) serialprintPGM(pref);
if (ind >= 0) { SERIAL_ECHO(int(ind)); SERIAL_CHAR(':'); }
serialprintPGM(name);
SERIAL_CHAR(':');
}
static void config_line(PGM_P const name, const float val, PGM_P const pref=nullptr, const int8_t ind=-1) {
config_prefix(name, pref, ind);
SERIAL_ECHOLN(val);
}
static void config_line_e(const int8_t e, PGM_P const name, const float val) {
config_line(name, val, PSTR("Extr."), e + 1);
}
/**
* M360: Report Firmware configuration
* in RepRapFirmware-compatible format
*/
void GcodeSuite::M360() {
PGMSTR(X_STR, "X");
PGMSTR(Y_STR, "Y");
PGMSTR(Z_STR, "Z");
PGMSTR(JERK_STR, "Jerk");
//
// Basics and Enabled items
//
config_line(PSTR("Baudrate"), BAUDRATE);
config_line(PSTR("InputBuffer"), MAX_CMD_SIZE);
config_line(PSTR("PrintlineCache"), BUFSIZE);
config_line(PSTR("MixingExtruder"), ENABLED(MIXING_EXTRUDER));
config_line(PSTR("SDCard"), ENABLED(SDSUPPORT));
config_line(PSTR("Fan"), ENABLED(HAS_FAN));
config_line(PSTR("LCD"), ENABLED(HAS_DISPLAY));
config_line(PSTR("SoftwarePowerSwitch"), 1);
config_line(PSTR("SupportLocalFilamentchange"), ENABLED(ADVANCED_PAUSE_FEATURE));
config_line(PSTR("CaseLights"), ENABLED(CASE_LIGHT_ENABLE));
config_line(PSTR("ZProbe"), ENABLED(HAS_BED_PROBE));
config_line(PSTR("Autolevel"), ENABLED(HAS_LEVELING));
config_line(PSTR("EEPROM"), ENABLED(EEPROM_SETTINGS));
//
// Homing Directions
//
PGMSTR(H_DIR_STR, "HomeDir");
config_line(H_DIR_STR, X_HOME_DIR, X_STR);
config_line(H_DIR_STR, Y_HOME_DIR, Y_STR);
config_line(H_DIR_STR, Z_HOME_DIR, Z_STR);
//
// XYZ Axis Jerk
//
#if HAS_CLASSIC_JERK
if (planner.max_jerk.x == planner.max_jerk.y)
config_line(PSTR("XY"), planner.max_jerk.x, JERK_STR);
else {
config_line(X_STR, planner.max_jerk.x, JERK_STR);
config_line(Y_STR, planner.max_jerk.y, JERK_STR);
}
config_line(Z_STR, planner.max_jerk.z, JERK_STR);
#endif
//
// Firmware Retraction
//
config_line(PSTR("SupportG10G11"), ENABLED(FWRETRACT));
#if ENABLED(FWRETRACT)
PGMSTR(RET_STR, "Retraction");
PGMSTR(UNRET_STR, "RetractionUndo");
PGMSTR(SPEED_STR, "Speed");
// M10 Retract with swap (long) moves
config_line(PSTR("Length"), fwretract.settings.retract_length, RET_STR);
config_line(SPEED_STR, fwretract.settings.retract_feedrate_mm_s, RET_STR);
config_line(PSTR("ZLift"), fwretract.settings.retract_zraise, RET_STR);
config_line(PSTR("LongLength"), fwretract.settings.swap_retract_length, RET_STR);
// M11 Recover (undo) with swap (long) moves
config_line(SPEED_STR, fwretract.settings.retract_recover_feedrate_mm_s, UNRET_STR);
config_line(PSTR("ExtraLength"), fwretract.settings.retract_recover_extra, UNRET_STR);
config_line(PSTR("ExtraLongLength"), fwretract.settings.swap_retract_recover_extra, UNRET_STR);
config_line(PSTR("LongSpeed"), fwretract.settings.swap_retract_recover_feedrate_mm_s, UNRET_STR);
#endif
//
// Workspace boundaries
//
const xyz_pos_t dmin = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS },
dmax = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
xyz_pos_t cmin = dmin, cmax = dmax;
apply_motion_limits(cmin);
apply_motion_limits(cmax);
const xyz_pos_t wmin = cmin.asLogical(), wmax = cmax.asLogical();
PGMSTR(MIN_STR, "Min");
PGMSTR(MAX_STR, "Max");
PGMSTR(SIZE_STR, "Size");
config_line(MIN_STR, wmin.x, X_STR);
config_line(MIN_STR, wmin.y, Y_STR);
config_line(MIN_STR, wmin.z, Z_STR);
config_line(MAX_STR, wmax.x, X_STR);
config_line(MAX_STR, wmax.y, Y_STR);
config_line(MAX_STR, wmax.z, Z_STR);
config_line(SIZE_STR, wmax.x - wmin.x, X_STR);
config_line(SIZE_STR, wmax.y - wmin.y, Y_STR);
config_line(SIZE_STR, wmax.z - wmin.z, Z_STR);
//
// Print and Travel Acceleration
//
#define _ACCEL(A,B) _MIN(planner.settings.max_acceleration_mm_per_s2[A##_AXIS], planner.settings.B)
PGMSTR(P_ACC_STR, "PrintAccel");
PGMSTR(T_ACC_STR, "TravelAccel");
config_line(P_ACC_STR, _ACCEL(X, acceleration), X_STR);
config_line(P_ACC_STR, _ACCEL(Y, acceleration), Y_STR);
config_line(P_ACC_STR, _ACCEL(Z, acceleration), Z_STR);
config_line(T_ACC_STR, _ACCEL(X, travel_acceleration), X_STR);
config_line(T_ACC_STR, _ACCEL(Y, travel_acceleration), Y_STR);
config_line(T_ACC_STR, _ACCEL(Z, travel_acceleration), Z_STR);
config_prefix(PSTR("PrinterType"));
SERIAL_ECHOLNPGM(
TERN_(DELTA, "Delta")
TERN_(IS_SCARA, "SCARA")
TERN_(IS_CORE, "Core")
TERN_(MARKFORGED_XY, "MarkForged")
TERN_(IS_CARTESIAN, "Cartesian")
);
//
// Heated Bed
//
config_line(PSTR("HeatedBed"), ENABLED(HAS_HEATED_BED));
#if HAS_HEATED_BED
config_line(PSTR("MaxBedTemp"), BED_MAX_TARGET);
#endif
//
// Per-Extruder settings
//
config_line(PSTR("NumExtruder"), EXTRUDERS);
#if EXTRUDERS
LOOP_L_N(e, EXTRUDERS) {
config_line_e(e, JERK_STR, TERN(HAS_LINEAR_E_JERK, planner.max_e_jerk[E_INDEX_N(e)], TERN(HAS_CLASSIC_JERK, planner.max_jerk.e, DEFAULT_EJERK)));
config_line_e(e, PSTR("MaxSpeed"), planner.settings.max_feedrate_mm_s[E_AXIS_N(e)]);
config_line_e(e, PSTR("Acceleration"), planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(e)]);
config_line_e(e, PSTR("Diameter"), TERN(NO_VOLUMETRICS, DEFAULT_NOMINAL_FILAMENT_DIA, planner.filament_size[e]));
config_line_e(e, PSTR("MaxTemp"), thermalManager.heater_maxtemp[e]);
}
#endif
}
#endif
|