Finalise anime matrix stuff. Many fixes

This commit is contained in:
Luke
2020-06-02 20:14:32 +12:00
parent e3eccef193
commit 8e98aafddd
12 changed files with 46 additions and 30 deletions

View File

@@ -23,16 +23,16 @@ pub enum AnimatrixCommand {
//ReloadLast,
}
pub struct AnimatrixWriter {
pub struct AniMeWriter {
handle: DeviceHandle<rusb::GlobalContext>,
initialised: bool,
}
impl AnimatrixWriter {
impl AniMeWriter {
#[inline]
pub fn new() -> Result<AnimatrixWriter, Box<dyn Error>> {
pub fn new() -> Result<AniMeWriter, Box<dyn Error>> {
// We don't expect this ID to ever change
let mut dev_handle = AnimatrixWriter::get_device(0x0b05, 0x193b).map_err(|err| {
let mut dev_handle = AniMeWriter::get_device(0x0b05, 0x193b).map_err(|err| {
error!("Could not get device handle: {:?}", err);
err
})?;
@@ -53,7 +53,7 @@ impl AnimatrixWriter {
err
})?;
Ok(AnimatrixWriter {
Ok(AniMeWriter {
handle: dev_handle,
initialised: false,
})

View File

@@ -1,5 +1,5 @@
use crate::{
animatrix_control::{AnimatrixCommand, AnimatrixWriter},
animatrix_control::{AniMeWriter, AnimatrixCommand},
config::Config,
laptops::match_laptop,
led_control::{AuraCommand, LedWriter},
@@ -69,8 +69,8 @@ pub async fn start_daemon() -> Result<(), Box<dyn Error>> {
// Possible Animatrix
let mut animatrix_writer = None;
if laptop.support_animatrix() {
animatrix_writer = Some(AnimatrixWriter::new()?);
info!("Device has an AniMatrix display");
animatrix_writer = Some(AniMeWriter::new()?);
info!("Device has an AniMe Matrix display");
}
// Set up the mutexes

View File

@@ -8,7 +8,7 @@ use rog_aura::{
AuraDbusWriter, LED_MSG_LEN,
};
static VERSION: &str = "0.9.9";
static VERSION: &str = "0.10.0";
#[derive(Debug, Options)]
struct CLIStart {