diff options
| author | Selene ToyKeeper | 2019-05-23 15:30:08 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2019-05-23 15:30:08 -0600 |
| commit | a0ba6460f7b6742c7fa14ada0d4c72f53b213168 (patch) | |
| tree | ee10fc3c698849c872e24a9edb04f15b3453c01a /spaghetti-monster/fsm-misc.c | |
| parent | merged from lantern branch, to get candle mode updates (diff) | |
| parent | D4S actually steps down a bit too fast, so... minimize that (diff) | |
| download | anduril-a0ba6460f7b6742c7fa14ada0d4c72f53b213168.tar.gz anduril-a0ba6460f7b6742c7fa14ada0d4c72f53b213168.tar.bz2 anduril-a0ba6460f7b6742c7fa14ada0d4c72f53b213168.zip | |
merged from fsm branch to get lots of updates
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 |
