mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
Minimal KOA2 support (#4016)
* Minimal KOA2 support (Touch, Screen, Battery). Hopefully :).
This commit is contained in:
2
base
2
base
Submodule base updated: d1d11d157e...8a6d329e46
@@ -246,12 +246,9 @@ local KindleOasis2 = Kindle:new{
|
||||
model = "KindleOasis2",
|
||||
isTouchDevice = yes,
|
||||
hasFrontlight = yes,
|
||||
--hasKeys = yes,
|
||||
display_dpi = 300,
|
||||
touch_dev = "/dev/input/by-path/platform-30a30000.i2c-event",
|
||||
|
||||
-- NOTE: Incomplete, but at least they're confirmed.
|
||||
--batt_capacity_file = "/sys/class/power_supply/max77796-battery/capacity",
|
||||
--is_charging_file = "/sys/class/power_supply/max77796-charger/charging",
|
||||
}
|
||||
|
||||
local KindleBasic2 = Kindle:new{
|
||||
@@ -532,6 +529,36 @@ function KindleOasis:init()
|
||||
self.input.open("fake_events")
|
||||
end
|
||||
|
||||
-- FIXME: Should be enough for the bare minimum to work, TBC.
|
||||
-- FIXME: Pageturn keys. And whatever else might be missing.
|
||||
function KindleOasis2:init()
|
||||
self.screen = require("ffi/framebuffer_mxcfb"):new{device = self, debug = logger.dbg}
|
||||
self.powerd = require("device/kindle/powerd"):new{
|
||||
device = self,
|
||||
fl_intensity_file = "/sys/class/backlight/max77696-bl/brightness",
|
||||
batt_capacity_file = "/sys/class/power_supply/max77796-battery/capacity",
|
||||
is_charging_file = "/sys/class/power_supply/max77796-charger/charging",
|
||||
}
|
||||
|
||||
--[[
|
||||
self.input = require("device/input"):new{
|
||||
device = self,
|
||||
|
||||
event_map = {
|
||||
[104] = "RPgFwd",
|
||||
[109] = "RPgBack",
|
||||
}
|
||||
}
|
||||
--]]
|
||||
|
||||
Kindle.init(self)
|
||||
|
||||
self.input.open(self.touch_dev)
|
||||
--self.input.open("/dev/input/by-path/platform-gpiokey.0-event")
|
||||
|
||||
self.input.open("fake_events")
|
||||
end
|
||||
|
||||
function KindleBasic2:init()
|
||||
self.screen = require("ffi/framebuffer_mxcfb"):new{device = self, debug = logger.dbg}
|
||||
self.powerd = require("device/kindle/powerd"):new{
|
||||
@@ -565,6 +592,7 @@ KindleBasic.exit = KindleTouch.exit
|
||||
KindleVoyage.exit = KindleTouch.exit
|
||||
KindlePaperWhite3.exit = KindleTouch.exit
|
||||
KindleOasis.exit = KindleTouch.exit
|
||||
KindleOasis2.exit = KindleTouch.exit
|
||||
KindleBasic2.exit = KindleTouch.exit
|
||||
|
||||
function Kindle3:exit()
|
||||
|
||||
@@ -123,6 +123,7 @@ local KoboSnow = Kobo:new{
|
||||
}
|
||||
|
||||
-- Kobo Aura H2O2, Rev2:
|
||||
-- FIXME: Shares FL/NaturalLight issues with the Clara (#4015)
|
||||
local KoboSnowRev2 = Kobo:new{
|
||||
model = "Kobo_snow",
|
||||
hasFrontlight = yes,
|
||||
@@ -179,8 +180,7 @@ local KoboPika = Kobo:new{
|
||||
|
||||
-- Kobo Clara HD:
|
||||
-- FIXME: NaturalLight doesn't exactly work right.
|
||||
-- FIXME: Suspend seems broken :( (KOReader crash).
|
||||
-- FIXME: Also, rebooting (?!!) is FUBAR, too (KOReader crash, too).
|
||||
-- FIXME: Also, rebooting (?!!) might be FUBAR, too (KOReader crash, too).
|
||||
local KoboNova = Kobo:new{
|
||||
model = "Kobo_nova",
|
||||
hasFrontlight = yes,
|
||||
|
||||
@@ -126,7 +126,7 @@ export TESSDATA_PREFIX="data"
|
||||
# export dict directory
|
||||
export STARDICT_DATA_DIR="data/dict"
|
||||
|
||||
# export external font directories (In order: stock, legacy custom, stock extra, font hack)
|
||||
# export external font directories (In order: stock, stock custom (both legacy & 5.9.6+), stock extra, font hack)
|
||||
export EXT_FONT_DIR="/usr/java/lib/fonts;/mnt/us/fonts;/var/local/font/mnt;/mnt/us/linkfonts/fonts"
|
||||
|
||||
# Only setup IPTables on evices where it makes sense to (FW 5.x & K4)
|
||||
|
||||
@@ -25,6 +25,7 @@ describe("BatteryState plugin tests #nocov", function()
|
||||
local widget = stat()
|
||||
assert.is_false(widget.was_charging)
|
||||
assert.is_false(widget.was_suspending)
|
||||
widget:resetAll()
|
||||
MockTime:increase(1)
|
||||
widget:accumulate()
|
||||
assert.are.equal(1, widget.awake.time)
|
||||
@@ -70,6 +71,7 @@ describe("BatteryState plugin tests #nocov", function()
|
||||
local widget = stat()
|
||||
assert.is_false(widget.was_charging)
|
||||
assert.is_false(widget.was_suspending)
|
||||
widget:resetAll()
|
||||
MockTime:increase(1)
|
||||
widget:accumulate()
|
||||
assert.are.equal(1, widget.awake.time)
|
||||
@@ -112,6 +114,7 @@ describe("BatteryState plugin tests #nocov", function()
|
||||
local widget = stat()
|
||||
assert.is_false(widget.was_charging)
|
||||
assert.is_false(widget.was_suspending)
|
||||
widget:resetAll()
|
||||
MockTime:increase(1)
|
||||
widget:accumulate()
|
||||
assert.are.equal(1, widget.awake.time)
|
||||
@@ -145,6 +148,7 @@ describe("BatteryState plugin tests #nocov", function()
|
||||
local widget = stat()
|
||||
assert.is_false(widget.was_charging)
|
||||
assert.is_false(widget.was_suspending)
|
||||
widget:resetAll()
|
||||
MockTime:increase(1)
|
||||
widget:accumulate()
|
||||
assert.are.equal(1, widget.awake.time)
|
||||
|
||||
Reference in New Issue
Block a user