From b9e8dfd3825c952bf06888307d3b5eca7f1bc803 Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Mon, 6 Aug 2018 19:19:05 +0900 Subject: [PATCH] add temporary test code rgblight-macro-test1.[ch] --- quantum/rgblight-macro-test1.c | 29 ++++++++++++++++++++++ quantum/rgblight-macro-test1.h | 44 ++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 quantum/rgblight-macro-test1.c create mode 100644 quantum/rgblight-macro-test1.h diff --git a/quantum/rgblight-macro-test1.c b/quantum/rgblight-macro-test1.c new file mode 100644 index 0000000000..e2cc671816 --- /dev/null +++ b/quantum/rgblight-macro-test1.c @@ -0,0 +1,29 @@ +// temporary code for test +// rgblight.c new macro test on HOST computer +// cc -o rgblight-macro-test rgblight-macro-test.c +// +#include +#include +#include + +#define _RGBM_SINGLE(sym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_MULTI(sym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_TMP(sym) RGBLIGHT_MODE_ ## sym, +enum RGBLIGHT_EFFECT_MODE { + RGBLIGHT_MODE_zero = 0, +#include "rgblight-macro-test1.h" + RGBLIGHT_MODE_end +}; + +int main(int argc, char *argv[]) +{ +#define _RGBM_SINGLE(sym) \ + printf( "RGBLIGHT_MODE_%s = %d\n", #sym, RGBLIGHT_MODE_ ## sym); +#define _RGBM_MULTI(sym) \ + printf( "RGBLIGHT_MODE_%s = %d-%d\n", #sym, \ + RGBLIGHT_MODE_ ## sym, \ + RGBLIGHT_MODE_ ## sym ## _end); +#define _RGBM_TMP(sym) + #include "rgblight-macro-test1.h" + exit(0); +} diff --git a/quantum/rgblight-macro-test1.h b/quantum/rgblight-macro-test1.h new file mode 100644 index 0000000000..c5a3a60a4e --- /dev/null +++ b/quantum/rgblight-macro-test1.h @@ -0,0 +1,44 @@ +// temporary code for test + +#ifdef _RGBM_SINGLE + _RGBM_SINGLE( STATIC_LIGHT ) + _RGBM_MULTI( BREATHING ) + _RGBM_TMP( breathing_3 ) + _RGBM_TMP( breathing_4 ) + _RGBM_TMP( BREATHING_end ) + _RGBM_MULTI( RAINBOW_MOOD ) + _RGBM_TMP( rainbow_mood_7 ) + _RGBM_TMP( RAINBOW_MOOD_end ) + _RGBM_MULTI( RAINBOW_SWIRL ) + _RGBM_TMP( rainbow_swirl_10 ) + _RGBM_TMP( rainbow_swirl_11 ) + _RGBM_TMP( rainbow_swirl_12 ) + _RGBM_TMP( rainbow_swirl_13 ) + _RGBM_TMP( RAINBOW_SWIRL_end ) + _RGBM_MULTI( SNAKE ) + _RGBM_TMP( snake_16 ) + _RGBM_TMP( snake_17 ) + _RGBM_TMP( snake_18 ) + _RGBM_TMP( snake_19 ) + _RGBM_TMP( SNAKE_end ) + _RGBM_MULTI( KNIGHT ) + _RGBM_TMP( knight_22 ) + _RGBM_TMP( KNIGHT_end ) + _RGBM_SINGLE( CHRISTMAS ) + _RGBM_MULTI( STATIC_GRADIENT ) + _RGBM_TMP( static_gradient_26 ) + _RGBM_TMP( static_gradient_27 ) + _RGBM_TMP( static_gradient_28 ) + _RGBM_TMP( static_gradient_29 ) + _RGBM_TMP( static_gradient_30 ) + _RGBM_TMP( static_gradient_31 ) + _RGBM_TMP( static_gradient_32 ) + _RGBM_TMP( static_gradient_33 ) + _RGBM_TMP( STATIC_GRADIENT_end ) + _RGBM_SINGLE( RGB_TEST ) + _RGBM_SINGLE( ALTERNATING ) +#endif + +#undef _RGBM_SINGLE +#undef _RGBM_MULTI +#undef _RGBM_TMP