You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Solution:
This commit doesn't seem to be related regardless of its commit comment. 227f3aa
commit 227f3aab715bf7f04fc616558b80e7fa69d2b914 (origin/upstream_fix_bus_detection, upstream_fix_bus_detection)
Author: Jun Wako <wakojun@gmail.com>
Date: Sun Jul 14 10:34:05 2019 +0900
Disable connect detection during settling time
One device has glitch(30us width pulse) on pull-up'd D+ line after
pulg-in, it can deceive device attach detction of the chip and library.
This fix ignores the false detection for a while after device attach.
The deivce with the glitch is a keyboard of Topre REALFORCE RGB AEAX01.
diff --git a/Usb.cpp b/Usb.cpp
index 7843d49..8c3c54c 100644
--- a/Usb.cpp
+++ b/Usb.cpp
@@ -483,6 +483,9 @@ void USB::Task(void) //USB state machine
if((usb_task_state & USB_STATE_MASK) == USB_STATE_DETACHED) {
delay = (uint32_t)millis() + USB_SETTLE_DELAY;
usb_task_state = USB_ATTACHED_SUBSTATE_SETTLE;
+
+ // disable bus status change interrupt until settled
+ regWr(rHIEN, (regRd(rHIEN) & ~bmCONDETIE));
}
break;
}// switch( tmpdata
@@ -510,6 +513,9 @@ void USB::Task(void) //USB state machine
usb_task_state = USB_ATTACHED_SUBSTATE_RESET_DEVICE;
else break; // don't fall through
case USB_ATTACHED_SUBSTATE_RESET_DEVICE:
+ // re-enable bus status change interrupt
+ regWr(rHIEN, (regRd(rHIEN) | bmCONDETIE));
+
regWr(rHCTL, bmBUSRST); //issue bus reset
usb_task_state = USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE;
break;
Bottom line:
There is/was confusion at workaround and solution for some reason.
In fact tmk/tmk_keyboard@3eae475f8b98 fixed the problem. 2021-07-23
commit 3eae475f8b98152b466f8f3763a74f0ef2330d9d
Author: tmk <hasu@tmk-kbd.com>
Date: Thu May 11 00:16:21 2017 +0900
usb_usb: Remove startup wait
Some keyboards boot up quickly and cannot be enumerated
when powering up converter and keyboard at same time
diff --git a/converter/usb_usb/main.cpp b/converter/usb_usb/main.cpp
index 5b542a75..2d9f5602 100644
--- a/converter/usb_usb/main.cpp
+++ b/converter/usb_usb/main.cpp
@@ -75,11 +75,13 @@ int main(void)
*/
sei();
+/* Some keyboards bootup quickly and cannot be initialized with this startup wait.
// wait for startup of sendchar routine
while (USB_DeviceState != DEVICE_STATE_Configured) ;
if (debug_enable) {
_delay_ms(1000);
}
+*/
debug("init: done\n");
The text was updated successfully, but these errors were encountered:
tmk
changed the title
Bus state change detection
Realforce RGB (AEAX01) startup problem
Jul 23, 2021
Problem:
With old firmware Realforce RGB (AEAX01) fails when connecting the keyboard to USB-USB converter first, then plug it into USB port.
https://geekhack.org/index.php?topic=69169.msg2414679#msg2414679
Confirmed the problem with tmk/tmk_keyboard@5132607 (2016-10-18) at least.
NOT confirmed with tmk/tmk_keyboard@cf9f157 (2017-05-11)
Workaround:
https://geekhack.org/index.php?topic=69169.msg2449152#msg2449152
This doesn't work with tmk/tmk_keyboard@51326077b08.
And tmk/tmk_keyboard@cf9f157a7f6a70 doens't need the workaround at all.
Solution:
This commit doesn't seem to be related regardless of its commit comment.
227f3aa
https://geekhack.org/index.php?topic=69169.msg2635350#msg2635350
Bottom line:
There is/was confusion at workaround and solution for some reason.
In fact tmk/tmk_keyboard@3eae475f8b98 fixed the problem. 2021-07-23
The text was updated successfully, but these errors were encountered: