Browse Source

Misc. patches

Scott Lahteine 4 years ago
parent
commit
4ed912eb23

+ 1
- 1
Marlin/src/HAL/STM32F1/SPI.cpp View File

266
 
266
 
267
 uint16_t SPIClass::read() {
267
 uint16_t SPIClass::read() {
268
   while (!spi_is_rx_nonempty(_currentSetting->spi_d)) { /* nada */ }
268
   while (!spi_is_rx_nonempty(_currentSetting->spi_d)) { /* nada */ }
269
-  return (uint16)spi_rx_reg(_currentSetting->spi_d);
269
+  return (uint16_t)spi_rx_reg(_currentSetting->spi_d);
270
 }
270
 }
271
 
271
 
272
 void SPIClass::read(uint8_t *buf, uint32_t len) {
272
 void SPIClass::read(uint8_t *buf, uint32_t len) {

+ 8
- 7
Marlin/src/MarlinCore.cpp View File

30
 
30
 
31
 #include "MarlinCore.h"
31
 #include "MarlinCore.h"
32
 
32
 
33
+#include "HAL/shared/Delay.h"
34
+#include "HAL/shared/esp_wifi.h"
35
+
36
+#ifdef ARDUINO
37
+  #include <pins_arduino.h>
38
+#endif
39
+#include <math.h>
40
+
33
 #include "core/utility.h"
41
 #include "core/utility.h"
34
 #include "lcd/ultralcd.h"
42
 #include "lcd/ultralcd.h"
35
 #include "module/motion.h"
43
 #include "module/motion.h"
43
 #include "module/printcounter.h" // PrintCounter or Stopwatch
51
 #include "module/printcounter.h" // PrintCounter or Stopwatch
44
 #include "feature/closedloop.h"
52
 #include "feature/closedloop.h"
45
 
53
 
46
-#include "HAL/shared/Delay.h"
47
-#include "HAL/shared/esp_wifi.h"
48
-
49
 #include "module/stepper/indirection.h"
54
 #include "module/stepper/indirection.h"
50
 
55
 
51
-#ifdef ARDUINO
52
-  #include <pins_arduino.h>
53
-#endif
54
-#include <math.h>
55
 #include "libs/nozzle.h"
56
 #include "libs/nozzle.h"
56
 
57
 
57
 #include "gcode/gcode.h"
58
 #include "gcode/gcode.h"

+ 4
- 3
Marlin/src/core/serial.h View File

245
 #define SERIAL_ECHOLIST(pre,V...)   do{ SERIAL_ECHOPGM(pre); _SLST_N(NUM_ARGS(V),V); }while(0)
245
 #define SERIAL_ECHOLIST(pre,V...)   do{ SERIAL_ECHOPGM(pre); _SLST_N(NUM_ARGS(V),V); }while(0)
246
 #define SERIAL_ECHOLIST_N(N,V...)   _SLST_N(N,LIST_N(N,V))
246
 #define SERIAL_ECHOLIST_N(N,V...)   _SLST_N(N,LIST_N(N,V))
247
 
247
 
248
-#define SERIAL_ECHO_P(P)            (serialprintPGM(P))
248
+#define SERIAL_ECHOPGM_P(P)         (serialprintPGM(P))
249
+#define SERIAL_ECHOLNPGM_P(P)       (serialprintPGM(P "\n"))
249
 
250
 
250
-#define SERIAL_ECHOPGM(S)           (SERIAL_ECHO_P(PSTR(S)))
251
-#define SERIAL_ECHOLNPGM(S)         (SERIAL_ECHO_P(PSTR(S "\n")))
251
+#define SERIAL_ECHOPGM(S)           (serialprintPGM(PSTR(S)))
252
+#define SERIAL_ECHOLNPGM(S)         (serialprintPGM(PSTR(S "\n")))
252
 
253
 
253
 #define SERIAL_ECHOPAIR_F_P(P,V...) do{ serialprintPGM(P); SERIAL_ECHO_F(V); }while(0)
254
 #define SERIAL_ECHOPAIR_F_P(P,V...) do{ serialprintPGM(P); SERIAL_ECHO_F(V); }while(0)
254
 #define SERIAL_ECHOLNPAIR_F_P(V...) do{ SERIAL_ECHOPAIR_F_P(V); SERIAL_EOL(); }while(0)
255
 #define SERIAL_ECHOLNPAIR_F_P(V...) do{ SERIAL_ECHOPAIR_F_P(V); SERIAL_EOL(); }while(0)

+ 28
- 26
Marlin/src/module/configuration_store.cpp View File

3224
 
3224
 
3225
       #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
3225
       #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
3226
         say_M906(forReplay);
3226
         say_M906(forReplay);
3227
-        #if AXIS_IS_TMC(X)
3228
-          SERIAL_ECHOPAIR_P(SP_X_STR, stepperX.getMilliamps());
3229
-        #endif
3230
-        #if AXIS_IS_TMC(Y)
3231
-          SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY.getMilliamps());
3232
-        #endif
3233
-        #if AXIS_IS_TMC(Z)
3234
-          SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ.getMilliamps());
3235
-        #endif
3236
-        SERIAL_EOL();
3227
+        SERIAL_ECHOLNPAIR_P(
3228
+          #if AXIS_IS_TMC(X)
3229
+            SP_X_STR, stepperX.getMilliamps(),
3230
+          #endif
3231
+          #if AXIS_IS_TMC(Y)
3232
+            SP_Y_STR, stepperY.getMilliamps(),
3233
+          #endif
3234
+          #if AXIS_IS_TMC(Z)
3235
+            SP_Z_STR, stepperZ.getMilliamps()
3236
+          #endif
3237
+        );
3237
       #endif
3238
       #endif
3238
 
3239
 
3239
       #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2)
3240
       #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2)
3240
         say_M906(forReplay);
3241
         say_M906(forReplay);
3241
         SERIAL_ECHOPGM(" I1");
3242
         SERIAL_ECHOPGM(" I1");
3242
-        #if AXIS_IS_TMC(X2)
3243
-          SERIAL_ECHOPAIR_P(SP_X_STR, stepperX2.getMilliamps());
3244
-        #endif
3245
-        #if AXIS_IS_TMC(Y2)
3246
-          SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY2.getMilliamps());
3247
-        #endif
3248
-        #if AXIS_IS_TMC(Z2)
3249
-          SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ2.getMilliamps());
3250
-        #endif
3251
-        SERIAL_EOL();
3243
+        SERIAL_ECHOLNPAIR_P(
3244
+          #if AXIS_IS_TMC(X2)
3245
+            SP_X_STR, stepperX2.getMilliamps(),
3246
+          #endif
3247
+          #if AXIS_IS_TMC(Y2)
3248
+            SP_Y_STR, stepperY2.getMilliamps(),
3249
+          #endif
3250
+          #if AXIS_IS_TMC(Z2)
3251
+            SP_Z_STR, stepperZ2.getMilliamps()
3252
+          #endif
3253
+        );
3252
       #endif
3254
       #endif
3253
 
3255
 
3254
       #if AXIS_IS_TMC(Z3)
3256
       #if AXIS_IS_TMC(Z3)
3451
 
3453
 
3452
         if (chop_x || chop_y || chop_z) {
3454
         if (chop_x || chop_y || chop_z) {
3453
           say_M569(forReplay);
3455
           say_M569(forReplay);
3454
-          if (chop_x) SERIAL_ECHO_P(SP_X_STR);
3455
-          if (chop_y) SERIAL_ECHO_P(SP_Y_STR);
3456
-          if (chop_z) SERIAL_ECHO_P(SP_Z_STR);
3456
+          if (chop_x) SERIAL_ECHOPGM_P(SP_X_STR);
3457
+          if (chop_y) SERIAL_ECHOPGM_P(SP_Y_STR);
3458
+          if (chop_z) SERIAL_ECHOPGM_P(SP_Z_STR);
3457
           SERIAL_EOL();
3459
           SERIAL_EOL();
3458
         }
3460
         }
3459
 
3461
 
3475
 
3477
 
3476
         if (chop_x2 || chop_y2 || chop_z2) {
3478
         if (chop_x2 || chop_y2 || chop_z2) {
3477
           say_M569(forReplay, PSTR("I1"));
3479
           say_M569(forReplay, PSTR("I1"));
3478
-          if (chop_x2) SERIAL_ECHO_P(SP_X_STR);
3479
-          if (chop_y2) SERIAL_ECHO_P(SP_Y_STR);
3480
-          if (chop_z2) SERIAL_ECHO_P(SP_Z_STR);
3480
+          if (chop_x2) SERIAL_ECHOPGM_P(SP_X_STR);
3481
+          if (chop_y2) SERIAL_ECHOPGM_P(SP_Y_STR);
3482
+          if (chop_z2) SERIAL_ECHOPGM_P(SP_Z_STR);
3481
           SERIAL_EOL();
3483
           SERIAL_EOL();
3482
         }
3484
         }
3483
 
3485
 

Loading…
Cancel
Save