Get rid of duplicate logging & functionality

Deduping & logging is handled by Input itself
reviewable/pr11807/r4
NiLuJe 3 weeks ago
parent f99f862832
commit 20de874246

@ -207,9 +207,6 @@ function Kindle:supportsScreensaver()
end
function Kindle:openInputDevices()
-- Keep track of what we opened to avoid duplicates since we may do two passes...
local opened = {}
-- Auto-detect input devices (via FBInk's fbink_input_scan)
local FBInkInput = ffi.load("fbink_input")
local dev_count = ffi.new("size_t[1]")
@ -220,10 +217,7 @@ function Kindle:openInputDevices()
for i = 0, tonumber(dev_count[0]) - 1 do
local dev = devices[i]
if dev.matched then
local path = ffi.string(dev.path)
logger.dbg("Opening input device", ffi.string(dev.name), "@", path)
self.input.open(path)
opened[path] = true
self.input.open(ffi.string(dev.path), ffi.string(dev.name))
end
end
C.free(devices)
@ -250,12 +244,7 @@ function Kindle:openInputDevices()
for i = 0, tonumber(dev_count[0]) - 1 do
local dev = devices[i]
if dev.matched then
local path = ffi.string(dev.path)
if not opened[path] then
logger.dbg("Opening (gyro event) input device", ffi.string(dev.name), "@", path)
self.input.open(path)
opened[path] = true
end
self.input.open(ffi.string(dev.path), ffi.string(dev.name))
end
end
C.free(devices)

@ -872,11 +872,9 @@ function Kobo:init()
-- We need to single out whichever device provides pagination buttons or sleep cover events, as we'll want to tweak key repeat there...
-- The first one will do, as it's extremely likely to be event0, and that's pretty fairly set in stone on NTX boards.
if (bit.band(dev.type, C.INPUT_PAGINATION_BUTTONS) ~= 0 or bit.band(dev.type, C.INPUT_SLEEP_COVER) ~= 0) and not self.ntx_fd then
logger.dbg("Opening (ntx_fd) input device", ffi.string(dev.name), "@", path)
self.ntx_fd = self.input.open(path)
self.ntx_fd = self.input.open(path, ffi.string(dev.name))
else
logger.dbg("Opening input device", ffi.string(dev.name), "@", path)
self.input.open(path)
self.input.open(path, ffi.string(dev.name))
end
end
end

Loading…
Cancel
Save