]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - quantum/fauxclicky.h
fixed two typos
[qmk_firmware.git] / quantum / fauxclicky.h
index 6cfc291c051915e016ff0b01bcb88c840a769bb3..1a8e188dd5304428b9987ecc9f475f00b90ac5ae 100644 (file)
@@ -18,13 +18,16 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif
 
 #include "musical_notes.h"
+#include "stdbool.h"
 
 __attribute__ ((weak))
-float fauxclicky_pressed_note[2];
+float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_D4, 0.25);
 __attribute__ ((weak))
-float fauxclicky_released_note[2];
+float fauxclicky_released_note[2] = MUSICAL_NOTE(_C4, 0.125);
 __attribute__ ((weak))
-float fauxclicky_beep_note[2];
+float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C4, 0.25);
+
+bool fauxclicky_enabled;
 
 //
 // tempo in BPM
@@ -52,6 +55,15 @@ float fauxclicky_beep_note[2];
     fauxclicky_stop(); \
 } while (0)
 
+// toggle
+#define FAUXCLICKY_TOGGLE do { \
+    if (fauxclicky_enabled) { \
+        FAUXCLICKY_OFF; \
+    } else { \
+        FAUXCLICKY_ON; \
+    } \
+} while (0)
+
 //
 // pin configuration
 //
@@ -61,11 +73,11 @@ float fauxclicky_beep_note[2];
 #endif
 
 #ifndef FAUXCLICKY_ENABLE_OUTPUT
-#define FAUXCLICKY_ENABLE_OUTPUT TCCR3A |= _BV(COM3A1);
+#define FAUXCLICKY_ENABLE_OUTPUT TCCR3A |= _BV(COM3A1)
 #endif
 
 #ifndef FAUXCLICKY_DISABLE_OUTPUT
-#define FAUXCLICKY_DISABLE_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0));
+#define FAUXCLICKY_DISABLE_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0))
 #endif
 
 #ifndef FAUXCLICKY_TIMER_PERIOD