Closed tmk closed 5 years ago
After test with HHKB controller with ATmega32u4 it doesn't seem to have problem.
PS/2 converter with ps2_interrupt.c(PS2_USE_INT) had problem on handling signal when suspended. In suspend state microcontroller falls into power down mode for 15ms until it checks keyboard for wakeup condition(keypress by user). During the 15ms sleep it can miss signals or get wrong scan codes from keyboard and internal states of converter are corrupted.
WORKAROUND: Instead of power down, PS/2 converter uses standby mode now with SUSPEND_MODE_STANDBY
. In standby mode it can wake by pin change interrupt(INT1) and no longer miss signal from keyboard.
With ps2_busywait.c converter inhibits to send signal until it is ready to handle, so the problem above won't occur. ADB and M0110 also won't suffer from this probably because they send codes only when requested.(not confrimed)
With ps2_usart.c converter will have the problem. To solve it the converter will have to inhibit keyboard to send during microcontroller sleeps.
ANOTHER WORKAROUND: If power saving is not important you can keep microcontroller running even when suspended so that converter shouldn't miss signals. Keyboard connected to converter won't sleep basically and vintage keyboards keep drawing much current all the time. No power saving of microcontroller is actually useless there.
Problem during suspended with converters were solved.
With this commits PS/2 converter should work. it uses SUSPEND_MODE_STANDBY
instead of power down mode.
https://github.com/tmk/tmk_keyboard/commit/9818d54d26e2900bf91b288bc6f268adc8e0b8fd
https://github.com/tmk/tmk_keyboard/commit/1a7d1f9f4d6fdebb6e1d088ffcb37745ddf119d2
Also Alps64 with ATmega32u2 works now. https://geekhack.org/index.php?topic=69740.msg2277498#msg2277498
Now there is no perceived problem on suspend and resume, but keep this open for future problem report.
Issues with suspend/wakeup occur with terminal_usb. Issues occur with my Unicomp 3270 terminal keyboard.
Probably you should make new issue and describe your problem.
This issue is mainly related to key responsiveness when you wake your computer with key press.
It sometime works but sometime not. Iffy.