Begin implementing virtual devices for testing and stuff

This commit is contained in:
Luke D. Jones
2023-05-02 10:40:42 +12:00
parent a14a37d0da
commit 2a38f69cc4
4 changed files with 148 additions and 5 deletions

View File

@@ -15,7 +15,6 @@ use rog_anime::usb::{get_anime_type, pkt_for_flush, pkts_for_init};
use rog_anime::{ActionData, AnimeDataBuffer, AnimePacketType, AnimeType};
use rog_platform::hid_raw::HidRaw;
use rog_platform::supported::AnimeSupportedFunctions;
use rog_platform::usb_raw::USBRaw;
use self::config::{AnimeConfig, AnimeConfigCached};
use crate::error::RogError;
@@ -30,7 +29,7 @@ impl GetSupported for CtrlAnime {
}
pub struct CtrlAnime {
node: USBRaw,
node: HidRaw,
anime_type: AnimeType,
cache: AnimeConfigCached,
config: AnimeConfig,
@@ -43,8 +42,8 @@ pub struct CtrlAnime {
impl CtrlAnime {
#[inline]
pub fn new(config: AnimeConfig) -> Result<CtrlAnime, Box<dyn Error>> {
let node = USBRaw::new(0x193b)?;
let anime_type = get_anime_type()?;
let node = HidRaw::new("193b")?;
let anime_type = get_anime_type().unwrap_or(AnimeType::GA401);
info!("Device has an AniMe Matrix display");
let mut cache = AnimeConfigCached::default();