Misc. patches

This commit is contained in:
Scott Lahteine 2020-04-25 16:32:08 -05:00
parent 21067ab062
commit 4ed912eb23
4 changed files with 41 additions and 37 deletions

View file

@ -266,7 +266,7 @@ void SPIClass::endTransaction() { }
uint16_t SPIClass::read() { uint16_t SPIClass::read() {
while (!spi_is_rx_nonempty(_currentSetting->spi_d)) { /* nada */ } while (!spi_is_rx_nonempty(_currentSetting->spi_d)) { /* nada */ }
return (uint16)spi_rx_reg(_currentSetting->spi_d); return (uint16_t)spi_rx_reg(_currentSetting->spi_d);
} }
void SPIClass::read(uint8_t *buf, uint32_t len) { void SPIClass::read(uint8_t *buf, uint32_t len) {

View file

@ -30,6 +30,14 @@
#include "MarlinCore.h" #include "MarlinCore.h"
#include "HAL/shared/Delay.h"
#include "HAL/shared/esp_wifi.h"
#ifdef ARDUINO
#include <pins_arduino.h>
#endif
#include <math.h>
#include "core/utility.h" #include "core/utility.h"
#include "lcd/ultralcd.h" #include "lcd/ultralcd.h"
#include "module/motion.h" #include "module/motion.h"
@ -43,15 +51,8 @@
#include "module/printcounter.h" // PrintCounter or Stopwatch #include "module/printcounter.h" // PrintCounter or Stopwatch
#include "feature/closedloop.h" #include "feature/closedloop.h"
#include "HAL/shared/Delay.h"
#include "HAL/shared/esp_wifi.h"
#include "module/stepper/indirection.h" #include "module/stepper/indirection.h"
#ifdef ARDUINO
#include <pins_arduino.h>
#endif
#include <math.h>
#include "libs/nozzle.h" #include "libs/nozzle.h"
#include "gcode/gcode.h" #include "gcode/gcode.h"

View file

@ -245,10 +245,11 @@ extern uint8_t marlin_debug_flags;
#define SERIAL_ECHOLIST(pre,V...) do{ SERIAL_ECHOPGM(pre); _SLST_N(NUM_ARGS(V),V); }while(0) #define SERIAL_ECHOLIST(pre,V...) do{ SERIAL_ECHOPGM(pre); _SLST_N(NUM_ARGS(V),V); }while(0)
#define SERIAL_ECHOLIST_N(N,V...) _SLST_N(N,LIST_N(N,V)) #define SERIAL_ECHOLIST_N(N,V...) _SLST_N(N,LIST_N(N,V))
#define SERIAL_ECHO_P(P) (serialprintPGM(P)) #define SERIAL_ECHOPGM_P(P) (serialprintPGM(P))
#define SERIAL_ECHOLNPGM_P(P) (serialprintPGM(P "\n"))
#define SERIAL_ECHOPGM(S) (SERIAL_ECHO_P(PSTR(S))) #define SERIAL_ECHOPGM(S) (serialprintPGM(PSTR(S)))
#define SERIAL_ECHOLNPGM(S) (SERIAL_ECHO_P(PSTR(S "\n"))) #define SERIAL_ECHOLNPGM(S) (serialprintPGM(PSTR(S "\n")))
#define SERIAL_ECHOPAIR_F_P(P,V...) do{ serialprintPGM(P); SERIAL_ECHO_F(V); }while(0) #define SERIAL_ECHOPAIR_F_P(P,V...) do{ serialprintPGM(P); SERIAL_ECHO_F(V); }while(0)
#define SERIAL_ECHOLNPAIR_F_P(V...) do{ SERIAL_ECHOPAIR_F_P(V); SERIAL_EOL(); }while(0) #define SERIAL_ECHOLNPAIR_F_P(V...) do{ SERIAL_ECHOPAIR_F_P(V); SERIAL_EOL(); }while(0)

View file

@ -3224,31 +3224,33 @@ void MarlinSettings::reset() {
#if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
say_M906(forReplay); say_M906(forReplay);
#if AXIS_IS_TMC(X) SERIAL_ECHOLNPAIR_P(
SERIAL_ECHOPAIR_P(SP_X_STR, stepperX.getMilliamps()); #if AXIS_IS_TMC(X)
#endif SP_X_STR, stepperX.getMilliamps(),
#if AXIS_IS_TMC(Y) #endif
SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY.getMilliamps()); #if AXIS_IS_TMC(Y)
#endif SP_Y_STR, stepperY.getMilliamps(),
#if AXIS_IS_TMC(Z) #endif
SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ.getMilliamps()); #if AXIS_IS_TMC(Z)
#endif SP_Z_STR, stepperZ.getMilliamps()
SERIAL_EOL(); #endif
);
#endif #endif
#if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2)
say_M906(forReplay); say_M906(forReplay);
SERIAL_ECHOPGM(" I1"); SERIAL_ECHOPGM(" I1");
#if AXIS_IS_TMC(X2) SERIAL_ECHOLNPAIR_P(
SERIAL_ECHOPAIR_P(SP_X_STR, stepperX2.getMilliamps()); #if AXIS_IS_TMC(X2)
#endif SP_X_STR, stepperX2.getMilliamps(),
#if AXIS_IS_TMC(Y2) #endif
SERIAL_ECHOPAIR_P(SP_Y_STR, stepperY2.getMilliamps()); #if AXIS_IS_TMC(Y2)
#endif SP_Y_STR, stepperY2.getMilliamps(),
#if AXIS_IS_TMC(Z2) #endif
SERIAL_ECHOPAIR_P(SP_Z_STR, stepperZ2.getMilliamps()); #if AXIS_IS_TMC(Z2)
#endif SP_Z_STR, stepperZ2.getMilliamps()
SERIAL_EOL(); #endif
);
#endif #endif
#if AXIS_IS_TMC(Z3) #if AXIS_IS_TMC(Z3)
@ -3451,9 +3453,9 @@ void MarlinSettings::reset() {
if (chop_x || chop_y || chop_z) { if (chop_x || chop_y || chop_z) {
say_M569(forReplay); say_M569(forReplay);
if (chop_x) SERIAL_ECHO_P(SP_X_STR); if (chop_x) SERIAL_ECHOPGM_P(SP_X_STR);
if (chop_y) SERIAL_ECHO_P(SP_Y_STR); if (chop_y) SERIAL_ECHOPGM_P(SP_Y_STR);
if (chop_z) SERIAL_ECHO_P(SP_Z_STR); if (chop_z) SERIAL_ECHOPGM_P(SP_Z_STR);
SERIAL_EOL(); SERIAL_EOL();
} }
@ -3475,9 +3477,9 @@ void MarlinSettings::reset() {
if (chop_x2 || chop_y2 || chop_z2) { if (chop_x2 || chop_y2 || chop_z2) {
say_M569(forReplay, PSTR("I1")); say_M569(forReplay, PSTR("I1"));
if (chop_x2) SERIAL_ECHO_P(SP_X_STR); if (chop_x2) SERIAL_ECHOPGM_P(SP_X_STR);
if (chop_y2) SERIAL_ECHO_P(SP_Y_STR); if (chop_y2) SERIAL_ECHOPGM_P(SP_Y_STR);
if (chop_z2) SERIAL_ECHO_P(SP_Z_STR); if (chop_z2) SERIAL_ECHOPGM_P(SP_Z_STR);
SERIAL_EOL(); SERIAL_EOL();
} }