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

[Bug] [matrix/noah] Mod-Tap requires 2 taps to initiate #8259

Closed
1 of 3 tasks
fobbyal opened this issue Feb 27, 2020 · 16 comments · Fixed by #8333
Closed
1 of 3 tasks

[Bug] [matrix/noah] Mod-Tap requires 2 taps to initiate #8259

fobbyal opened this issue Feb 27, 2020 · 16 comments · Fixed by #8333

Comments

@fobbyal
Copy link

fobbyal commented Feb 27, 2020

Describe the Bug

I have configured LCTL_T(KC_ESC) for the caps-lock position and and it requires a double tap to trigger escape initially. Actually if i started tapping fast continuously the first 2 taps register as one escape but the following taps registers as expected. For example,

Tap -> 150ms -> Tap -> 150ms -> Tap -> 150ms -> Tap -> 150ms -> Tap -> 150ms -> 

will only register 4 escape not 5 escapes. If i just Tap once it doesn't register anything. It seems that the driver only recognizes the Tab if it is somehow triggered in a very short amount of time. I have other keyboards with the same Mod-Tap configuration registered but do not have the issue. We may need some help form the maintainer @yulei . Here is my fork that re-produces this issue. I would like to help but i only have limited experience in C and don't know where to start.

mod tab requires 2 taps to initiate.

System Information

  • Keyboard: matrix/noah
    • Revision (if applicable):
  • Operating system: OSX
  • AVR GCC version: 8.3.0
  • ARM GCC version: 8.3.1
  • QMK Firmware version: 0.7.109
  • Any keyboard related software installed?
    • AutoHotKey
    • Karabiner (doesn't work even if i shut it down)
    • Other:

Additional Context

@yulei
Copy link
Contributor

yulei commented Mar 2, 2020

Maybe the following lines in the config.h should be removed. they were used as a work around before the fix by #7595 .

// tapping setting
#define TAPPING_TERM 200
#define RETRO_TAPPING
#define PERMISSIVE_HOLD

@fobbyal
Copy link
Author

fobbyal commented Mar 3, 2020 via email

@fobbyal
Copy link
Author

fobbyal commented Mar 3, 2020

it didn't work with those lines commented out. I am going to try to debug a little when i have some free time. You have any idea where i can print out some debug statements off the top of your head?
image

@drashna
Copy link
Member

drashna commented Mar 4, 2020

One thing to note, that should be DEBOUNCE, not DEBOUNCING_DELAY. I don't think that this would cause this, but is something that should be fixed anyways.

@yulei
Copy link
Contributor

yulei commented Mar 4, 2020

it's for the custom debouncing matrix code, I'll try to use the standard matrix to check if this could help.

@yulei
Copy link
Contributor

yulei commented Mar 5, 2020

finally got sometime to check this issue, I use segger rtt view to print debug message:
tap once

r/c 01234567
00: 000000000000000
10: 000000000000000
20: 100000000000000
30: 000000000000000
40: 000000000000000

---- action_exec: start -----
EVENT: 0200d(50277)Tapping: Start(Press tap key).
TAPPING_KEY=Record: row:2, col:0, pressed:d, time:50277, int:n, count:0

processed: 0200d(50277):0


r/c 01234567
00: 000000000000000
10: 000000000000000
20: 000000000000000
30: 000000000000000
40: 000000000000000

---- action_exec: start -----
EVENT: 0200u(50367)Tapping: First tap(0->1).
TAPPING_KEY=Record: row:2, col:0, pressed:d, time:50277, int:n, count:1

ACTION: ACT_LMODS_TAP[1:29] layer_state: 00000000(0) default_layer_state: 00000000(0)MODS_TAP: Tap: register_code

resiger_code:41
send keyboard report
in send_keyboard()
usbStartTransmitI
keyboard_report: 00 00 29 00 00 00 00 00
waiting_buffer_enq: { [3]=Record: row:2, col:0, pressed:u, time:50367, int:n, count:1
 }
---- action_exec: process waiting_buffer -----
Tapping: Tap release(1)
ACTION: ACT_LMODS_TAP[1:29] layer_state: 00000000(0) default_layer_state: 00000000(0)MODS_TAP: Tap: unregister_code

unresiger_code:41
send keyboard report
in send_keyboard()
usbStartTransmitI
keyboard_report: 00 00 00 00 00 00 00 00
TAPPING_KEY=Record: row:2, col:0, pressed:u, time:50367, int:n, count:1

processed: waiting_buffer[3] = 0200u(50367):1


Tapping: End(Timeout after releasing last tap): FFFFu(50569)
TAPPING_KEY=Record: row:0, col:0, pressed:u, time:0, int:n, count:0

seems everything works fine, this report was sent by usbStartTransmitI(), but the PC did not received.

tap twice

r/c 01234567
00: 000000000000000
10: 000000000000000
20: 100000000000000
30: 000000000000000
40: 000000000000000

---- action_exec: start -----
EVENT: 0200d(24885)Tapping: Start(Press tap key).
TAPPING_KEY=Record: row:2, col:0, pressed:d, time:24885, int:n, count:0

processed: 0200d(24885):0


r/c 01234567
00: 000000000000000
10: 000000000000000
20: 000000000000000
30: 000000000000000
40: 000000000000000

---- action_exec: start -----
EVENT: 0200u(24975)Tapping: First tap(0->1).
TAPPING_KEY=Record: row:2, col:0, pressed:d, time:24885, int:n, count:1

ACTION: ACT_LMODS_TAP[1:29] layer_state: 00000000(0) default_layer_state: 00000000(0)MODS_TAP: Tap: register_code

resiger_code:41
send keyboard report
in send_keyboard()
usbStartTransmitI
keyboard_report: 00 00 29 00 00 00 00 00
waiting_buffer_enq: { [4]=Record: row:2, col:0, pressed:u, time:24975, int:n, count:1
 }
---- action_exec: process waiting_buffer -----
Tapping: Tap release(1)
ACTION: ACT_LMODS_TAP[1:29] layer_state: 00000000(0) default_layer_state: 00000000(0)MODS_TAP: Tap: unregister_code

unresiger_code:41
send keyboard report
in send_keyboard()
usbStartTransmitI
keyboard_report: 00 00 00 00 00 00 00 00
TAPPING_KEY=Record: row:2, col:0, pressed:u, time:24975, int:n, count:1

processed: waiting_buffer[4] = 0200u(24975):1



r/c 01234567
00: 000000000000000
10: 000000000000000
20: 100000000000000
30: 000000000000000
40: 000000000000000

---- action_exec: start -----
EVENT: 0200d(25069)Tapping: Tap press(2)
ACTION: ACT_LMODS_TAP[1:29] layer_state: 00000000(0) default_layer_state: 00000000(0)MODS_TAP: Tap: register_code

resiger_code:41
send keyboard report
in send_keyboard()
usbStartTransmitI
keyboard_report: 00 00 29 00 00 00 00 00
TAPPING_KEY=Record: row:2, col:0, pressed:d, time:25069, int:n, count:2

processed: 0200d(25069):2


r/c 01234567
00: 000000000000000
10: 000000000000000
20: 000000000000000
30: 000000000000000
40: 000000000000000

---- action_exec: start -----
EVENT: 0200u(25159)Tapping: Tap release(2)
ACTION: ACT_LMODS_TAP[1:29] layer_state: 00000000(0) default_layer_state: 00000000(0)MODS_TAP: Tap: unregister_code

unresiger_code:41
send keyboard report
in send_keyboard()
usbStartTransmitI
keyboard_report: 00 00 00 00 00 00 00 00
TAPPING_KEY=Record: row:2, col:0, pressed:u, time:25159, int:n, count:2

processed: 0200u(25159):2

Tapping: End(Timeout after releasing last tap): FFFFu(25361)
TAPPING_KEY=Record: row:0, col:0, pressed:u, time:0, int:n, count:0

the pc only received one ESC. so it may caused by the low level usb driver.
seems the latest QMK master was upgraded to chibios 19, unfortunately noah can't work with it, the keyboard will be blocked forever for wait the RCC start to work.

@drashna is there any working keyboard which use the STM32F4?

@fobbyal
Copy link
Author

fobbyal commented Mar 6, 2020

@yulei thanks for looking into this. I just realized that there was something that might be important that i forgot to report. I am using the LT keycode for layer switching on the SPACE key. the exact config is LT(2,KC_SPC) and this key behaves as expected when tapped. I am not sure if somehow the caps-lock position is special or the implementation between LT and LCTL_T is drastically different.

@yulei
Copy link
Contributor

yulei commented Mar 6, 2020

@fobbyal, it should fixed at https://github.com/yulei/qmk_firmware/tree/noah_tap, could you have a try?
The bug disappeared after I upgraded the configuration files of noah keyboard to the chibios used in the master.

@drashna I finally found that why I could not use the standard matrix code. The A9 pin was default to sense VBUS in STM32 device who used OTGv1 driver. Even I always turned the VBUS sense off, the A9 pin still does not work correctly in the standard matrix code.

@fobbyal
Copy link
Author

fobbyal commented Mar 6, 2020

@yulei i'll give it a try and report back

@fobbyal
Copy link
Author

fobbyal commented Mar 6, 2020

@yulei i confirmed that it is fixed.. it fixed the leds for me too. It was kind of behaving strangely before. Thank you so much for your effort. I know that is a big upgrade going on. With that in mind when do you think this will land in master?

@yulei
Copy link
Contributor

yulei commented Mar 7, 2020

yes, I also fixed some leds issues after the boards were shipped. I'll make a PR asap. The A9 pad's issue was still not fixed, so I have to use custom matrix codes.

yulei added a commit to yulei/qmk_firmware that referenced this issue Mar 7, 2020
@yulei yulei mentioned this issue Mar 7, 2020
13 tasks
@yulei
Copy link
Contributor

yulei commented Mar 7, 2020

@fobbyal you can also merge #7803 to your own branch, which emulates EEPROM with flash, thus you can save your setting permanent. And this codes were verified by hundred people.

@fobbyal
Copy link
Author

fobbyal commented Mar 7, 2020 via email

@tzarc
Copy link
Member

tzarc commented Mar 7, 2020

The A9 pad's issue was still not fixed

I apologise if you've tried these before, as I haven't been following the context. Have you tried setting #define BOARD_OTG_NOVBUSSENS TRUE in config.h, and setting A9's alternate function to mode 0 in the board init routines?

@tzarc
Copy link
Member

tzarc commented Mar 7, 2020

Never mind; I see BOARD_OTG_NOVBUSSENS is defined. You've tried setting AF0?

@yulei
Copy link
Contributor

yulei commented Mar 7, 2020

yes, I have test reset this PIN to AF0 after initialized the usb driver(the VBUSNOSENSE register bit was set at the usbStart() call, It should be released after this register setting according to ST's datasheet), but it only works in OUTPUT mode, I'm not sure why it can't work in INPUT mode. Lately I'll use nucleo board with ST's HAL for a testing.

zvecr pushed a commit that referenced this issue Mar 7, 2020
c0psrul3 pushed a commit to c0psrul3/qmk_firmware that referenced this issue Mar 23, 2020
sowbug pushed a commit to sowbug/qmk_firmware that referenced this issue Apr 2, 2020
HokieGeek pushed a commit to HokieGeek/qmk_firmware that referenced this issue Apr 10, 2020
kylekuj pushed a commit to kylekuj/qmk_firmware that referenced this issue Apr 21, 2020
jakobaa pushed a commit to jakobaa/qmk_firmware that referenced this issue Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants