diff options
| -rw-r--r-- | quantum/pointing_device.c | 11 | ||||
| -rw-r--r-- | quantum/quantum.c | 4 | ||||
| -rw-r--r-- | tmk_core/common/keyboard.c | 12 |
3 files changed, 8 insertions, 19 deletions
diff --git a/quantum/pointing_device.c b/quantum/pointing_device.c index fbcc08e6d..09d889f69 100644 --- a/quantum/pointing_device.c +++ b/quantum/pointing_device.c | |||
| @@ -25,14 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 25 | 25 | ||
| 26 | static report_mouse_t mouseReport = {}; | 26 | static report_mouse_t mouseReport = {}; |
| 27 | 27 | ||
| 28 | __attribute__((weak)) bool has_mouse_report_changed(report_mouse_t new, report_mouse_t old) { | 28 | __attribute__((weak)) bool has_mouse_report_changed(report_mouse_t new, report_mouse_t old) { return (new.buttons != old.buttons) || (new.x&& new.x != old.x) || (new.y&& new.y != old.y) || (new.h&& new.h != old.h) || (new.v&& new.v != old.v); } |
| 29 | return (new.buttons != old.buttons) || | ||
| 30 | (new.x && new.x != old.x) || | ||
| 31 | (new.y && new.y != old.y) || | ||
| 32 | (new.h && new.h != old.h) || | ||
| 33 | (new.v && new.v != old.v); | ||
| 34 | } | ||
| 35 | |||
| 36 | 29 | ||
| 37 | __attribute__((weak)) void pointing_device_init(void) { | 30 | __attribute__((weak)) void pointing_device_init(void) { |
| 38 | // initialize device, if that needs to be done. | 31 | // initialize device, if that needs to be done. |
| @@ -50,7 +43,7 @@ __attribute__((weak)) void pointing_device_send(void) { | |||
| 50 | mouseReport.y = 0; | 43 | mouseReport.y = 0; |
| 51 | mouseReport.v = 0; | 44 | mouseReport.v = 0; |
| 52 | mouseReport.h = 0; | 45 | mouseReport.h = 0; |
| 53 | old_report = mouseReport; | 46 | old_report = mouseReport; |
| 54 | } | 47 | } |
| 55 | 48 | ||
| 56 | __attribute__((weak)) void pointing_device_task(void) { | 49 | __attribute__((weak)) void pointing_device_task(void) { |
diff --git a/quantum/quantum.c b/quantum/quantum.c index 5e0cde8a2..8ae487bec 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
| @@ -744,9 +744,7 @@ void send_byte(uint8_t number) { | |||
| 744 | send_nibble(number & 0xF); | 744 | send_nibble(number & 0xF); |
| 745 | } | 745 | } |
| 746 | 746 | ||
| 747 | void send_nibble(uint8_t number) { | 747 | void send_nibble(uint8_t number) { tap_code16(hex_to_keycode(number)); } |
| 748 | tap_code16(hex_to_keycode(number)); | ||
| 749 | } | ||
| 750 | 748 | ||
| 751 | __attribute__((weak)) uint16_t hex_to_keycode(uint8_t hex) { | 749 | __attribute__((weak)) uint16_t hex_to_keycode(uint8_t hex) { |
| 752 | hex = hex & 0xF; | 750 | hex = hex & 0xF; |
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 61b6674f9..40989ca4c 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c | |||
| @@ -113,8 +113,8 @@ void last_encoder_activity_trigger(void) { last_encoder_modification_ | |||
| 113 | 113 | ||
| 114 | // Only enable this if console is enabled to print to | 114 | // Only enable this if console is enabled to print to |
| 115 | #if defined(DEBUG_MATRIX_SCAN_RATE) | 115 | #if defined(DEBUG_MATRIX_SCAN_RATE) |
| 116 | static uint32_t matrix_timer = 0; | 116 | static uint32_t matrix_timer = 0; |
| 117 | static uint32_t matrix_scan_count = 0; | 117 | static uint32_t matrix_scan_count = 0; |
| 118 | static uint32_t last_matrix_scan_count = 0; | 118 | static uint32_t last_matrix_scan_count = 0; |
| 119 | 119 | ||
| 120 | void matrix_scan_perf_task(void) { | 120 | void matrix_scan_perf_task(void) { |
| @@ -126,14 +126,12 @@ void matrix_scan_perf_task(void) { | |||
| 126 | dprintf("matrix scan frequency: %lu\n", matrix_scan_count); | 126 | dprintf("matrix scan frequency: %lu\n", matrix_scan_count); |
| 127 | # endif | 127 | # endif |
| 128 | last_matrix_scan_count = matrix_scan_count; | 128 | last_matrix_scan_count = matrix_scan_count; |
| 129 | matrix_timer = timer_now; | 129 | matrix_timer = timer_now; |
| 130 | matrix_scan_count = 0; | 130 | matrix_scan_count = 0; |
| 131 | } | 131 | } |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | uint32_t get_matrix_scan_rate(void) { | 134 | uint32_t get_matrix_scan_rate(void) { return last_matrix_scan_count; } |
| 135 | return last_matrix_scan_count; | ||
| 136 | } | ||
| 137 | #else | 135 | #else |
| 138 | # define matrix_scan_perf_task() | 136 | # define matrix_scan_perf_task() |
| 139 | #endif | 137 | #endif |
