2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00
koreader/frontend/device/kobo
NiLuJe 4264d915b1
Kobo: Refactor suspend in order to be able to catch input events sent during the 2s window of ntx madness (#12330)
I don't even remember how badly things broke (at least on old devices) without it, despite it making absolutely no sense at all (state-extended just flips a global that dictates whether some things get flagged as wakeup sources or not).

So, don't rock the boat too much: we don't remove it, but instead of using a sleep, we use a task deadline instead, which ensures we'll keep processing input events in the right order in the meantime. We'll already have neutered input by this point, so we'll only process power events anyway.

That means that the only iffy things are potentially *when* and *where* we have to potentially cancel that task. Resume makes sense, of course, and we log an info message to make the log flow clear; but we also do so in suspend... just in case. With a warning log because that probably indicates something fishy went on.

Also cleanup the comments while I'm there, and actually rewrite the wakeup_count stuff properly so it could actually theoretically be used if ntx kernels were actually reliable. Spoiler alert: they're not, this is still horribly broken on at least Mk < 7. Works just fine on a Forma, though, so, yay.

Fix #12325
2024-08-12 03:47:43 +02:00
..
device.lua Kobo: Refactor suspend in order to be able to catch input events sent during the 2s window of ntx madness (#12330) 2024-08-12 03:47:43 +02:00
nickel_conf.lua Make luacheck >= 0.26 happy (#9174) 2022-06-11 19:06:06 +02:00
ntx_io.lua Fix Wi-Fi toggle on the Elipsa 2021-08-09 02:33:07 +02:00
powerd.lua Kobo: Refactor suspend in order to be able to catch input events sent during the 2s window of ntx madness (#12330) 2024-08-12 03:47:43 +02:00