aboutsummaryrefslogtreecommitdiffstats
path: root/quantum/fauxclicky.h
diff options
context:
space:
mode:
authorGravatar skullY <skullydazed@gmail.com>2019-08-30 11:19:03 -0700
committerGravatar skullydazed <skullydazed@users.noreply.github.com>2019-08-30 15:01:52 -0700
commitb624f32f944acdc59dcb130674c09090c5c404cb (patch)
treebc13adbba137d122d9a2c2fb2fafcbb08ac10e25 /quantum/fauxclicky.h
parent61af76a10d00aba185b8338604171de490a13e3b (diff)
downloadqmk_firmware-b624f32f944acdc59dcb130674c09090c5c404cb.tar.gz
clang-format changes
Diffstat (limited to 'quantum/fauxclicky.h')
-rw-r--r--quantum/fauxclicky.h48
1 files changed, 23 insertions, 25 deletions
diff --git a/quantum/fauxclicky.h b/quantum/fauxclicky.h
index 1a8e188dd..5c056918a 100644
--- a/quantum/fauxclicky.h
+++ b/quantum/fauxclicky.h
@@ -14,18 +14,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef AUDIO_ENABLE
-#error "AUDIO_ENABLE and FAUXCLICKY_ENABLE cannot be both enabled"
+# error "AUDIO_ENABLE and FAUXCLICKY_ENABLE cannot be both enabled"
#endif
#include "musical_notes.h"
#include "stdbool.h"
-__attribute__ ((weak))
-float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_D4, 0.25);
-__attribute__ ((weak))
-float fauxclicky_released_note[2] = MUSICAL_NOTE(_C4, 0.125);
-__attribute__ ((weak))
-float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C4, 0.25);
+__attribute__((weak)) float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_D4, 0.25);
+__attribute__((weak)) float fauxclicky_released_note[2] = MUSICAL_NOTE(_C4, 0.125);
+__attribute__((weak)) float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C4, 0.25);
bool fauxclicky_enabled;
@@ -34,7 +31,7 @@ bool fauxclicky_enabled;
//
#ifndef FAUXCLICKY_TEMPO
-#define FAUXCLICKY_TEMPO TEMPO_DEFAULT
+# define FAUXCLICKY_TEMPO TEMPO_DEFAULT
#endif
// beep on press
@@ -50,42 +47,44 @@ bool fauxclicky_enabled;
#define FAUXCLICKY_ON fauxclicky_enabled = true
// disable
-#define FAUXCLICKY_OFF do { \
- fauxclicky_enabled = false; \
- fauxclicky_stop(); \
-} while (0)
+#define FAUXCLICKY_OFF \
+ do { \
+ fauxclicky_enabled = false; \
+ fauxclicky_stop(); \
+ } while (0)
// toggle
-#define FAUXCLICKY_TOGGLE do { \
- if (fauxclicky_enabled) { \
- FAUXCLICKY_OFF; \
- } else { \
- FAUXCLICKY_ON; \
- } \
-} while (0)
+#define FAUXCLICKY_TOGGLE \
+ do { \
+ if (fauxclicky_enabled) { \
+ FAUXCLICKY_OFF; \
+ } else { \
+ FAUXCLICKY_ON; \
+ } \
+ } while (0)
//
// pin configuration
//
#ifndef FAUXCLICKY_CPU_PRESCALER
-#define FAUXCLICKY_CPU_PRESCALER 8
+# define FAUXCLICKY_CPU_PRESCALER 8
#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
-#define FAUXCLICKY_TIMER_PERIOD ICR3
+# define FAUXCLICKY_TIMER_PERIOD ICR3
#endif
#ifndef FAUXCLICKY_DUTY_CYCLE
-#define FAUXCLICKY_DUTY_CYCLE OCR3A
+# define FAUXCLICKY_DUTY_CYCLE OCR3A
#endif
//
@@ -96,4 +95,3 @@ void fauxclicky_init(void);
void fauxclicky_stop(void);
void fauxclicky_play(float note[2]);
void fauxclicky_check(void);
-