Prusa MINI Firmware overview
serial.h File Reference

Go to the source code of this file.

Macros

#define DEBUGGING(F)   (marlin_debug_flags & (MARLIN_DEBUG_## F))
 
#define SERIAL_BOTH   0x7F
 
#define _PORT_REDIRECT(n, p)   NOOP
 
#define _PORT_RESTORE(n)   NOOP
 
#define SERIAL_OUT(WHAT, V...)   (void)MYSERIAL0.WHAT(V)
 
#define SERIAL_ASSERT(P)   NOOP
 
#define PORT_REDIRECT(p)   _PORT_REDIRECT(1,p)
 
#define PORT_RESTORE()   _PORT_RESTORE(1)
 
#define SERIAL_CHAR(x)   SERIAL_OUT(write, x)
 
#define SERIAL_ECHO(x)   SERIAL_OUT(print, x)
 
#define SERIAL_ECHO_F(V...)   SERIAL_OUT(print, V)
 
#define SERIAL_ECHOLN(x)   SERIAL_OUT(println, x)
 
#define SERIAL_PRINT(x, b)   SERIAL_OUT(print, x, b)
 
#define SERIAL_PRINTLN(x, b)   SERIAL_OUT(println, x, b)
 
#define SERIAL_PRINTF(V...)   SERIAL_OUT(printf, V)
 
#define SERIAL_FLUSH()   SERIAL_OUT(flush)
 
#define SERIAL_FLUSHTX()   SERIAL_OUT(flushTX)
 
#define __SEP_N(N, V...)   _SEP_##N(V)
 
#define _SEP_N(N, V...)   __SEP_N(N,V)
 
#define _SEP_1(PRE)   SERIAL_ECHOPGM(PRE)
 
#define _SEP_2(PRE, V)   serial_echopair_PGM(PSTR(PRE),V)
 
#define _SEP_3(a, b, c)   do{ _SEP_2(a,b); SERIAL_ECHOPGM(c); }while(0)
 
#define _SEP_4(a, b, V...)   do{ _SEP_2(a,b); _SEP_2(V); }while(0)
 
#define _SEP_5(a, b, V...)   do{ _SEP_2(a,b); _SEP_3(V); }while(0)
 
#define _SEP_6(a, b, V...)   do{ _SEP_2(a,b); _SEP_4(V); }while(0)
 
#define _SEP_7(a, b, V...)   do{ _SEP_2(a,b); _SEP_5(V); }while(0)
 
#define _SEP_8(a, b, V...)   do{ _SEP_2(a,b); _SEP_6(V); }while(0)
 
#define _SEP_9(a, b, V...)   do{ _SEP_2(a,b); _SEP_7(V); }while(0)
 
#define _SEP_10(a, b, V...)   do{ _SEP_2(a,b); _SEP_8(V); }while(0)
 
#define _SEP_11(a, b, V...)   do{ _SEP_2(a,b); _SEP_9(V); }while(0)
 
#define _SEP_12(a, b, V...)   do{ _SEP_2(a,b); _SEP_10(V); }while(0)
 
#define _SEP_13(a, b, V...)   do{ _SEP_2(a,b); _SEP_11(V); }while(0)
 
#define _SEP_14(a, b, V...)   do{ _SEP_2(a,b); _SEP_12(V); }while(0)
 
#define _SEP_15(a, b, V...)   do{ _SEP_2(a,b); _SEP_13(V); }while(0)
 
#define _SEP_16(a, b, V...)   do{ _SEP_2(a,b); _SEP_14(V); }while(0)
 
#define _SEP_17(a, b, V...)   do{ _SEP_2(a,b); _SEP_15(V); }while(0)
 
#define _SEP_18(a, b, V...)   do{ _SEP_2(a,b); _SEP_16(V); }while(0)
 
#define _SEP_19(a, b, V...)   do{ _SEP_2(a,b); _SEP_17(V); }while(0)
 
#define _SEP_20(a, b, V...)   do{ _SEP_2(a,b); _SEP_18(V); }while(0)
 
#define _SEP_21(a, b, V...)   do{ _SEP_2(a,b); _SEP_19(V); }while(0)
 
#define _SEP_22(a, b, V...)   do{ _SEP_2(a,b); _SEP_20(V); }while(0)
 
#define _SEP_23(a, b, V...)   do{ _SEP_2(a,b); _SEP_21(V); }while(0)
 
#define _SEP_24(a, b, V...)   do{ _SEP_2(a,b); _SEP_22(V); }while(0)
 
#define SERIAL_ECHOPAIR(V...)   _SEP_N(NUM_ARGS(V),V)
 
#define __SELP_N(N, V...)   _SELP_##N(V)
 
#define _SELP_N(N, V...)   __SELP_N(N,V)
 
#define _SELP_1(PRE)   SERIAL_ECHOLNPGM(PRE)
 
#define _SELP_2(PRE, V)   do{ serial_echopair_PGM(PSTR(PRE),V); SERIAL_EOL(); }while(0)
 
#define _SELP_3(a, b, c)   do{ _SEP_2(a,b); SERIAL_ECHOLNPGM(c); }while(0)
 
#define _SELP_4(a, b, V...)   do{ _SEP_2(a,b); _SELP_2(V); }while(0)
 
#define _SELP_5(a, b, V...)   do{ _SEP_2(a,b); _SELP_3(V); }while(0)
 
#define _SELP_6(a, b, V...)   do{ _SEP_2(a,b); _SELP_4(V); }while(0)
 
#define _SELP_7(a, b, V...)   do{ _SEP_2(a,b); _SELP_5(V); }while(0)
 
#define _SELP_8(a, b, V...)   do{ _SEP_2(a,b); _SELP_6(V); }while(0)
 
#define _SELP_9(a, b, V...)   do{ _SEP_2(a,b); _SELP_7(V); }while(0)
 
#define _SELP_10(a, b, V...)   do{ _SEP_2(a,b); _SELP_8(V); }while(0)
 
#define _SELP_11(a, b, V...)   do{ _SEP_2(a,b); _SELP_9(V); }while(0)
 
#define _SELP_12(a, b, V...)   do{ _SEP_2(a,b); _SELP_10(V); }while(0)
 
#define _SELP_13(a, b, V...)   do{ _SEP_2(a,b); _SELP_11(V); }while(0)
 
#define _SELP_14(a, b, V...)   do{ _SEP_2(a,b); _SELP_12(V); }while(0)
 
#define _SELP_15(a, b, V...)   do{ _SEP_2(a,b); _SELP_13(V); }while(0)
 
#define _SELP_16(a, b, V...)   do{ _SEP_2(a,b); _SELP_14(V); }while(0)
 
#define _SELP_17(a, b, V...)   do{ _SEP_2(a,b); _SELP_15(V); }while(0)
 
#define _SELP_18(a, b, V...)   do{ _SEP_2(a,b); _SELP_16(V); }while(0)
 
#define _SELP_19(a, b, V...)   do{ _SEP_2(a,b); _SELP_17(V); }while(0)
 
#define _SELP_20(a, b, V...)   do{ _SEP_2(a,b); _SELP_18(V); }while(0)
 
#define _SELP_21(a, b, V...)   do{ _SEP_2(a,b); _SELP_19(V); }while(0)
 
#define _SELP_22(a, b, V...)   do{ _SEP_2(a,b); _SELP_20(V); }while(0)
 
#define _SELP_23(a, b, V...)   do{ _SEP_2(a,b); _SELP_21(V); }while(0)
 
#define _SELP_24(a, b, V...)   do{ _SEP_2(a,b); _SELP_22(V); }while(0)
 
#define SERIAL_ECHOLNPAIR(V...)   _SELP_N(NUM_ARGS(V),V)
 
#define __SLST_N(N, V...)   _SLST_##N(V)
 
#define _SLST_N(N, V...)   __SLST_N(N,V)
 
#define _SLST_1(a)   SERIAL_ECHO(a)
 
#define _SLST_2(a, b)   do{ SERIAL_ECHO(a); SERIAL_ECHOPAIR(", ",b); }while(0)
 
#define _SLST_3(a, b, c)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_1(c); }while(0)
 
#define _SLST_4(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_2(V); }while(0)
 
#define _SLST_5(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_3(V); }while(0)
 
#define _SLST_6(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_4(V); }while(0)
 
#define _SLST_7(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_5(V); }while(0)
 
#define _SLST_8(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_6(V); }while(0)
 
#define _SLST_9(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_7(V); }while(0)
 
#define _SLST_10(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_8(V); }while(0)
 
#define _SLST_11(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_9(V); }while(0)
 
#define _SLST_12(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_10(V); }while(0)
 
#define _SLST_13(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_11(V); }while(0)
 
#define _SLST_14(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_12(V); }while(0)
 
#define _SLST_15(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_13(V); }while(0)
 
#define _SLST_16(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_14(V); }while(0)
 
#define _SLST_17(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_15(V); }while(0)
 
#define _SLST_18(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_16(V); }while(0)
 
#define _SLST_19(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_17(V); }while(0)
 
#define _SLST_20(a, b, V...)   do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_18(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_ECHOPGM(S)   (serialprintPGM(PSTR(S)))
 
#define SERIAL_ECHOLNPGM(S)   (serialprintPGM(PSTR(S "\n")))
 
#define SERIAL_ECHOPAIR_F(S, V...)   do{ SERIAL_ECHOPGM(S); SERIAL_ECHO_F(V); }while(0)
 
#define SERIAL_ECHOLNPAIR_F(V...)   do{ SERIAL_ECHOPAIR_F(V); SERIAL_EOL(); }while(0)
 
#define SERIAL_ECHO_START()   serial_echo_start()
 
#define SERIAL_ERROR_START()   serial_error_start()
 
#define SERIAL_EOL()   SERIAL_CHAR('\n')
 
#define SERIAL_ECHO_MSG(S)   do{ SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(S); }while(0)
 
#define SERIAL_ERROR_MSG(S)   do{ SERIAL_ERROR_START(); SERIAL_ECHOLNPGM(S); }while(0)
 
#define SERIAL_ECHO_SP(C)   serial_spaces(C)
 
#define SERIAL_ECHO_TERNARY(TF, PRE, ON, OFF, POST)   serial_ternary(TF, PSTR(PRE), PSTR(ON), PSTR(OFF), PSTR(POST))
 
#define SERIAL_POS(SUFFIX, VAR)   do { print_xyz(VAR, PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n")); }while(0)
 
#define SERIAL_XYZ(PREFIX, V...)   do { print_xyz(V, PSTR(PREFIX), nullptr); }while(0)
 

Enumerations

enum  MarlinDebugFlags : uint8_t {
  MARLIN_DEBUG_NONE = 0, MARLIN_DEBUG_ECHO = _BV(0), MARLIN_DEBUG_INFO = _BV(1), MARLIN_DEBUG_ERRORS = _BV(2),
  MARLIN_DEBUG_DRYRUN = _BV(3), MARLIN_DEBUG_COMMUNICATION = _BV(4), MARLIN_DEBUG_LEVELING = 0, MARLIN_DEBUG_MESH_ADJUST = 0,
  MARLIN_DEBUG_ALL = 0xFF
}
 

Functions

void serial_echopair_PGM (PGM_P const s_P, const char *v)
 
void serial_echopair_PGM (PGM_P const s_P, char v)
 
void serial_echopair_PGM (PGM_P const s_P, int v)
 
void serial_echopair_PGM (PGM_P const s_P, long v)
 
void serial_echopair_PGM (PGM_P const s_P, float v)
 
void serial_echopair_PGM (PGM_P const s_P, double v)
 
void serial_echopair_PGM (PGM_P const s_P, unsigned int v)
 
void serial_echopair_PGM (PGM_P const s_P, unsigned long v)
 
void serial_echopair_PGM (PGM_P const s_P, uint8_t v)
 
void serial_echopair_PGM (PGM_P const s_P, bool v)
 
void serial_echopair_PGM (PGM_P const s_P, void *v)
 
void serialprintPGM (PGM_P str)
 
void serial_echo_start ()
 
void serial_error_start ()
 
void serial_ternary (const bool onoff, PGM_P const pre, PGM_P const on, PGM_P const off, PGM_P const post=nullptr)
 
void serialprint_onoff (const bool onoff)
 
void serialprintln_onoff (const bool onoff)
 
void serialprint_truefalse (const bool tf)
 
void serial_spaces (uint8_t count)
 
void print_bin (const uint16_t val)
 
void print_xyz (const float &x, const float &y, const float &z, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr)
 
void print_xyz (const xyz_pos_t &xyz, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr)
 

Variables

uint8_t marlin_debug_flags
 

Macro Definition Documentation

◆ DEBUGGING

#define DEBUGGING (   F)    (marlin_debug_flags & (MARLIN_DEBUG_## F))

◆ SERIAL_BOTH

#define SERIAL_BOTH   0x7F

◆ _PORT_REDIRECT

#define _PORT_REDIRECT (   n,
 
)    NOOP

◆ _PORT_RESTORE

#define _PORT_RESTORE (   n)    NOOP

◆ SERIAL_OUT

#define SERIAL_OUT (   WHAT,
  V... 
)    (void)MYSERIAL0.WHAT(V)

◆ SERIAL_ASSERT

#define SERIAL_ASSERT (   P)    NOOP

◆ PORT_REDIRECT

#define PORT_REDIRECT (   p)    _PORT_REDIRECT(1,p)

◆ PORT_RESTORE

#define PORT_RESTORE ( )    _PORT_RESTORE(1)

◆ SERIAL_CHAR

#define SERIAL_CHAR (   x)    SERIAL_OUT(write, x)

◆ SERIAL_ECHO

#define SERIAL_ECHO (   x)    SERIAL_OUT(print, x)

◆ SERIAL_ECHO_F

#define SERIAL_ECHO_F (   V...)    SERIAL_OUT(print, V)

◆ SERIAL_ECHOLN

#define SERIAL_ECHOLN (   x)    SERIAL_OUT(println, x)

◆ SERIAL_PRINT

#define SERIAL_PRINT (   x,
 
)    SERIAL_OUT(print, x, b)

◆ SERIAL_PRINTLN

#define SERIAL_PRINTLN (   x,
 
)    SERIAL_OUT(println, x, b)

◆ SERIAL_PRINTF

#define SERIAL_PRINTF (   V...)    SERIAL_OUT(printf, V)

◆ SERIAL_FLUSH

#define SERIAL_FLUSH ( )    SERIAL_OUT(flush)

◆ SERIAL_FLUSHTX

#define SERIAL_FLUSHTX ( )    SERIAL_OUT(flushTX)

◆ __SEP_N

#define __SEP_N (   N,
  V... 
)    _SEP_##N(V)

◆ _SEP_N

#define _SEP_N (   N,
  V... 
)    __SEP_N(N,V)

◆ _SEP_1

#define _SEP_1 (   PRE)    SERIAL_ECHOPGM(PRE)

◆ _SEP_2

#define _SEP_2 (   PRE,
 
)    serial_echopair_PGM(PSTR(PRE),V)

◆ _SEP_3

#define _SEP_3 (   a,
  b,
 
)    do{ _SEP_2(a,b); SERIAL_ECHOPGM(c); }while(0)

◆ _SEP_4

#define _SEP_4 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_2(V); }while(0)

◆ _SEP_5

#define _SEP_5 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_3(V); }while(0)

◆ _SEP_6

#define _SEP_6 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_4(V); }while(0)

◆ _SEP_7

#define _SEP_7 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_5(V); }while(0)

◆ _SEP_8

#define _SEP_8 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_6(V); }while(0)

◆ _SEP_9

#define _SEP_9 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_7(V); }while(0)

◆ _SEP_10

#define _SEP_10 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_8(V); }while(0)

◆ _SEP_11

#define _SEP_11 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_9(V); }while(0)

◆ _SEP_12

#define _SEP_12 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_10(V); }while(0)

◆ _SEP_13

#define _SEP_13 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_11(V); }while(0)

◆ _SEP_14

#define _SEP_14 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_12(V); }while(0)

◆ _SEP_15

#define _SEP_15 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_13(V); }while(0)

◆ _SEP_16

#define _SEP_16 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_14(V); }while(0)

◆ _SEP_17

#define _SEP_17 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_15(V); }while(0)

◆ _SEP_18

#define _SEP_18 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_16(V); }while(0)

◆ _SEP_19

#define _SEP_19 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_17(V); }while(0)

◆ _SEP_20

#define _SEP_20 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_18(V); }while(0)

◆ _SEP_21

#define _SEP_21 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_19(V); }while(0)

◆ _SEP_22

#define _SEP_22 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_20(V); }while(0)

◆ _SEP_23

#define _SEP_23 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_21(V); }while(0)

◆ _SEP_24

#define _SEP_24 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SEP_22(V); }while(0)

◆ SERIAL_ECHOPAIR

#define SERIAL_ECHOPAIR (   V...)    _SEP_N(NUM_ARGS(V),V)

◆ __SELP_N

#define __SELP_N (   N,
  V... 
)    _SELP_##N(V)

◆ _SELP_N

#define _SELP_N (   N,
  V... 
)    __SELP_N(N,V)

◆ _SELP_1

#define _SELP_1 (   PRE)    SERIAL_ECHOLNPGM(PRE)

◆ _SELP_2

#define _SELP_2 (   PRE,
 
)    do{ serial_echopair_PGM(PSTR(PRE),V); SERIAL_EOL(); }while(0)

◆ _SELP_3

#define _SELP_3 (   a,
  b,
 
)    do{ _SEP_2(a,b); SERIAL_ECHOLNPGM(c); }while(0)

◆ _SELP_4

#define _SELP_4 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_2(V); }while(0)

◆ _SELP_5

#define _SELP_5 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_3(V); }while(0)

◆ _SELP_6

#define _SELP_6 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_4(V); }while(0)

◆ _SELP_7

#define _SELP_7 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_5(V); }while(0)

◆ _SELP_8

#define _SELP_8 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_6(V); }while(0)

◆ _SELP_9

#define _SELP_9 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_7(V); }while(0)

◆ _SELP_10

#define _SELP_10 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_8(V); }while(0)

◆ _SELP_11

#define _SELP_11 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_9(V); }while(0)

◆ _SELP_12

#define _SELP_12 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_10(V); }while(0)

◆ _SELP_13

#define _SELP_13 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_11(V); }while(0)

◆ _SELP_14

#define _SELP_14 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_12(V); }while(0)

◆ _SELP_15

#define _SELP_15 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_13(V); }while(0)

◆ _SELP_16

#define _SELP_16 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_14(V); }while(0)

◆ _SELP_17

#define _SELP_17 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_15(V); }while(0)

◆ _SELP_18

#define _SELP_18 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_16(V); }while(0)

◆ _SELP_19

#define _SELP_19 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_17(V); }while(0)

◆ _SELP_20

#define _SELP_20 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_18(V); }while(0)

◆ _SELP_21

#define _SELP_21 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_19(V); }while(0)

◆ _SELP_22

#define _SELP_22 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_20(V); }while(0)

◆ _SELP_23

#define _SELP_23 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_21(V); }while(0)

◆ _SELP_24

#define _SELP_24 (   a,
  b,
  V... 
)    do{ _SEP_2(a,b); _SELP_22(V); }while(0)

◆ SERIAL_ECHOLNPAIR

#define SERIAL_ECHOLNPAIR (   V...)    _SELP_N(NUM_ARGS(V),V)

◆ __SLST_N

#define __SLST_N (   N,
  V... 
)    _SLST_##N(V)

◆ _SLST_N

#define _SLST_N (   N,
  V... 
)    __SLST_N(N,V)

◆ _SLST_1

#define _SLST_1 (   a)    SERIAL_ECHO(a)

◆ _SLST_2

#define _SLST_2 (   a,
 
)    do{ SERIAL_ECHO(a); SERIAL_ECHOPAIR(", ",b); }while(0)

◆ _SLST_3

#define _SLST_3 (   a,
  b,
 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_1(c); }while(0)

◆ _SLST_4

#define _SLST_4 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_2(V); }while(0)

◆ _SLST_5

#define _SLST_5 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_3(V); }while(0)

◆ _SLST_6

#define _SLST_6 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_4(V); }while(0)

◆ _SLST_7

#define _SLST_7 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_5(V); }while(0)

◆ _SLST_8

#define _SLST_8 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_6(V); }while(0)

◆ _SLST_9

#define _SLST_9 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_7(V); }while(0)

◆ _SLST_10

#define _SLST_10 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_8(V); }while(0)

◆ _SLST_11

#define _SLST_11 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_9(V); }while(0)

◆ _SLST_12

#define _SLST_12 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_10(V); }while(0)

◆ _SLST_13

#define _SLST_13 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_11(V); }while(0)

◆ _SLST_14

#define _SLST_14 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_12(V); }while(0)

◆ _SLST_15

#define _SLST_15 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_13(V); }while(0)

◆ _SLST_16

#define _SLST_16 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_14(V); }while(0)

◆ _SLST_17

#define _SLST_17 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_15(V); }while(0)

◆ _SLST_18

#define _SLST_18 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_16(V); }while(0)

◆ _SLST_19

#define _SLST_19 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_17(V); }while(0)

◆ _SLST_20

#define _SLST_20 (   a,
  b,
  V... 
)    do{ SERIAL_ECHO(a); _SEP_2(", ",b); _SLST_18(V); }while(0)

◆ SERIAL_ECHOLIST

#define SERIAL_ECHOLIST (   pre,
  V... 
)    do{ SERIAL_ECHOPGM(pre); _SLST_N(NUM_ARGS(V),V); }while(0)

◆ SERIAL_ECHOLIST_N

#define SERIAL_ECHOLIST_N (   N,
  V... 
)    _SLST_N(N,LIST_N(N,V))

◆ SERIAL_ECHOPGM

#define SERIAL_ECHOPGM (   S)    (serialprintPGM(PSTR(S)))

◆ SERIAL_ECHOLNPGM

#define SERIAL_ECHOLNPGM (   S)    (serialprintPGM(PSTR(S "\n")))

◆ SERIAL_ECHOPAIR_F

#define SERIAL_ECHOPAIR_F (   S,
  V... 
)    do{ SERIAL_ECHOPGM(S); SERIAL_ECHO_F(V); }while(0)

◆ SERIAL_ECHOLNPAIR_F

#define SERIAL_ECHOLNPAIR_F (   V...)    do{ SERIAL_ECHOPAIR_F(V); SERIAL_EOL(); }while(0)

◆ SERIAL_ECHO_START

#define SERIAL_ECHO_START ( )    serial_echo_start()

◆ SERIAL_ERROR_START

#define SERIAL_ERROR_START ( )    serial_error_start()

◆ SERIAL_EOL

#define SERIAL_EOL ( )    SERIAL_CHAR('\n')

◆ SERIAL_ECHO_MSG

#define SERIAL_ECHO_MSG (   S)    do{ SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(S); }while(0)

◆ SERIAL_ERROR_MSG

#define SERIAL_ERROR_MSG (   S)    do{ SERIAL_ERROR_START(); SERIAL_ECHOLNPGM(S); }while(0)

◆ SERIAL_ECHO_SP

#define SERIAL_ECHO_SP (   C)    serial_spaces(C)

◆ SERIAL_ECHO_TERNARY

#define SERIAL_ECHO_TERNARY (   TF,
  PRE,
  ON,
  OFF,
  POST 
)    serial_ternary(TF, PSTR(PRE), PSTR(ON), PSTR(OFF), PSTR(POST))

◆ SERIAL_POS

#define SERIAL_POS (   SUFFIX,
  VAR 
)    do { print_xyz(VAR, PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n")); }while(0)

◆ SERIAL_XYZ

#define SERIAL_XYZ (   PREFIX,
  V... 
)    do { print_xyz(V, PSTR(PREFIX), nullptr); }while(0)

Enumeration Type Documentation

◆ MarlinDebugFlags

Marlin 3D Printer Firmware Copyright (c) 2019 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 http://www.gnu.org/licenses/. Define debug bit-masks

Enumerator
MARLIN_DEBUG_NONE 
MARLIN_DEBUG_ECHO 

Echo commands in order as they are processed.

MARLIN_DEBUG_INFO 

Print messages for code that has debug output.

MARLIN_DEBUG_ERRORS 

Not implemented.

MARLIN_DEBUG_DRYRUN 

Ignore temperature setting and E movement commands.

MARLIN_DEBUG_COMMUNICATION 

Not implemented.

MARLIN_DEBUG_LEVELING 
MARLIN_DEBUG_MESH_ADJUST 
MARLIN_DEBUG_ALL 
29  : uint8_t {
31  MARLIN_DEBUG_ECHO = _BV(0), ///< Echo commands in order as they are processed
32  MARLIN_DEBUG_INFO = _BV(1), ///< Print messages for code that has debug output
33  MARLIN_DEBUG_ERRORS = _BV(2), ///< Not implemented
34  MARLIN_DEBUG_DRYRUN = _BV(3), ///< Ignore temperature setting and E movement commands
35  MARLIN_DEBUG_COMMUNICATION = _BV(4), ///< Not implemented
36  #if ENABLED(DEBUG_LEVELING_FEATURE)
37  MARLIN_DEBUG_LEVELING = _BV(5), ///< Print detailed output for homing and leveling
38  MARLIN_DEBUG_MESH_ADJUST = _BV(6), ///< UBL bed leveling
39  #else
42  #endif
43  MARLIN_DEBUG_ALL = 0xFF
44 };

Function Documentation

◆ serial_echopair_PGM() [1/11]

void serial_echopair_PGM ( PGM_P const  s_P,
const char *  v 
)
41 { serialprintPGM(s_P); SERIAL_ECHO(v); }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ serial_echopair_PGM() [2/11]

void serial_echopair_PGM ( PGM_P const  s_P,
char  v 
)
42 { serialprintPGM(s_P); SERIAL_CHAR(v); }
Here is the call graph for this function:

◆ serial_echopair_PGM() [3/11]

void serial_echopair_PGM ( PGM_P const  s_P,
int  v 
)
43 { serialprintPGM(s_P); SERIAL_ECHO(v); }
Here is the call graph for this function:

◆ serial_echopair_PGM() [4/11]

void serial_echopair_PGM ( PGM_P const  s_P,
long  v 
)
44 { serialprintPGM(s_P); SERIAL_ECHO(v); }
Here is the call graph for this function:

◆ serial_echopair_PGM() [5/11]

void serial_echopair_PGM ( PGM_P const  s_P,
float  v 
)
45 { serialprintPGM(s_P); SERIAL_ECHO(v); }
Here is the call graph for this function:

◆ serial_echopair_PGM() [6/11]

void serial_echopair_PGM ( PGM_P const  s_P,
double  v 
)
46 { serialprintPGM(s_P); SERIAL_ECHO(v); }
Here is the call graph for this function:

◆ serial_echopair_PGM() [7/11]

void serial_echopair_PGM ( PGM_P const  s_P,
unsigned int  v 
)
47 { serialprintPGM(s_P); SERIAL_ECHO(v); }
Here is the call graph for this function:

◆ serial_echopair_PGM() [8/11]

void serial_echopair_PGM ( PGM_P const  s_P,
unsigned long  v 
)
48 { serialprintPGM(s_P); SERIAL_ECHO(v); }
Here is the call graph for this function:

◆ serial_echopair_PGM() [9/11]

void serial_echopair_PGM ( PGM_P const  s_P,
uint8_t  v 
)
201 { serial_echopair_PGM(s_P, (int)v); }
Here is the call graph for this function:

◆ serial_echopair_PGM() [10/11]

void serial_echopair_PGM ( PGM_P const  s_P,
bool  v 
)
202 { serial_echopair_PGM(s_P, (int)v); }
Here is the call graph for this function:

◆ serial_echopair_PGM() [11/11]

void serial_echopair_PGM ( PGM_P const  s_P,
void v 
)
203 { serial_echopair_PGM(s_P, (unsigned long)v); }
Here is the call graph for this function:

◆ serialprintPGM()

void serialprintPGM ( PGM_P  str)
35  {
36  while (const char c = pgm_read_byte(str++)) SERIAL_CHAR(c);
37 }
Here is the caller graph for this function:

◆ serial_echo_start()

void serial_echo_start ( )
38 { serialprintPGM(echomagic); }
Here is the call graph for this function:

◆ serial_error_start()

void serial_error_start ( )
39 { serialprintPGM(errormagic); }
Here is the call graph for this function:

◆ serial_ternary()

void serial_ternary ( const bool  onoff,
PGM_P const  pre,
PGM_P const  on,
PGM_P const  off,
PGM_P const  post = nullptr 
)
52  {
53  if (pre) serialprintPGM(pre);
54  serialprintPGM(onoff ? on : off);
55  if (post) serialprintPGM(post);
56 }
Here is the call graph for this function:

◆ serialprint_onoff()

void serialprint_onoff ( const bool  onoff)
57 { serialprintPGM(onoff ? PSTR(MSG_ON) : PSTR(MSG_OFF)); }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ serialprintln_onoff()

void serialprintln_onoff ( const bool  onoff)
58 { serialprint_onoff(onoff); SERIAL_EOL(); }
Here is the call graph for this function:

◆ serialprint_truefalse()

void serialprint_truefalse ( const bool  tf)
59 { serialprintPGM(tf ? PSTR("true") : PSTR("false")); }
Here is the call graph for this function:

◆ serial_spaces()

void serial_spaces ( uint8_t  count)
50 { count *= (PROPORTIONAL_FONT_RATIO); while (count--) SERIAL_CHAR(' '); }

◆ print_bin()

void print_bin ( const uint16_t  val)
61  {
62  uint16_t mask = 0x8000;
63  for (uint8_t i = 16; i--;) {
64  if (i && !(i % 4)) SERIAL_CHAR(' ');
65  SERIAL_CHAR((val & mask) ? '1' : '0');
66  mask >>= 1;
67  }
68 }

◆ print_xyz() [1/2]

void print_xyz ( const float &  x,
const float &  y,
const float &  z,
PGM_P const  prefix = nullptr,
PGM_P const  suffix = nullptr 
)
70  {
71  serialprintPGM(prefix);
72  SERIAL_ECHOPAIR(" " MSG_X, x, " " MSG_Y, y, " " MSG_Z, z);
73  if (suffix) serialprintPGM(suffix); else SERIAL_EOL();
74 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_xyz() [2/2]

void print_xyz ( const xyz_pos_t xyz,
PGM_P const  prefix = nullptr,
PGM_P const  suffix = nullptr 
)
218  {
219  print_xyz(xyz.x, xyz.y, xyz.z, prefix, suffix);
220 }
Here is the call graph for this function:

Variable Documentation

◆ marlin_debug_flags

uint8_t marlin_debug_flags

Marlin 3D Printer Firmware Copyright (c) 2019 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 http://www.gnu.org/licenses/.

XYZval::z
T z
Definition: types.h:286
SERIAL_CHAR
#define SERIAL_CHAR(x)
Definition: serial.h:69
MARLIN_DEBUG_ALL
Definition: serial.h:43
serial_echopair_PGM
void serial_echopair_PGM(PGM_P const s_P, const char *v)
Definition: serial.cpp:41
SERIAL_ECHO
#define SERIAL_ECHO(x)
Definition: serial.h:70
XYZval::x
T x
Definition: types.h:286
MSG_X
#define MSG_X
Definition: language.h:319
SERIAL_ECHOPAIR
#define SERIAL_ECHOPAIR(V...)
Definition: serial.h:114
MARLIN_DEBUG_NONE
Definition: serial.h:30
MARLIN_DEBUG_LEVELING
Definition: serial.h:40
i
uint8_t i
Definition: screen_test_graph.c:72
MARLIN_DEBUG_COMMUNICATION
Not implemented.
Definition: serial.h:35
pgm_read_byte
#define pgm_read_byte(addr)
Definition: pgmspace.h:95
PSTR
#define PSTR(str)
Definition: pgmspace.h:31
MARLIN_DEBUG_INFO
Print messages for code that has debug output.
Definition: serial.h:32
MSG_Y
#define MSG_Y
Definition: language.h:320
MARLIN_DEBUG_DRYRUN
Ignore temperature setting and E movement commands.
Definition: serial.h:34
MSG_Z
#define MSG_Z
Definition: language.h:321
MSG_ON
#define MSG_ON
Definition: language.h:213
uint8_t
const uint8_t[]
Definition: 404_html.c:3
MARLIN_DEBUG_ERRORS
Not implemented.
Definition: serial.h:33
_BV
#define _BV(bit)
Definition: wiring_constants.h:99
PROPORTIONAL_FONT_RATIO
#define PROPORTIONAL_FONT_RATIO
Definition: Configuration_A3ides_2209_MINI_adv.h:2044
XYZval::y
T y
Definition: types.h:286
MARLIN_DEBUG_ECHO
Echo commands in order as they are processed.
Definition: serial.h:31
print_xyz
void print_xyz(const float &x, const float &y, const float &z, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr)
Definition: serial.cpp:70
SERIAL_EOL
#define SERIAL_EOL()
Definition: serial.h:181
serialprint_onoff
void serialprint_onoff(const bool onoff)
Definition: serial.cpp:57
MSG_OFF
#define MSG_OFF
Definition: language.h:214
MARLIN_DEBUG_MESH_ADJUST
Definition: serial.h:41
serialprintPGM
void serialprintPGM(PGM_P str)
Definition: serial.cpp:35