Browse Source

Serial assert (needs work)

Scott Lahteine 6 years ago
parent
commit
94f2e82897
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      Marlin/src/core/serial.h

+ 2
- 0
Marlin/src/core/serial.h View File

60
     if (!serial_port_index || serial_port_index == SERIAL_BOTH) (void)MYSERIAL0.WHAT(V); \
60
     if (!serial_port_index || serial_port_index == SERIAL_BOTH) (void)MYSERIAL0.WHAT(V); \
61
     if ( serial_port_index) (void)MYSERIAL1.WHAT(V); \
61
     if ( serial_port_index) (void)MYSERIAL1.WHAT(V); \
62
   }while(0)
62
   }while(0)
63
+  #define SERIAL_ASSERT(P)      if(serial_port_index!=(P)){ debugger(); }
63
 #else
64
 #else
64
   #define _PORT_REDIRECT(n,p)   NOOP
65
   #define _PORT_REDIRECT(n,p)   NOOP
65
   #define _PORT_RESTORE(n)      NOOP
66
   #define _PORT_RESTORE(n)      NOOP
66
   #define SERIAL_OUT(WHAT, V...) (void)MYSERIAL0.WHAT(V)
67
   #define SERIAL_OUT(WHAT, V...) (void)MYSERIAL0.WHAT(V)
68
+  #define SERIAL_ASSERT(P)      NOOP
67
 #endif
69
 #endif
68
 
70
 
69
 #define PORT_REDIRECT(p)        _PORT_REDIRECT(1,p)
71
 #define PORT_REDIRECT(p)        _PORT_REDIRECT(1,p)

Loading…
Cancel
Save