summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2020-08-29 22:57:48 +0000
committerDrashna Jael're <drashna@live.com>2020-09-30 03:46:37 -0700
commit3902b562fc3b7fc3a8390a744db0e4bad58707e1 (patch)
tree53ff7a02c35e577961b2dc8e0ded450cc6a2d23c /tmk_core
parentdb2254c3ea97aababea038d8c05b7a8990a0a139 (diff)
format code according to conventions [skip ci]
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common/action_layer.h7
-rw-r--r--tmk_core/common/mousekey.c19
-rw-r--r--tmk_core/common/progmem.h2
-rw-r--r--tmk_core/protocol/chibios/usb_main.c28
-rw-r--r--tmk_core/protocol/lufa/adafruit_ble.h4
-rw-r--r--tmk_core/protocol/lufa/lufa.c28
6 files changed, 47 insertions, 41 deletions
diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h
index 9b9173c33b..f9f6861120 100644
--- a/tmk_core/common/action_layer.h
+++ b/tmk_core/common/action_layer.h
@@ -82,9 +82,9 @@ void layer_on(uint8_t layer);
void layer_off(uint8_t layer);
void layer_invert(uint8_t layer);
/* bitwise operation */
-void layer_or(layer_state_t state);
-void layer_and(layer_state_t state);
-void layer_xor(layer_state_t state);
+void layer_or(layer_state_t state);
+void layer_and(layer_state_t state);
+void layer_xor(layer_state_t state);
layer_state_t layer_state_set_user(layer_state_t state);
layer_state_t layer_state_set_kb(layer_state_t state);
#else
@@ -107,7 +107,6 @@ layer_state_t layer_state_set_kb(layer_state_t state);
# define layer_state_set_user(state) (void)state
#endif
-
/* pressed actions cache */
#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE)
diff --git a/tmk_core/common/mousekey.c b/tmk_core/common/mousekey.c
index 390c74e0f1..ef18bcf1a8 100644
--- a/tmk_core/common/mousekey.c
+++ b/tmk_core/common/mousekey.c
@@ -33,8 +33,8 @@ inline int8_t times_inv_sqrt2(int8_t x) {
static report_mouse_t mouse_report = {0};
static void mousekey_debug(void);
-static uint8_t mousekey_accel = 0;
-static uint8_t mousekey_repeat = 0;
+static uint8_t mousekey_accel = 0;
+static uint8_t mousekey_repeat = 0;
static uint8_t mousekey_wheel_repeat = 0;
#ifndef MK_3_SPEED
@@ -225,7 +225,6 @@ void mousekey_on(uint8_t code) {
mousekey_accel |= (1 << 1);
else if (code == KC_MS_ACCEL2)
mousekey_accel |= (1 << 2);
-
}
void mousekey_off(uint8_t code) {
@@ -284,10 +283,10 @@ uint16_t w_intervals[mkspd_COUNT] = {MK_W_INTERVAL_UNMOD, MK_W_INTERVAL_0
void mousekey_task(void) {
// report cursor and scroll movement independently
report_mouse_t const tmpmr = mouse_report;
- mouse_report.x = 0;
- mouse_report.y = 0;
- mouse_report.v = 0;
- mouse_report.h = 0;
+ mouse_report.x = 0;
+ mouse_report.y = 0;
+ mouse_report.v = 0;
+ mouse_report.h = 0;
if ((tmpmr.x || tmpmr.y) && timer_elapsed(last_timer_c) > c_intervals[mk_speed]) {
mouse_report.x = tmpmr.x;
@@ -421,10 +420,10 @@ void mousekey_send(void) {
}
void mousekey_clear(void) {
- mouse_report = (report_mouse_t){};
- mousekey_repeat = 0;
+ mouse_report = (report_mouse_t){};
+ mousekey_repeat = 0;
mousekey_wheel_repeat = 0;
- mousekey_accel = 0;
+ mousekey_accel = 0;
}
static void mousekey_debug(void) {
diff --git a/tmk_core/common/progmem.h b/tmk_core/common/progmem.h
index 41b5b537ce..c8863d3ad2 100644
--- a/tmk_core/common/progmem.h
+++ b/tmk_core/common/progmem.h
@@ -4,7 +4,7 @@
# include <avr/pgmspace.h>
#else
# define PROGMEM
-# define PGM_P const char *
+# define PGM_P const char*
# define memcpy_P(dest, src, n) memcpy(dest, src, n)
# define pgm_read_byte(address_short) *((uint8_t*)(address_short))
# define pgm_read_word(address_short) *((uint16_t*)(address_short))
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c
index 131acfedff..037aa077ce 100644
--- a/tmk_core/protocol/chibios/usb_main.c
+++ b/tmk_core/protocol/chibios/usb_main.c
@@ -963,39 +963,43 @@ void virtser_task(void) {
void send_joystick_packet(joystick_t *joystick) {
joystick_report_t rep = {
# if JOYSTICK_AXES_COUNT > 0
- .axes = {joystick->axes[0],
+ .axes =
+ {
+ joystick->axes[0],
# if JOYSTICK_AXES_COUNT >= 2
- joystick->axes[1],
+ joystick->axes[1],
# endif
# if JOYSTICK_AXES_COUNT >= 3
- joystick->axes[2],
+ joystick->axes[2],
# endif
# if JOYSTICK_AXES_COUNT >= 4
- joystick->axes[3],
+ joystick->axes[3],
# endif
# if JOYSTICK_AXES_COUNT >= 5
- joystick->axes[4],
+ joystick->axes[4],
# endif
# if JOYSTICK_AXES_COUNT >= 6
- joystick->axes[5],
+ joystick->axes[5],
# endif
- },
+ },
# endif // JOYSTICK_AXES_COUNT>0
# if JOYSTICK_BUTTON_COUNT > 0
- .buttons = {joystick->buttons[0],
+ .buttons =
+ {
+ joystick->buttons[0],
# if JOYSTICK_BUTTON_COUNT > 8
- joystick->buttons[1],
+ joystick->buttons[1],
# endif
# if JOYSTICK_BUTTON_COUNT > 16
- joystick->buttons[2],
+ joystick->buttons[2],
# endif
# if JOYSTICK_BUTTON_COUNT > 24
- joystick->buttons[3],
+ joystick->buttons[3],
# endif
- }
+ }
# endif // JOYSTICK_BUTTON_COUNT>0
};
diff --git a/tmk_core/protocol/lufa/adafruit_ble.h b/tmk_core/protocol/lufa/adafruit_ble.h
index aebded7b31..9dfc9b4355 100644
--- a/tmk_core/protocol/lufa/adafruit_ble.h
+++ b/tmk_core/protocol/lufa/adafruit_ble.h
@@ -41,12 +41,12 @@ extern bool adafruit_ble_send_keys(uint8_t hid_modifier_mask, uint8_t *keys, uin
* (milliseconds) */
extern bool adafruit_ble_send_consumer_key(uint16_t keycode, int hold_duration);
-# ifdef MOUSE_ENABLE
+#ifdef MOUSE_ENABLE
/* Send a mouse/wheel movement report.
* The parameters are signed and indicate positive of negative direction
* change. */
extern bool adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, uint8_t buttons);
-# endif
+#endif
/* Compute battery voltage by reading an analog pin.
* Returns the integer number of millivolts */
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index cd9f0d3e08..1cd9b1eae1 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -379,39 +379,43 @@ void send_joystick_packet(joystick_t *joystick) {
joystick_report_t r = {
# if JOYSTICK_AXES_COUNT > 0
- .axes = {joystick->axes[0],
+ .axes =
+ {
+ joystick->axes[0],
# if JOYSTICK_AXES_COUNT >= 2
- joystick->axes[1],
+ joystick->axes[1],
# endif
# if JOYSTICK_AXES_COUNT >= 3
- joystick->axes[2],
+ joystick->axes[2],
# endif
# if JOYSTICK_AXES_COUNT >= 4
- joystick->axes[3],
+ joystick->axes[3],
# endif
# if JOYSTICK_AXES_COUNT >= 5
- joystick->axes[4],
+ joystick->axes[4],
# endif
# if JOYSTICK_AXES_COUNT >= 6
- joystick->axes[5],
+ joystick->axes[5],
# endif
- },
+ },
# endif // JOYSTICK_AXES_COUNT>0
# if JOYSTICK_BUTTON_COUNT > 0
- .buttons = {joystick->buttons[0],
+ .buttons =
+ {
+ joystick->buttons[0],
# if JOYSTICK_BUTTON_COUNT > 8
- joystick->buttons[1],
+ joystick->buttons[1],
# endif
# if JOYSTICK_BUTTON_COUNT > 16
- joystick->buttons[2],
+ joystick->buttons[2],
# endif
# if JOYSTICK_BUTTON_COUNT > 24
- joystick->buttons[3],
+ joystick->buttons[3],
# endif
- }
+ }
# endif // JOYSTICK_BUTTON_COUNT>0
};