aboutsummaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
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 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);
82void layer_off(uint8_t layer); 82void layer_off(uint8_t layer);
83void layer_invert(uint8_t layer); 83void layer_invert(uint8_t layer);
84/* bitwise operation */ 84/* bitwise operation */
85void layer_or(layer_state_t state); 85void layer_or(layer_state_t state);
86void layer_and(layer_state_t state); 86void layer_and(layer_state_t state);
87void layer_xor(layer_state_t state); 87void layer_xor(layer_state_t state);
88layer_state_t layer_state_set_user(layer_state_t state); 88layer_state_t layer_state_set_user(layer_state_t state);
89layer_state_t layer_state_set_kb(layer_state_t state); 89layer_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
34static report_mouse_t mouse_report = {0}; 34static report_mouse_t mouse_report = {0};
35static void mousekey_debug(void); 35static void mousekey_debug(void);
36static uint8_t mousekey_accel = 0; 36static uint8_t mousekey_accel = 0;
37static uint8_t mousekey_repeat = 0; 37static uint8_t mousekey_repeat = 0;
38static uint8_t mousekey_wheel_repeat = 0; 38static 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
231void mousekey_off(uint8_t code) { 230void mousekey_off(uint8_t code) {
@@ -284,10 +283,10 @@ uint16_t w_intervals[mkspd_COUNT] = {MK_W_INTERVAL_UNMOD, MK_W_INTERVAL_0
284void mousekey_task(void) { 283void 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
423void mousekey_clear(void) { 422void 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
430static void mousekey_debug(void) { 429static 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))
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c
index 68c61cf55..ae33e86a7 100644
--- a/tmk_core/protocol/chibios/usb_main.c
+++ b/tmk_core/protocol/chibios/usb_main.c
@@ -888,39 +888,43 @@ void virtser_task(void) {
888void send_joystick_packet(joystick_t *joystick) { 888void send_joystick_packet(joystick_t *joystick) {
889 joystick_report_t rep = { 889 joystick_report_t rep = {
890# if JOYSTICK_AXES_COUNT > 0 890# if JOYSTICK_AXES_COUNT > 0
891 .axes = {joystick->axes[0], 891 .axes =
892 {
893 joystick->axes[0],
892 894
893# if JOYSTICK_AXES_COUNT >= 2 895# if JOYSTICK_AXES_COUNT >= 2
894 joystick->axes[1], 896 joystick->axes[1],
895# endif 897# endif
896# if JOYSTICK_AXES_COUNT >= 3 898# if JOYSTICK_AXES_COUNT >= 3
897 joystick->axes[2], 899 joystick->axes[2],
898# endif 900# endif
899# if JOYSTICK_AXES_COUNT >= 4 901# if JOYSTICK_AXES_COUNT >= 4
900 joystick->axes[3], 902 joystick->axes[3],
901# endif 903# endif
902# if JOYSTICK_AXES_COUNT >= 5 904# if JOYSTICK_AXES_COUNT >= 5
903 joystick->axes[4], 905 joystick->axes[4],
904# endif 906# endif
905# if JOYSTICK_AXES_COUNT >= 6 907# if JOYSTICK_AXES_COUNT >= 6
906 joystick->axes[5], 908 joystick->axes[5],
907# endif 909# endif
908 }, 910 },
909# endif // JOYSTICK_AXES_COUNT>0 911# endif // JOYSTICK_AXES_COUNT>0
910 912
911# if JOYSTICK_BUTTON_COUNT > 0 913# if JOYSTICK_BUTTON_COUNT > 0
912 .buttons = {joystick->buttons[0], 914 .buttons =
915 {
916 joystick->buttons[0],
913 917
914# if JOYSTICK_BUTTON_COUNT > 8 918# if JOYSTICK_BUTTON_COUNT > 8
915 joystick->buttons[1], 919 joystick->buttons[1],
916# endif 920# endif
917# if JOYSTICK_BUTTON_COUNT > 16 921# if JOYSTICK_BUTTON_COUNT > 16
918 joystick->buttons[2], 922 joystick->buttons[2],
919# endif 923# endif
920# if JOYSTICK_BUTTON_COUNT > 24 924# if JOYSTICK_BUTTON_COUNT > 24
921 joystick->buttons[3], 925 joystick->buttons[3],
922# endif 926# endif
923 } 927 }
924# endif // JOYSTICK_BUTTON_COUNT>0 928# endif // JOYSTICK_BUTTON_COUNT>0
925 }; 929 };
926 930
diff --git a/tmk_core/protocol/lufa/adafruit_ble.h b/tmk_core/protocol/lufa/adafruit_ble.h
index aebded7b3..9dfc9b435 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
41 * (milliseconds) */ 41 * (milliseconds) */
42extern bool adafruit_ble_send_consumer_key(uint16_t keycode, int hold_duration); 42extern bool adafruit_ble_send_consumer_key(uint16_t keycode, int hold_duration);
43 43
44# ifdef MOUSE_ENABLE 44#ifdef MOUSE_ENABLE
45/* Send a mouse/wheel movement report. 45/* Send a mouse/wheel movement report.
46 * The parameters are signed and indicate positive of negative direction 46 * The parameters are signed and indicate positive of negative direction
47 * change. */ 47 * change. */
48extern bool adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, uint8_t buttons); 48extern bool adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, uint8_t buttons);
49# endif 49#endif
50 50
51/* Compute battery voltage by reading an analog pin. 51/* Compute battery voltage by reading an analog pin.
52 * Returns the integer number of millivolts */ 52 * Returns the integer number of millivolts */
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index 09ba0bacf..cec004402 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -316,39 +316,43 @@ void send_joystick_packet(joystick_t *joystick) {
316 316
317 joystick_report_t r = { 317 joystick_report_t r = {
318# if JOYSTICK_AXES_COUNT > 0 318# if JOYSTICK_AXES_COUNT > 0
319 .axes = {joystick->axes[0], 319 .axes =
320 {
321 joystick->axes[0],
320 322
321# if JOYSTICK_AXES_COUNT >= 2 323# if JOYSTICK_AXES_COUNT >= 2
322 joystick->axes[1], 324 joystick->axes[1],
323# endif 325# endif
324# if JOYSTICK_AXES_COUNT >= 3 326# if JOYSTICK_AXES_COUNT >= 3
325 joystick->axes[2], 327 joystick->axes[2],
326# endif 328# endif
327# if JOYSTICK_AXES_COUNT >= 4 329# if JOYSTICK_AXES_COUNT >= 4
328 joystick->axes[3], 330 joystick->axes[3],
329# endif 331# endif
330# if JOYSTICK_AXES_COUNT >= 5 332# if JOYSTICK_AXES_COUNT >= 5
331 joystick->axes[4], 333 joystick->axes[4],
332# endif 334# endif
333# if JOYSTICK_AXES_COUNT >= 6 335# if JOYSTICK_AXES_COUNT >= 6
334 joystick->axes[5], 336 joystick->axes[5],
335# endif 337# endif
336 }, 338 },
337# endif // JOYSTICK_AXES_COUNT>0 339# endif // JOYSTICK_AXES_COUNT>0
338 340
339# if JOYSTICK_BUTTON_COUNT > 0 341# if JOYSTICK_BUTTON_COUNT > 0
340 .buttons = {joystick->buttons[0], 342 .buttons =
343 {
344 joystick->buttons[0],
341 345
342# if JOYSTICK_BUTTON_COUNT > 8 346# if JOYSTICK_BUTTON_COUNT > 8
343 joystick->buttons[1], 347 joystick->buttons[1],
344# endif 348# endif
345# if JOYSTICK_BUTTON_COUNT > 16 349# if JOYSTICK_BUTTON_COUNT > 16
346 joystick->buttons[2], 350 joystick->buttons[2],
347# endif 351# endif
348# if JOYSTICK_BUTTON_COUNT > 24 352# if JOYSTICK_BUTTON_COUNT > 24
349 joystick->buttons[3], 353 joystick->buttons[3],
350# endif 354# endif
351 } 355 }
352# endif // JOYSTICK_BUTTON_COUNT>0 356# endif // JOYSTICK_BUTTON_COUNT>0
353 }; 357 };
354 358