|
@ -5,6 +5,12 @@ |
|
|
#include "../pixel.h" |
|
|
#include "../pixel.h" |
|
|
#include "../util.h" |
|
|
#include "../util.h" |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MATRIX_CYCLES |
|
|
|
|
|
#define MATRIX_CYCLES 500 |
|
|
|
|
|
#endif |
|
|
|
|
|
#ifndef MATRIX_STREAMER_NUM |
|
|
|
|
|
#define MATRIX_STREAMER_NUM 30 |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
typedef struct{ |
|
|
typedef struct{ |
|
|
pixel start; |
|
|
pixel start; |
|
@ -31,8 +37,8 @@ inline static void set_bright(pixel_matrix_t *matrix, uint8_t x, uint8_t y, uint |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void matrix() { |
|
|
void matrix() { |
|
|
unsigned int counter = 500; /* run 500 cycles */ |
|
|
unsigned int counter = MATRIX_CYCLES; |
|
|
streamer streamers[STREAMER_NUM]; |
|
|
streamer streamers[MATRIX_STREAMER_NUM]; |
|
|
pixel_matrix_t matrix_bright; |
|
|
pixel_matrix_t matrix_bright; |
|
|
unsigned char x, y; |
|
|
unsigned char x, y; |
|
|
unsigned char index = 0; |
|
|
unsigned char index = 0; |
|
@ -80,7 +86,7 @@ void matrix() { |
|
|
|
|
|
|
|
|
unsigned char nsc; |
|
|
unsigned char nsc; |
|
|
for(nsc=0;nsc<6;nsc++){ |
|
|
for(nsc=0;nsc<6;nsc++){ |
|
|
if(streamer_num<STREAMER_NUM){ |
|
|
if(streamer_num<MATRIX_STREAMER_NUM){ |
|
|
unsigned char sy = random8()%(2*NUM_ROWS); |
|
|
unsigned char sy = random8()%(2*NUM_ROWS); |
|
|
if (sy>NUM_ROWS-1) sy=0; |
|
|
if (sy>NUM_ROWS-1) sy=0; |
|
|
streamers[streamer_num] = (streamer){{random8()%NUM_COLS, sy}, 0, (random8()%8)+12, index++,(random8()%16)+3}; |
|
|
streamers[streamer_num] = (streamer){{random8()%NUM_COLS, sy}, 0, (random8()%8)+12, index++,(random8()%16)+3}; |
|
|