From 8a8697c38273bee0694d7d75b66360256d163780 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Tue, 28 Apr 2015 14:09:53 +0200 Subject: [PATCH 1/2] Future-proof the frontlight handling on Kindle. Guard against trying to get any kind of frontlight info on devices without one. So far the flIntensity prop has always been there, even on devices without one, but better not assume that'll always be the case ;). That, and be consistent with the other lipc_handle tests. --- frontend/device/kindle/powerd.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/device/kindle/powerd.lua b/frontend/device/kindle/powerd.lua index 29dc80f44..8b07db2b2 100644 --- a/frontend/device/kindle/powerd.lua +++ b/frontend/device/kindle/powerd.lua @@ -15,10 +15,12 @@ function KindlePowerD:init() if lipc then self.lipc_handle = lipc.init("com.github.koreader.kindlepowerd") end - if self.lipc_handle then - self.flIntensity = self.lipc_handle:get_int_property("com.lab126.powerd", "flIntensity") - else - self.flIntensity = self:read_int_file(self.fl_intensity_file) + if self.device.hasFrontlight() then + if self.lipc_handle ~= nil then + self.flIntensity = self.lipc_handle:get_int_property("com.lab126.powerd", "flIntensity") + else + self.flIntensity = self:read_int_file(self.fl_intensity_file) + end end end From 8703a043c755bad760cbfb98724c52bea7725bb9 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Tue, 28 Apr 2015 18:23:30 +0200 Subject: [PATCH 2/2] Fix the eips prints on a KT2 --- platform/kindle/libkohelper.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/kindle/libkohelper.sh b/platform/kindle/libkohelper.sh index da051b28e..8604d3fa8 100644 --- a/platform/kindle/libkohelper.sh +++ b/platform/kindle/libkohelper.sh @@ -29,6 +29,13 @@ case "${kmodel}" in EIPS_X_RES=16 EIPS_Y_RES=24 # Manually mesured, should be accurate. ;; + "C6" | "DD" ) + # KT2... + SCREEN_X_RES=608 # NOTE: Might actually be 600... + SCREEN_Y_RES=800 + EIPS_X_RES=16 + EIPS_Y_RES=24 + ;; * ) # Handle legacy devices... if [ -f "/etc/rc.d/functions" ] && grep "EIPS" "/etc/rc.d/functions" > /dev/null 2>&1 ; then