diff options
| author | QMK Bot <hello@qmk.fm> | 2020-08-29 22:57:48 +0000 |
|---|---|---|
| committer | QMK Bot <hello@qmk.fm> | 2020-08-29 22:57:48 +0000 |
| commit | a3db72df7299140e52f57d082a3742a8b480a226 (patch) | |
| tree | 41d62db0fecd2eb0aeae1744b52e677555e55288 /tmk_core/common | |
| parent | 000eb14d789f84afc7dbd33955dbfb6481792f0b (diff) | |
| download | qmk_firmware-a3db72df7299140e52f57d082a3742a8b480a226.tar.gz qmk_firmware-a3db72df7299140e52f57d082a3742a8b480a226.zip | |
format code according to conventions [skip ci]
Diffstat (limited to 'tmk_core/common')
| -rw-r--r-- | tmk_core/common/action_layer.h | 7 | ||||
| -rw-r--r-- | tmk_core/common/mousekey.c | 19 | ||||
| -rw-r--r-- | tmk_core/common/progmem.h | 2 |
3 files changed, 13 insertions, 15 deletions
diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index 9b9173c33..f9f686112 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); | |||
| 82 | void layer_off(uint8_t layer); | 82 | void layer_off(uint8_t layer); |
| 83 | void layer_invert(uint8_t layer); | 83 | void layer_invert(uint8_t layer); |
| 84 | /* bitwise operation */ | 84 | /* bitwise operation */ |
| 85 | void layer_or(layer_state_t state); | 85 | void layer_or(layer_state_t state); |
| 86 | void layer_and(layer_state_t state); | 86 | void layer_and(layer_state_t state); |
| 87 | void layer_xor(layer_state_t state); | 87 | void layer_xor(layer_state_t state); |
| 88 | layer_state_t layer_state_set_user(layer_state_t state); | 88 | layer_state_t layer_state_set_user(layer_state_t state); |
| 89 | layer_state_t layer_state_set_kb(layer_state_t state); | 89 | layer_state_t layer_state_set_kb(layer_state_t state); |
| 90 | #else | 90 | #else |
| @@ -107,7 +107,6 @@ layer_state_t layer_state_set_kb(layer_state_t state); | |||
| 107 | # define layer_state_set_user(state) (void)state | 107 | # define layer_state_set_user(state) (void)state |
| 108 | #endif | 108 | #endif |
| 109 | 109 | ||
| 110 | |||
| 111 | /* pressed actions cache */ | 110 | /* pressed actions cache */ |
| 112 | #if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) | 111 | #if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) |
| 113 | 112 | ||
diff --git a/tmk_core/common/mousekey.c b/tmk_core/common/mousekey.c index 390c74e0f..ef18bcf1a 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) { | |||
| 33 | 33 | ||
| 34 | static report_mouse_t mouse_report = {0}; | 34 | static report_mouse_t mouse_report = {0}; |
| 35 | static void mousekey_debug(void); | 35 | static void mousekey_debug(void); |
| 36 | static uint8_t mousekey_accel = 0; | 36 | static uint8_t mousekey_accel = 0; |
| 37 | static uint8_t mousekey_repeat = 0; | 37 | static uint8_t mousekey_repeat = 0; |
| 38 | static uint8_t mousekey_wheel_repeat = 0; | 38 | static uint8_t mousekey_wheel_repeat = 0; |
| 39 | 39 | ||
| 40 | #ifndef MK_3_SPEED | 40 | #ifndef MK_3_SPEED |
| @@ -225,7 +225,6 @@ void mousekey_on(uint8_t code) { | |||
| 225 | mousekey_accel |= (1 << 1); | 225 | mousekey_accel |= (1 << 1); |
| 226 | else if (code == KC_MS_ACCEL2) | 226 | else if (code == KC_MS_ACCEL2) |
| 227 | mousekey_accel |= (1 << 2); | 227 | mousekey_accel |= (1 << 2); |
| 228 | |||
| 229 | } | 228 | } |
| 230 | 229 | ||
| 231 | void mousekey_off(uint8_t code) { | 230 | void mousekey_off(uint8_t code) { |
| @@ -284,10 +283,10 @@ uint16_t w_intervals[mkspd_COUNT] = {MK_W_INTERVAL_UNMOD, MK_W_INTERVAL_0 | |||
| 284 | void mousekey_task(void) { | 283 | void mousekey_task(void) { |
| 285 | // report cursor and scroll movement independently | 284 | // report cursor and scroll movement independently |
| 286 | report_mouse_t const tmpmr = mouse_report; | 285 | report_mouse_t const tmpmr = mouse_report; |
| 287 | mouse_report.x = 0; | 286 | mouse_report.x = 0; |
| 288 | mouse_report.y = 0; | 287 | mouse_report.y = 0; |
| 289 | mouse_report.v = 0; | 288 | mouse_report.v = 0; |
| 290 | mouse_report.h = 0; | 289 | mouse_report.h = 0; |
| 291 | 290 | ||
| 292 | if ((tmpmr.x || tmpmr.y) && timer_elapsed(last_timer_c) > c_intervals[mk_speed]) { | 291 | if ((tmpmr.x || tmpmr.y) && timer_elapsed(last_timer_c) > c_intervals[mk_speed]) { |
| 293 | mouse_report.x = tmpmr.x; | 292 | mouse_report.x = tmpmr.x; |
| @@ -421,10 +420,10 @@ void mousekey_send(void) { | |||
| 421 | } | 420 | } |
| 422 | 421 | ||
| 423 | void mousekey_clear(void) { | 422 | void mousekey_clear(void) { |
| 424 | mouse_report = (report_mouse_t){}; | 423 | mouse_report = (report_mouse_t){}; |
| 425 | mousekey_repeat = 0; | 424 | mousekey_repeat = 0; |
| 426 | mousekey_wheel_repeat = 0; | 425 | mousekey_wheel_repeat = 0; |
| 427 | mousekey_accel = 0; | 426 | mousekey_accel = 0; |
| 428 | } | 427 | } |
| 429 | 428 | ||
| 430 | static void mousekey_debug(void) { | 429 | static void mousekey_debug(void) { |
diff --git a/tmk_core/common/progmem.h b/tmk_core/common/progmem.h index 41b5b537c..c8863d3ad 100644 --- a/tmk_core/common/progmem.h +++ b/tmk_core/common/progmem.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | # include <avr/pgmspace.h> | 4 | # include <avr/pgmspace.h> |
| 5 | #else | 5 | #else |
| 6 | # define PROGMEM | 6 | # define PROGMEM |
| 7 | # define PGM_P const char * | 7 | # define PGM_P const char* |
| 8 | # define memcpy_P(dest, src, n) memcpy(dest, src, n) | 8 | # define memcpy_P(dest, src, n) memcpy(dest, src, n) |
| 9 | # define pgm_read_byte(address_short) *((uint8_t*)(address_short)) | 9 | # define pgm_read_byte(address_short) *((uint8_t*)(address_short)) |
| 10 | # define pgm_read_word(address_short) *((uint16_t*)(address_short)) | 10 | # define pgm_read_word(address_short) *((uint16_t*)(address_short)) |
