Define animation based on cycle time
This commit is contained in:
parent
5d1ef2263a
commit
a3da7c3803
|
@ -1 +1 @@
|
||||||
424
|
425
|
||||||
|
|
|
@ -69,8 +69,10 @@ void Animation_Poll(void)
|
||||||
static unsigned int bottom = 0;
|
static unsigned int bottom = 0;
|
||||||
static unsigned int top = 0;
|
static unsigned int top = 0;
|
||||||
|
|
||||||
bottom += ANIMATION_STEPS / ANIMATION_DURATION_BOTTOM;
|
bottom += ANIMATION_STEPS / ANIMATION_CYCLE_TIME_BOTTOM
|
||||||
top += ANIMATION_STEPS / ANIMATION_DURATION_TOP;
|
/ ANIMATION_REFRESH_RATE;
|
||||||
|
top += ANIMATION_STEPS / ANIMATION_CYCLE_TIME_TOP
|
||||||
|
/ ANIMATION_REFRESH_RATE;
|
||||||
|
|
||||||
bottom %= 2 * ANIMATION_STEPS;
|
bottom %= 2 * ANIMATION_STEPS;
|
||||||
top %= 2 * ANIMATION_STEPS;
|
top %= 2 * ANIMATION_STEPS;
|
||||||
|
|
|
@ -8,10 +8,12 @@
|
||||||
|
|
||||||
#define ANIMATION_REFRESH_RATE 10
|
#define ANIMATION_REFRESH_RATE 10
|
||||||
|
|
||||||
#define ANIMATION_DURATION_BOTTOM \
|
// Cycle time of the animation for the bottom end of the gradient (in seconds)
|
||||||
6048000
|
#define ANIMATION_CYCLE_TIME_BOTTOM \
|
||||||
|
(6 * 24 * 60 * 60)
|
||||||
#define ANIMATION_DURATION_TOP 6652800
|
// Cycle time of the animation for the top end of the gradient (in seconds)
|
||||||
|
#define ANIMATION_CYCLE_TIME_TOP \
|
||||||
|
(8 * 24 * 60 * 60)
|
||||||
|
|
||||||
extern const unsigned int Animation_LEDOrder[LED_COUNT];
|
extern const unsigned int Animation_LEDOrder[LED_COUNT];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue