From c1261059704be88b56104f7624148cd3a3073c50 Mon Sep 17 00:00:00 2001 From: Morgan Creekmore Date: Mon, 29 Apr 2024 18:57:52 -0500 Subject: [PATCH] Add support for Clara BW --- README.md | 1 + contrib/plato.sh | 3 ++- crates/core/src/device.rs | 12 +++++++++++- crates/core/src/frontlight/premixed.rs | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6174382..5e7005c 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Any 4.*X*.*Y* firmware, with *X* ≥ 6, will do. ## Supported devices +- *Clara BW* - *Elipsa 2E*. - *Clara 2E*. - *Libra 2*. diff --git a/contrib/plato.sh b/contrib/plato.sh index b500aa7..aa74b85 100755 --- a/contrib/plato.sh +++ b/contrib/plato.sh @@ -69,6 +69,7 @@ if [ -e "$KOBO_TAG" ] ; then 388) PRODUCT_ID=0x4234 ;; # Libra 2 386) PRODUCT_ID=0x4235 ;; # Clara 2E 389) PRODUCT_ID=0x4236 ;; # Elipsa 2E + 391) PRODUCT_ID=0x4237 ;; # Clara BW *) PRODUCT_ID=0x6666 ;; esac @@ -83,7 +84,7 @@ export LD_LIBRARY_PATH="libs:${LD_LIBRARY_PATH}" if [ "$PLATO_SET_FRAMEBUFFER_DEPTH" ] ; then case "${PRODUCT}:${MODEL_NUMBER}" in - condor:*|goldfinch:*|io:*|cadmus:*|europa:*|storm:*|frost:*|nova:*|snow:378|star:379) + spaBW:*|condor:*|goldfinch:*|io:*|cadmus:*|europa:*|storm:*|frost:*|nova:*|snow:378|star:379) unset ORIG_BPP ;; *) diff --git a/crates/core/src/device.rs b/crates/core/src/device.rs index d695ffe..141dd03 100644 --- a/crates/core/src/device.rs +++ b/crates/core/src/device.rs @@ -5,6 +5,7 @@ use crate::input::TouchProto; #[derive(Debug, Copy, Clone, Eq, PartialEq)] pub enum Model { + ClaraBW, Elipsa2E, Clara2E, Libra2, @@ -41,6 +42,7 @@ pub enum Orientation { impl fmt::Display for Model { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { + Model::ClaraBW => write!(f, "Clara BW"), Model::Elipsa2E => write!(f, "Elipsa 2E"), Model::Clara2E => write!(f, "Clara 2E"), Model::Libra2 => write!(f, "Libra 2"), @@ -202,6 +204,12 @@ impl Device { dims: (1404, 1872), dpi: 227, }, + "spaBW" => Device { + model: Model::ClaraBW, + proto: TouchProto::MultiB, + dims: (1072, 1448), + dpi: 300, + }, _ => Device { model: if model_number == "320" { Model::TouchC } else { Model::TouchAB }, proto: TouchProto::Single, @@ -224,7 +232,8 @@ impl Device { Model::Sage | Model::Libra2 | Model::Clara2E | - Model::Elipsa2E => FrontlightKind::Premixed, + Model::Elipsa2E | + Model::ClaraBW => FrontlightKind::Premixed, _ => FrontlightKind::Standard, } } @@ -277,6 +286,7 @@ impl Device { pub fn mark(&self) -> u8 { match self.model { + Model::ClaraBW => 12, Model::Elipsa2E => 11, Model::Clara2E => 10, Model::Libra2 => 9, diff --git a/crates/core/src/frontlight/premixed.rs b/crates/core/src/frontlight/premixed.rs index e69e6c0..7a8fde4 100644 --- a/crates/core/src/frontlight/premixed.rs +++ b/crates/core/src/frontlight/premixed.rs @@ -10,7 +10,7 @@ const FRONTLIGHT_WHITE: &str = "/sys/class/backlight/mxc_msp430.0/brightness"; // Forma const FRONTLIGHT_ORANGE_A: &str = "/sys/class/backlight/tlc5947_bl/color"; -// Libra H₂O, Clara HD, Libra 2 +// Libra H₂O, Clara HD, Libra 2, Clara BW const FRONTLIGHT_ORANGE_B: &str = "/sys/class/backlight/lm3630a_led/color"; // Sage, Libra 2, Clara 2E, Elipsa 2E const FRONTLIGHT_ORANGE_C: &str = "/sys/class/leds/aw99703-bl_FL1/color"; -- 2.51.2