Add and apply REPEAT_1 macro

This commit is contained in:
Scott Lahteine
2021-05-08 01:41:40 -05:00
parent 03184e1c31
commit ad991734c4
6 changed files with 10 additions and 7 deletions

View File

@@ -581,6 +581,7 @@
// Repeat a macro passing S...N-1.
#define REPEAT_S(S,N,OP) EVAL(_REPEAT(S,SUB##S(N),OP))
#define REPEAT(N,OP) REPEAT_S(0,N,OP)
#define REPEAT_1(N,OP) REPEAT_S(1,INCREMENT(N),OP)
// Repeat a macro passing 0...N-1 plus additional arguments.
#define REPEAT2_S(S,N,OP,V...) EVAL(_REPEAT2(S,SUB##S(N),OP,V))

View File

@@ -119,7 +119,7 @@ extern uint8_t marlin_debug_flags;
#define __S_MULTI(N) decltype(SERIAL_LEAF_##N),
#define _S_MULTI(N) __S_MULTI(N)
typedef MultiSerial< REPEAT_S(1, INCREMENT(NUM_SERIAL), _S_MULTI) 0> SerialOutputT;
typedef MultiSerial< REPEAT_1(NUM_SERIAL, _S_MULTI) 0> SerialOutputT;
#undef __S_MULTI
#undef _S_MULTI