X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=quantum%2Ffauxclicky.h;h=1a8e188dd5304428b9987ecc9f475f00b90ac5ae;hb=4c1164c469a103981478222b21ef5ffaa364448d;hp=6cfc291c051915e016ff0b01bcb88c840a769bb3;hpb=c68e596f32c5d450a714627871408407e9988ef7;p=qmk_firmware.git diff --git a/quantum/fauxclicky.h b/quantum/fauxclicky.h index 6cfc291c0..1a8e188dd 100644 --- a/quantum/fauxclicky.h +++ b/quantum/fauxclicky.h @@ -18,13 +18,16 @@ along with this program. If not, see . #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