diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index 00ef03bc70..c878a0fc29 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -53,8 +53,8 @@ extern uint8_t marlin_debug_flags; #define _PORT_REDIRECT(n,p) REMEMBER(n,serial_port_index,p) #define _PORT_RESTORE(n) RESTORE(n) #define SERIAL_OUT(WHAT, V...) do{ \ - if (!serial_port_index || serial_port_index == SERIAL_BOTH) (void)MYSERIAL0.WHAT(V); \ - if ( serial_port_index) (void)MYSERIAL1.WHAT(V); \ + if (!serial_port_index || serial_port_index == SERIAL_BOTH || serial_port_index == -1) (void)MYSERIAL0.WHAT(V); \ + if ( serial_port_index ) (void)MYSERIAL1.WHAT(V); \ }while(0) #define SERIAL_ASSERT(P) if(serial_port_index!=(P)){ debugger(); } #else @@ -69,7 +69,7 @@ extern uint8_t marlin_debug_flags; #if ENABLED(MKS_WIFI) #define SERIAL_ECHO(x) do{ \ - if (!serial_port_index || serial_port_index == SERIAL_BOTH) SERIAL_OUT(print, x); \ + if (!serial_port_index || serial_port_index == SERIAL_BOTH || serial_port_index == -1 ) SERIAL_OUT(print, x); \ if ( serial_port_index) mks_wifi_print(x); \ }while(0) #else @@ -80,7 +80,7 @@ extern uint8_t marlin_debug_flags; #if ENABLED(MKS_WIFI) #define SERIAL_ECHOLN(x) do{ \ - if (!serial_port_index || serial_port_index == SERIAL_BOTH) SERIAL_OUT(println, x); \ + if (!serial_port_index || serial_port_index == SERIAL_BOTH || serial_port_index == -1) SERIAL_OUT(println, x); \ if ( serial_port_index) mks_wifi_println(x); \ }while(0) #else @@ -116,7 +116,7 @@ extern uint8_t marlin_debug_flags; #if ENABLED(MKS_WIFI) #define SERIAL_CHAR(V...) do{ \ - if (!serial_port_index || serial_port_index == SERIAL_BOTH) _CHAR_N(NUM_ARGS(V),V); \ + if (!serial_port_index || serial_port_index == SERIAL_BOTH || serial_port_index == -1) _CHAR_N(NUM_ARGS(V),V); \ if ( serial_port_index) mks_wifi_print_var(NUM_ARGS(V),V); \ }while(0) #else diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 1212eb5ba2..6bcd4bd489 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -347,14 +347,14 @@ struct XYZval { FI XYZval operator* (const XYZEval &rs) { XYZval ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; } FI XYZval operator/ (const XYZEval &rs) const { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; } FI XYZval operator/ (const XYZEval &rs) { XYZval ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; } - FI XYZval operator* (const float &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; } - FI XYZval operator* (const float &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; } - FI XYZval operator* (const int &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; } - FI XYZval operator* (const int &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; } - FI XYZval operator/ (const float &v) const { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; } - FI XYZval operator/ (const float &v) { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; } - FI XYZval operator/ (const int &v) const { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; } - FI XYZval operator/ (const int &v) { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; } + FI XYZval operator* (const float &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; return ls; } + FI XYZval operator* (const float &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; return ls; } + FI XYZval operator* (const int &v) const { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; return ls; } + FI XYZval operator* (const int &v) { XYZval ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; return ls; } + FI XYZval operator/ (const float &v) const { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; return ls; } + FI XYZval operator/ (const float &v) { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; return ls; } + FI XYZval operator/ (const int &v) const { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; return ls; } + FI XYZval operator/ (const int &v) { XYZval ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; return ls; } FI XYZval operator>>(const int &v) const { XYZval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); return ls; } FI XYZval operator>>(const int &v) { XYZval ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); return ls; } FI XYZval operator<<(const int &v) const { XYZval ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); return ls; }