Find accelerometer based on hardware

reviewable/pr11642/r1
mergen3107 1 month ago committed by GitHub
parent aaa56a814f
commit 1b893d43c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1429,7 +1429,15 @@ function KindleScribe:init()
end
end
-- Get accelerometer device
self.input.open("/dev/input/by-path/platform-11007000.i2c-event-joystick")
local std_out = io.popen("grep -A4 'accel' /proc/bus/input/devices | grep -o 'event[0-9]'", "r")
if std_out then
local gyro_dev = std_out:read("*line")
std_out:close()
logger.dbg("gyro_dev", gyro_dev)
if gyro_dev then
self.input.open("/dev/input/"..gyro_dev)
end
end
self.input.open(self.touch_dev)
self.input.open("fake_events")

Loading…
Cancel
Save