Scott Lahteine пре 7 година
родитељ
комит
f52a31a275

+ 1
- 1
Marlin/src/core/enum.h Прегледај датотеку

@@ -23,7 +23,7 @@
23 23
 #ifndef __ENUM_H__
24 24
 #define __ENUM_H__
25 25
 
26
-#include "MarlinConfig.h"
26
+#include "../inc/MarlinConfig.h"
27 27
 
28 28
 /**
29 29
  * Axis indices as enumerated constants

+ 4
- 4
Marlin/src/core/language.h Прегледај датотеку

@@ -23,7 +23,7 @@
23 23
 #ifndef LANGUAGE_H
24 24
 #define LANGUAGE_H
25 25
 
26
-#include "MarlinConfig.h"
26
+#include "../inc/MarlinConfig.h"
27 27
 
28 28
 #define _UxGT(a) a
29 29
 
@@ -44,7 +44,7 @@
44 44
 //
45 45
 //   ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h"
46 46
 //   ==> ALSO TRY ALL AVAILABLE LANGUAGE OPTIONS
47
-// See also https://github.com/MarlinFirmware/Marlin/wiki/LCD-Language
47
+// See also http://marlinfw.org/docs/development/lcd_language.html
48 48
 
49 49
 // Languages
50 50
 // an         Aragonese
@@ -260,7 +260,7 @@
260 260
 
261 261
 // LCD Menu Messages
262 262
 
263
-#define LANGUAGE_INCL_(M) STRINGIFY_(language_##M.h)
263
+#define LANGUAGE_INCL_(M) STRINGIFY_(../lcd/language/language_##M.h)
264 264
 #define LANGUAGE_INCL(M) LANGUAGE_INCL_(M)
265 265
 #define INCLUDE_LANGUAGE LANGUAGE_INCL(LCD_LANGUAGE)
266 266
 
@@ -310,6 +310,6 @@
310 310
   #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays.
311 311
 #endif
312 312
 
313
-#include "language_en.h"
313
+#include "../lcd/language/language_en.h"
314 314
 
315 315
 #endif // __LANGUAGE_H

+ 3
- 0
Marlin/src/core/macros.h Прегледај датотеку

@@ -102,6 +102,9 @@
102 102
 #define DEGREES(r) ((r)*180.0/M_PI)
103 103
 #define HYPOT2(x,y) (sq(x)+sq(y))
104 104
 
105
+#define CIRCLE_AREA(R) (M_PI * sq(R))
106
+#define CIRCLE_CIRC(R) (2.0 * M_PI * (R))
107
+
105 108
 #define SIGN(a) ((a>0)-(a<0))
106 109
 
107 110
 // Macros to contrain values

+ 9
- 0
Marlin/src/core/serial.cpp Прегледај датотеку

@@ -25,6 +25,15 @@
25 25
 const char errormagic[] PROGMEM = "Error:";
26 26
 const char echomagic[] PROGMEM = "echo:";
27 27
 
28
+
29
+void serialprintPGM(const char * str) {
30
+  #ifdef TARGET_LPC1768
31
+    MYSERIAL.print(str);
32
+  #else
33
+    while (char ch = pgm_read_byte(str++)) MYSERIAL.write(ch);
34
+  #endif
35
+}
36
+
28 37
 void serial_echopair_P(const char* s_P, const char *v)   { serialprintPGM(s_P); SERIAL_ECHO(v); }
29 38
 void serial_echopair_P(const char* s_P, char v)          { serialprintPGM(s_P); SERIAL_CHAR(v); }
30 39
 void serial_echopair_P(const char* s_P, int v)           { serialprintPGM(s_P); SERIAL_ECHO(v); }

+ 3
- 7
Marlin/src/core/serial.h Прегледај датотеку

@@ -23,7 +23,7 @@
23 23
 #ifndef __SERIAL_H__
24 24
 #define __SERIAL_H__
25 25
 
26
-#include "src/HAL/HAL.h"
26
+#include "../inc/MarlinConfig.h"
27 27
 
28 28
 //todo: HAL: breaks encapsulation
29 29
 // For AVR only, define a serial interface based on configuration
@@ -36,13 +36,11 @@
36 36
       #define MYSERIAL Serial
37 37
     #endif // BLUETOOTH
38 38
   #else
39
-    #include "src/HAL/HAL_AVR/MarlinSerial.h"
39
+    #include "../HAL/HAL_AVR/MarlinSerial.h"
40 40
     #define MYSERIAL customizedSerial
41 41
   #endif
42 42
 #endif
43 43
 
44
-#include "MarlinConfig.h"
45
-
46 44
 extern const char echomagic[] PROGMEM;
47 45
 extern const char errormagic[] PROGMEM;
48 46
 
@@ -100,8 +98,6 @@ void serial_spaces(uint8_t count);
100 98
 //
101 99
 // Functions for serial printing from PROGMEM. (Saves loads of SRAM.)
102 100
 //
103
-FORCE_INLINE void serialprintPGM(const char* str) {
104
-  while (char ch = pgm_read_byte(str++)) MYSERIAL.write(ch);
105
-}
101
+void serialprintPGM(const char* str);
106 102
 
107 103
 #endif // __SERIAL_H__

+ 4
- 1
Marlin/src/core/types.h Прегледај датотеку

@@ -23,6 +23,9 @@
23 23
 #ifndef __TYPES_H__
24 24
 #define __TYPES_H__
25 25
 
26
-typedef unsigned long millis_t;
26
+#include <stdint.h>
27
+#include <string.h>
28
+
29
+typedef uint32_t millis_t;
27 30
 
28 31
 #endif

+ 126
- 2
Marlin/src/core/utility.cpp Прегледај датотеку

@@ -20,9 +20,10 @@
20 20
  *
21 21
  */
22 22
 
23
-#include "Marlin.h"
24 23
 #include "utility.h"
25
-#include "temperature.h"
24
+
25
+#include "../Marlin.h"
26
+#include "../module/temperature.h"
26 27
 
27 28
 void safe_delay(millis_t ms) {
28 29
   while (ms > 50) {
@@ -255,3 +256,126 @@ void safe_delay(millis_t ms) {
255 256
   }
256 257
 
257 258
 #endif // ULTRA_LCD
259
+
260
+#if ENABLED(DEBUG_LEVELING_FEATURE)
261
+
262
+  #include "../module/probe.h"
263
+  #include "../module/motion.h"
264
+  #include "../module/stepper.h"
265
+  #include "../feature/bedlevel/bedlevel.h"
266
+
267
+  void log_machine_info() {
268
+    SERIAL_ECHOPGM("Machine Type: ");
269
+    #if ENABLED(DELTA)
270
+      SERIAL_ECHOLNPGM("Delta");
271
+    #elif IS_SCARA
272
+      SERIAL_ECHOLNPGM("SCARA");
273
+    #elif IS_CORE
274
+      SERIAL_ECHOLNPGM("Core");
275
+    #else
276
+      SERIAL_ECHOLNPGM("Cartesian");
277
+    #endif
278
+
279
+    SERIAL_ECHOPGM("Probe: ");
280
+    #if ENABLED(PROBE_MANUALLY)
281
+      SERIAL_ECHOLNPGM("PROBE_MANUALLY");
282
+    #elif ENABLED(FIX_MOUNTED_PROBE)
283
+      SERIAL_ECHOLNPGM("FIX_MOUNTED_PROBE");
284
+    #elif ENABLED(BLTOUCH)
285
+      SERIAL_ECHOLNPGM("BLTOUCH");
286
+    #elif HAS_Z_SERVO_ENDSTOP
287
+      SERIAL_ECHOLNPGM("SERVO PROBE");
288
+    #elif ENABLED(Z_PROBE_SLED)
289
+      SERIAL_ECHOLNPGM("Z_PROBE_SLED");
290
+    #elif ENABLED(Z_PROBE_ALLEN_KEY)
291
+      SERIAL_ECHOLNPGM("Z_PROBE_ALLEN_KEY");
292
+    #else
293
+      SERIAL_ECHOLNPGM("NONE");
294
+    #endif
295
+
296
+    #if HAS_BED_PROBE
297
+      SERIAL_ECHOPAIR("Probe Offset X:", X_PROBE_OFFSET_FROM_EXTRUDER);
298
+      SERIAL_ECHOPAIR(" Y:", Y_PROBE_OFFSET_FROM_EXTRUDER);
299
+      SERIAL_ECHOPAIR(" Z:", zprobe_zoffset);
300
+      #if X_PROBE_OFFSET_FROM_EXTRUDER > 0
301
+        SERIAL_ECHOPGM(" (Right");
302
+      #elif X_PROBE_OFFSET_FROM_EXTRUDER < 0
303
+        SERIAL_ECHOPGM(" (Left");
304
+      #elif Y_PROBE_OFFSET_FROM_EXTRUDER != 0
305
+        SERIAL_ECHOPGM(" (Middle");
306
+      #else
307
+        SERIAL_ECHOPGM(" (Aligned With");
308
+      #endif
309
+      #if Y_PROBE_OFFSET_FROM_EXTRUDER > 0
310
+        SERIAL_ECHOPGM("-Back");
311
+      #elif Y_PROBE_OFFSET_FROM_EXTRUDER < 0
312
+        SERIAL_ECHOPGM("-Front");
313
+      #elif X_PROBE_OFFSET_FROM_EXTRUDER != 0
314
+        SERIAL_ECHOPGM("-Center");
315
+      #endif
316
+      if (zprobe_zoffset < 0)
317
+        SERIAL_ECHOPGM(" & Below");
318
+      else if (zprobe_zoffset > 0)
319
+        SERIAL_ECHOPGM(" & Above");
320
+      else
321
+        SERIAL_ECHOPGM(" & Same Z as");
322
+      SERIAL_ECHOLNPGM(" Nozzle)");
323
+    #endif
324
+
325
+    #if HAS_ABL
326
+      SERIAL_ECHOPGM("Auto Bed Leveling: ");
327
+      #if ENABLED(AUTO_BED_LEVELING_LINEAR)
328
+        SERIAL_ECHOPGM("LINEAR");
329
+      #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
330
+        SERIAL_ECHOPGM("BILINEAR");
331
+      #elif ENABLED(AUTO_BED_LEVELING_3POINT)
332
+        SERIAL_ECHOPGM("3POINT");
333
+      #elif ENABLED(AUTO_BED_LEVELING_UBL)
334
+        SERIAL_ECHOPGM("UBL");
335
+      #endif
336
+      if (leveling_is_active()) {
337
+        SERIAL_ECHOLNPGM(" (enabled)");
338
+        #if ABL_PLANAR
339
+          const float diff[XYZ] = {
340
+            stepper.get_axis_position_mm(X_AXIS) - current_position[X_AXIS],
341
+            stepper.get_axis_position_mm(Y_AXIS) - current_position[Y_AXIS],
342
+            stepper.get_axis_position_mm(Z_AXIS) - current_position[Z_AXIS]
343
+          };
344
+          SERIAL_ECHOPGM("ABL Adjustment X");
345
+          if (diff[X_AXIS] > 0) SERIAL_CHAR('+');
346
+          SERIAL_ECHO(diff[X_AXIS]);
347
+          SERIAL_ECHOPGM(" Y");
348
+          if (diff[Y_AXIS] > 0) SERIAL_CHAR('+');
349
+          SERIAL_ECHO(diff[Y_AXIS]);
350
+          SERIAL_ECHOPGM(" Z");
351
+          if (diff[Z_AXIS] > 0) SERIAL_CHAR('+');
352
+          SERIAL_ECHO(diff[Z_AXIS]);
353
+        #elif ENABLED(AUTO_BED_LEVELING_UBL)
354
+          SERIAL_ECHOPAIR("UBL Adjustment Z", stepper.get_axis_position_mm(Z_AXIS) - current_position[Z_AXIS]);
355
+        #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
356
+          SERIAL_ECHOPAIR("ABL Adjustment Z", bilinear_z_offset(current_position));
357
+        #endif
358
+      }
359
+      else
360
+        SERIAL_ECHOLNPGM(" (disabled)");
361
+
362
+      SERIAL_EOL();
363
+
364
+    #elif ENABLED(MESH_BED_LEVELING)
365
+
366
+      SERIAL_ECHOPGM("Mesh Bed Leveling");
367
+      if (leveling_is_active()) {
368
+        float lz = current_position[Z_AXIS];
369
+        planner.apply_leveling(current_position[X_AXIS], current_position[Y_AXIS], lz);
370
+        SERIAL_ECHOLNPGM(" (enabled)");
371
+        SERIAL_ECHOPAIR("MBL Adjustment Z", lz);
372
+      }
373
+      else
374
+        SERIAL_ECHOPGM(" (disabled)");
375
+
376
+      SERIAL_EOL();
377
+
378
+    #endif // MESH_BED_LEVELING
379
+  }
380
+
381
+#endif // DEBUG_LEVELING_FEATURE

+ 6
- 0
Marlin/src/core/utility.h Прегледај датотеку

@@ -23,6 +23,8 @@
23 23
 #ifndef __UTILITY_H__
24 24
 #define __UTILITY_H__
25 25
 
26
+#include "../inc/MarlinConfig.h"
27
+
26 28
 void safe_delay(millis_t ms);
27 29
 
28 30
 #if ENABLED(EEPROM_SETTINGS)
@@ -83,4 +85,8 @@ void safe_delay(millis_t ms);
83 85
 
84 86
 #endif // ULTRA_LCD
85 87
 
88
+#if ENABLED(DEBUG_LEVELING_FEATURE)
89
+  void log_machine_info();
90
+#endif
91
+
86 92
 #endif // __UTILITY_H__

Loading…
Откажи
Сачувај