Skip to content

Commit

Permalink
Kindle Basic 3 support (#5057)
Browse files Browse the repository at this point in the history
* Detect a few new PW4 variants

* Detect the new Kindle Basic 3

* Bump base for KT4 mxcfb support
  • Loading branch information
NiLuJe authored and Frenzie committed Jun 4, 2019
1 parent efe34b6 commit 3798e1b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base
29 changes: 28 additions & 1 deletion frontend/device/kindle/device.lua
Expand Up @@ -341,6 +341,13 @@ local KindlePaperWhite4 = Kindle:new{
touch_dev = "/dev/input/event2",
}
local KindleBasic3 = Kindle:new{
model = "KindleBasic3",
isTouchDevice = yes,
hasFrontlight = yes,
touch_dev = "/dev/input/event2",
}
function Kindle2:init()
-- Blacklist the C BB before the first BB require...
self:blacklistCBB()
Expand Down Expand Up @@ -728,6 +735,21 @@ function KindlePaperWhite4:init()
self.input.open("fake_events")
end
function KindleBasic3: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/bl/brightness",
batt_capacity_file = "/sys/class/power_supply/bd71827_bat/capacity",
is_charging_file = "/sys/class/power_supply/bd71827_bat/charging",
}
Kindle.init(self)
self.input.open(self.touch_dev)
self.input.open("fake_events")
end
function KindleTouch:exit()
Generic.exit(self)
if self.isSpecialOffers then
Expand All @@ -754,6 +776,7 @@ KindleOasis.exit = KindleTouch.exit
KindleOasis2.exit = KindleTouch.exit
KindleBasic2.exit = KindleTouch.exit
KindlePaperWhite4.exit = KindleTouch.exit
KindleBasic3.exit = KindleTouch.exit
function Kindle3:exit()
-- send double menu key press events to trigger screen refresh
Expand Down Expand Up @@ -802,7 +825,9 @@ local koa2_set = Set { "0LM", "0LN", "0LP", "0LQ", "0P1", "0P2", "0P6",
"0P7", "0P8", "0S1", "0S2", "0S3", "0S4", "0S7", "0SA" }
local kt3_set = Set { "0DU", "0K9", "0KA" }
local pw4_set = Set { "0PP", "0T1", "0T2", "0T3", "0T4", "0T5", "0T6",
"0T7", "0TJ", "0TK", "0TL", "0TM", "0TN", "102", "103"}
"0T7", "0TJ", "0TK", "0TL", "0TM", "0TN", "102", "103",
"16Q", "16R", "16S", "16T", "16U", "16V" }
local kt4_set = Set { "10L", "0WF", "0WG", "0WH", "0WJ", "0VB" }
if k2_set[kindle_devcode] then
return Kindle2
Expand Down Expand Up @@ -834,6 +859,8 @@ elseif kt3_set[kindle_devcode_v2] then
return KindleBasic2
elseif pw4_set[kindle_devcode_v2] then
return KindlePaperWhite4
elseif kt4_set[kindle_devcode_v2] then
return KindleBasic3
end
error("unknown Kindle model "..kindle_devcode.." ("..kindle_devcode_v2..")")

0 comments on commit 3798e1b

Please sign in to comment.