diff options
| author | Selene ToyKeeper | 2019-05-18 03:30:34 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2019-05-18 03:30:34 -0600 |
| commit | 2f46400dd5c13bf715331695a699a21da57aeb7f (patch) | |
| tree | 6a00fdeaff532b558a7358b21c811ade29fe5a22 /spaghetti-monster/fsm-misc.c | |
| parent | Fixed an off-by-one error in lightning mode. (diff) | |
| parent | the lantern middle-tint power correction factor wasn't quite right... (diff) | |
| download | anduril-2f46400dd5c13bf715331695a699a21da57aeb7f.tar.gz anduril-2f46400dd5c13bf715331695a699a21da57aeb7f.tar.bz2 anduril-2f46400dd5c13bf715331695a699a21da57aeb7f.zip | |
merged in BLF Lantern branch, even though it's not quite finished, because it's a public project and long overdue for a merge
Diffstat (limited to 'spaghetti-monster/fsm-misc.c')
| -rw-r--r-- | spaghetti-monster/fsm-misc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spaghetti-monster/fsm-misc.c b/spaghetti-monster/fsm-misc.c index e61fe00..9f953fa 100644 --- a/spaghetti-monster/fsm-misc.c +++ b/spaghetti-monster/fsm-misc.c @@ -146,5 +146,12 @@ void indicator_led_auto() { */ #endif // USE_INDICATOR_LED +#ifdef USE_TRIANGLE_WAVE +uint8_t triangle_wave(uint8_t phase) { + uint8_t result = phase << 1; + if (phase > 127) result = 255 - result; + return result; +} +#endif #endif |
