blob: f56e1ecc76d46908461ef4652a466af6582215d4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#pragma once
#include <stdint.h>
#include "ws2812b.h"
#define DEFINE_PATTERN \
__attribute__((__section__( \
".patterns"))) volatile static pattern_t __FILE__ =
typedef struct {
/* Name of the pattern. */
const char* name;
/* Return the rgb for the pixel at the given offset 'x' and time 't' */
rgb_t (*get_rgb)(uint32_t t, size_t x);
/* Resets the pattern to the beginning. */
void (*reset)(void);
} pattern_t;
extern pattern_t PATTERNS_START;
extern pattern_t PATTERNS_END;
#define patterns (&PATTERNS_START)
#define n_patterns (&PATTERNS_END - &PATTERNS_START)
rgb_t twinkle(uint32_t t, size_t x);
rgb_t more_twinkle(uint32_t t, size_t x);
|