From 43635760660da0497eba7287ff901faf4f09d7d8 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Wed, 11 Sep 2019 19:40:36 +0200 Subject: [PATCH] Support the Kobo Libra (Hopefully?). --- frontend/device/kobo/device.lua | 24 ++++++++++++++++++++++++ platform/kobo/koreader.sh | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/frontend/device/kobo/device.lua b/frontend/device/kobo/device.lua index 664f9d009..fea0a3593 100644 --- a/frontend/device/kobo/device.lua +++ b/frontend/device/kobo/device.lua @@ -234,6 +234,28 @@ local KoboFrost = Kobo:new{ }, } +-- Kobo Libra: +-- NOTE: Assume the same quirks as the Forma apply. +local KoboStorm = Kobo:new{ + model = "Kobo_storm", + hasFrontlight = yes, + hasKeys = yes, + canToggleGSensor = yes, + touch_snow_protocol = true, + misc_ntx_gsensor_protocol = true, + display_dpi = 300, + hasNaturalLight = yes, + frontlight_settings = { + frontlight_white = "/sys/class/backlight/mxc_msp430.0/brightness", + frontlight_mixer = "/sys/class/backlight/tlc5947_bl/color", + -- Warmth goes from 0 to 10 on the device's side (our own internal scale is still normalized to [0...100]) + -- NOTE: Those three extra keys are *MANDATORY* if frontlight_mixer is set! + nl_min = 0, + nl_max = 10, + nl_inverted = true, + }, +} + -- This function will update itself after the first touch event local probeEvEpochTime probeEvEpochTime = function(self, ev) @@ -793,6 +815,8 @@ elseif codename == "nova" then return KoboNova elseif codename == "frost" then return KoboFrost +elseif codename == "storm" then + return KoboStorm else error("unrecognized Kobo model "..codename) end diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 46fea04e5..1b0fdc6ec 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -166,9 +166,9 @@ ko_do_fbdepth() { if grep -q '\["dev_startup_no_fbdepth"\] = true' 'settings.reader.lua' 2>/dev/null; then # Swap back to the original bitdepth (in case this was a restart) if [ -n "${ORIG_FB_BPP}" ]; then - # Unless we're a Forma, don't even bother to swap rotation if the fb is @ 16bpp, because RGB565 is terrible anyways, + # Unless we're a Forma/Libra, don't even bother to swap rotation if the fb is @ 16bpp, because RGB565 is terrible anyways, # so there's no faster codepath to achieve, and running in Portrait @ 16bpp might actually be broken on some setups... - if [ "${ORIG_FB_BPP}" -eq "16" ] && [ "${PRODUCT}" != "frost" ]; then + if [ "${ORIG_FB_BPP}" -eq "16" ] && [ "${PRODUCT}" != "frost" ] && [ "${PRODUCT}" != "storm" ]; then echo "Making sure we're using the original fb bitdepth @ ${ORIG_FB_BPP}bpp & rotation @ ${ORIG_FB_ROTA}" >>crash.log 2>&1 ./fbdepth -d "${ORIG_FB_BPP}" -r "${ORIG_FB_ROTA}" >>crash.log 2>&1 else