parent
154e6599a1
commit
60b9ce7240
@ -1,29 +0,0 @@
|
||||
// temporary code for test
|
||||
// rgblight.c new macro test on HOST computer
|
||||
// cc -o rgblight-macro-test rgblight-macro-test.c
|
||||
//
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#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);
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
// 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
|
@ -1,92 +0,0 @@
|
||||
// temporary code for test
|
||||
// rgblight.c new macro test on HOST computer
|
||||
// cc -o rgblight-macro-test rgblight-macro-test.c
|
||||
//
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef RGBLIGHT_ANIMATIONS
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
#define RGBLIGHT_EFFECT_SNAKE
|
||||
#define RGBLIGHT_EFFECT_KNIGHT
|
||||
#define RGBLIGHT_EFFECT_CHRISTMAS
|
||||
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
#define RGBLIGHT_EFFECT_RGB_TEST
|
||||
#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#define RGBLIGHT_USE_TIMER
|
||||
#endif
|
||||
|
||||
#define _RGBM_SINGLE_STATIC(sym) RGBLIGHT_MODE_ ## sym,
|
||||
#define _RGBM_SINGLE_DYNAMIC(sym) RGBLIGHT_MODE_ ## sym,
|
||||
#define _RGBM_MULTI_STATIC(sym) RGBLIGHT_MODE_ ## sym,
|
||||
#define _RGBM_MULTI_DYNAMIC(sym) RGBLIGHT_MODE_ ## sym,
|
||||
#define _RGBM_TMP_STATIC(sym) RGBLIGHT_MODE_ ## sym,
|
||||
#define _RGBM_TMP_DYNAMIC(sym) RGBLIGHT_MODE_ ## sym,
|
||||
enum RGBLIGHT_EFFECT_MODE {
|
||||
RGBLIGHT_MODE_zero = 0,
|
||||
#include "rgblight-macro-test2.h"
|
||||
RGBLIGHT_MODE_last
|
||||
};
|
||||
|
||||
#define RGBLIGHT_MODES (RGBLIGHT_MODE_last-1)
|
||||
|
||||
|
||||
#define _RGBM_SINGLE_STATIC(sym)
|
||||
#define _RGBM_SINGLE_DYNAMIC(sym) RGBLIGHT_DYNAMIC_ ## sym,
|
||||
#define _RGBM_MULTI_STATIC(sym)
|
||||
#define _RGBM_MULTI_DYNAMIC(sym) RGBLIGHT_DYNAMIC_ ## sym,
|
||||
#define _RGBM_TMP_STATIC(sym)
|
||||
#define _RGBM_TMP_DYNAMIC(sym) RGBLIGHT_DYNAMIC_ ## sym,
|
||||
enum RGBLIGHT_DYNAMIC_MODE {
|
||||
#include "rgblight-macro-test2.h"
|
||||
RGBLIGHT_DYNAMIC_last
|
||||
};
|
||||
|
||||
#define _RGBM_SINGLE_STATIC(sym) RGBLIGHT_MODE_ ## sym,
|
||||
#define _RGBM_SINGLE_DYNAMIC(sym)
|
||||
#define _RGBM_MULTI_STATIC(sym) RGBLIGHT_MODE_ ## sym,
|
||||
#define _RGBM_MULTI_DYNAMIC(sym)
|
||||
#define _RGBM_TMP_STATIC(sym) RGBLIGHT_MODE_ ## sym,
|
||||
#define _RGBM_TMP_DYNAMIC(sym)
|
||||
static uint8_t static_effect_table [] = {
|
||||
#include "rgblight-macro-test2.h"
|
||||
};
|
||||
|
||||
static inline int is_static_effect(uint8_t mode) {
|
||||
return memchr(static_effect_table, mode, sizeof(static_effect_table)) != NULL;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#define _RGBM_SINGLE_STATIC(sym) \
|
||||
printf( "RGBLIGHT_MODE_%s (st) = %d\n", #sym, RGBLIGHT_MODE_ ## sym);
|
||||
#define _RGBM_SINGLE_DYNAMIC(sym) \
|
||||
printf( "RGBLIGHT_MODE_%s = %d\n", #sym, RGBLIGHT_MODE_ ## sym);
|
||||
#define _RGBM_MULTI_STATIC(sym) \
|
||||
printf( "RGBLIGHT_MODE_%s (st) = %d-%d\n", #sym, \
|
||||
RGBLIGHT_MODE_ ## sym, \
|
||||
RGBLIGHT_MODE_ ## sym ## _end);
|
||||
#define _RGBM_MULTI_DYNAMIC(sym) \
|
||||
printf( "RGBLIGHT_MODE_%s = %d-%d\n", #sym, \
|
||||
RGBLIGHT_MODE_ ## sym, \
|
||||
RGBLIGHT_MODE_ ## sym ## _end);
|
||||
#define _RGBM_TMP_STATIC(sym)
|
||||
#define _RGBM_TMP_DYNAMIC(sym)
|
||||
#include "rgblight-macro-test2.h"
|
||||
|
||||
printf("RGBLIGHT_MODES = %d\n", RGBLIGHT_MODES);
|
||||
printf("RGBLIGHT_DYNAMIC_last = %d\n", RGBLIGHT_DYNAMIC_last);
|
||||
for( int i=0; i < sizeof(static_effect_table); i++ ) {
|
||||
printf("static table %d %d\n", i, static_effect_table[i]);
|
||||
}
|
||||
|
||||
for( int i = 1; i <= RGBLIGHT_MODES+1; i++ ) {
|
||||
printf("%2d is %s\n", i, is_static_effect(i)?"static":"dynamic");
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
// temporary code for test
|
||||
|
||||
#ifdef _RGBM_SINGLE_STATIC
|
||||
_RGBM_SINGLE_STATIC( STATIC_LIGHT )
|
||||
#ifdef RGBLIGHT_EFFECT_BREATHING
|
||||
_RGBM_MULTI_DYNAMIC( BREATHING )
|
||||
_RGBM_TMP_DYNAMIC( breathing_3 )
|
||||
_RGBM_TMP_DYNAMIC( breathing_4 )
|
||||
_RGBM_TMP_DYNAMIC( BREATHING_end )
|
||||
#endif
|
||||
#ifdef RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
_RGBM_MULTI_DYNAMIC( RAINBOW_MOOD )
|
||||
_RGBM_TMP_DYNAMIC( rainbow_mood_7 )
|
||||
_RGBM_TMP_DYNAMIC( RAINBOW_MOOD_end )
|
||||
#endif
|
||||
#ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
_RGBM_MULTI_DYNAMIC( RAINBOW_SWIRL )
|
||||
_RGBM_TMP_DYNAMIC( rainbow_swirl_10 )
|
||||
_RGBM_TMP_DYNAMIC( rainbow_swirl_11 )
|
||||
_RGBM_TMP_DYNAMIC( rainbow_swirl_12 )
|
||||
_RGBM_TMP_DYNAMIC( rainbow_swirl_13 )
|
||||
_RGBM_TMP_DYNAMIC( RAINBOW_SWIRL_end )
|
||||
#endif
|
||||
#ifdef RGBLIGHT_EFFECT_SNAKE
|
||||
_RGBM_MULTI_DYNAMIC( SNAKE )
|
||||
_RGBM_TMP_DYNAMIC( snake_16 )
|
||||
_RGBM_TMP_DYNAMIC( snake_17 )
|
||||
_RGBM_TMP_DYNAMIC( snake_18 )
|
||||
_RGBM_TMP_DYNAMIC( snake_19 )
|
||||
_RGBM_TMP_DYNAMIC( SNAKE_end )
|
||||
#endif
|
||||
#ifdef RGBLIGHT_EFFECT_KNIGHT
|
||||
_RGBM_MULTI_DYNAMIC( KNIGHT )
|
||||
_RGBM_TMP_DYNAMIC( knight_22 )
|
||||
_RGBM_TMP_DYNAMIC( KNIGHT_end )
|
||||
#endif
|
||||
#ifdef RGBLIGHT_EFFECT_CHRISTMAS
|
||||
_RGBM_SINGLE_DYNAMIC( CHRISTMAS )
|
||||
#endif
|
||||
#ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
_RGBM_MULTI_STATIC( STATIC_GRADIENT )
|
||||
_RGBM_TMP_STATIC( static_gradient_26 )
|
||||
_RGBM_TMP_STATIC( static_gradient_27 )
|
||||
_RGBM_TMP_STATIC( static_gradient_28 )
|
||||
_RGBM_TMP_STATIC( static_gradient_29 )
|
||||
_RGBM_TMP_STATIC( static_gradient_30 )
|
||||
_RGBM_TMP_STATIC( static_gradient_31 )
|
||||
_RGBM_TMP_STATIC( static_gradient_32 )
|
||||
_RGBM_TMP_STATIC( static_gradient_33 )
|
||||
_RGBM_TMP_STATIC( STATIC_GRADIENT_end )
|
||||
#endif
|
||||
#ifdef RGBLIGHT_EFFECT_RGB_TEST
|
||||
_RGBM_SINGLE_DYNAMIC( RGB_TEST )
|
||||
#endif
|
||||
#ifdef RGBLIGHT_EFFECT_ALTERNATING
|
||||
_RGBM_SINGLE_DYNAMIC( ALTERNATING )
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#undef _RGBM_SINGLE_STATIC
|
||||
#undef _RGBM_SINGLE_DYNAMIC
|
||||
#undef _RGBM_MULTI_STATIC
|
||||
#undef _RGBM_MULTI_DYNAMIC
|
||||
#undef _RGBM_TMP_STATIC
|
||||
#undef _RGBM_TMP_DYNAMIC
|
Loading…
Reference in new issue