Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Kinetic speed condition #12139

Merged
merged 1 commit into from
Mar 25, 2021
Merged

Fix Kinetic speed condition #12139

merged 1 commit into from
Mar 25, 2021

Conversation

xnuk
Copy link

@xnuk xnuk commented Mar 6, 2021

Description

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

In #define MK_COMBINED, this compile error is shown:

quantum/mousekey.c: In function 'move_unit':
quantum/mousekey.c:135:35: error: 'mouse_timer' undeclared (first use in this function)
  135 |     } else if (mousekey_repeat && mouse_timer) {
      |                                   ^~~~~~~~~~~
quantum/mousekey.c:135:35: note: each undeclared identifier is reported only once for each function it appears in
quantum/mousekey.c: At top level:
quantum/mousekey.c:149:7: error: conflicting types for 'mk_wheel_interval'
  149 | float mk_wheel_interval = 1000.0f / MOUSEKEY_WHEEL_INITIAL_MOVEMENTS;
      |       ^~~~~~~~~~~~~~~~~
quantum/mousekey.c:68:9: note: previous definition of 'mk_wheel_interval' was here
   68 | uint8_t mk_wheel_interval    = MOUSEKEY_WHEEL_INTERVAL;
      |         ^~~~~~~~~~~~~~~~~
quantum/mousekey.c: In function 'wheel_unit':
quantum/mousekey.c:156:35: error: 'mouse_timer' undeclared (first use in this function)
  156 |     } else if (mousekey_repeat && mouse_timer) {
      |                                   ^~~~~~~~~~~

And the mouse_timer is defined at #ifdef MK_KINETIC_SPEED:

#ifdef MK_KINETIC_SPEED
static uint16_t mouse_timer = 0;
#endif

But, if I read correctly, mouse_timer is only used when #ifndef MK_KINETIC_SPEED.

This PR fixes this by flipping the condition.

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added the core label Mar 6, 2021
@drashna drashna requested a review from a team March 7, 2021 23:56
@tzarc tzarc merged commit 816f2f9 into qmk:master Mar 25, 2021
mrlinuxfish pushed a commit to mrlinuxfish/qmk_firmware that referenced this pull request Mar 28, 2021
@xnuk xnuk deleted the patch-1 branch April 5, 2021 11:55
mrtnee pushed a commit to mrtnee/qmk_firmware that referenced this pull request Nov 20, 2021
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants