aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-misc.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2019-05-18 03:33:40 -0600
committerSelene ToyKeeper2019-05-18 03:33:40 -0600
commit51d53d2b30dbd3c4c585834ad81de20745740f8e (patch)
tree6e366b5cfe97f04181bc468aa06d710b7807be1d /spaghetti-monster/fsm-misc.c
parentadded link to HQ ProgKey, since it's increasingly important for newer drivers (diff)
parentmerged in BLF Lantern branch, even though it's not quite finished, because it... (diff)
downloadanduril-51d53d2b30dbd3c4c585834ad81de20745740f8e.tar.gz
anduril-51d53d2b30dbd3c4c585834ad81de20745740f8e.tar.bz2
anduril-51d53d2b30dbd3c4c585834ad81de20745740f8e.zip
merged updates from fsm branch, because it has been way too long since the last time
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