aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-misc.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2019-05-22 21:08:04 -0600
committerSelene ToyKeeper2019-05-22 21:08:04 -0600
commitb17fb36ccf2daec18894e9cb555615019589c5c4 (patch)
tree728ed9facd86ccc2527e1555e4fa8acbfd66c5de /spaghetti-monster/fsm-misc.c
parentsmoothed out MF01S tint "pop" a little more by making a few steps which are s... (diff)
parentD4S actually steps down a bit too fast, so... minimize that (diff)
downloadanduril-b17fb36ccf2daec18894e9cb555615019589c5c4.tar.gz
anduril-b17fb36ccf2daec18894e9cb555615019589c5c4.tar.bz2
anduril-b17fb36ccf2daec18894e9cb555615019589c5c4.zip
merged from fsm branch to get a bunch of new updates
Diffstat (limited to 'spaghetti-monster/fsm-misc.c')
-rw-r--r--spaghetti-monster/fsm-misc.c7
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