commit f11bef8348cab155964838f1cf3c000e0721c7c5 from: Benjamins Stürz date: Fri Feb 07 21:14:35 2025 UTC remove debug changes commit - 7aa98c0c683b5561c6d11caf20b24c3d1926d836 commit + f11bef8348cab155964838f1cf3c000e0721c7c5 blob - 30df70e6c521ba0775bc976ccecc6cad4a099904 blob + 5abc2859e9c1c12d7f15fb2a2731ad63abdaf6e0 --- src/main.rs +++ src/main.rs @@ -125,7 +125,6 @@ impl Drop for Peripage { fn main() { println!("libusb version: {:?}", rusb::version()); println!("Kernel supports detaching driver: {}", rusb::supports_detach_kernel_driver()); - let ctx = rusb::Context::new().expect("cannot connect to libusb"); @@ -148,11 +147,11 @@ fn main() { let mut packet = Vec::new(); packet.extend_from_slice(header); - const HEIGHT: u16 = 512; + const HEIGHT: u16 = 24; const BPC: usize = 48 * HEIGHT as usize; img .chunks(BPC) - .chain(std::iter::repeat_n(&[0u8; BPC] as &[u8], 0)) + .chain(std::iter::repeat_n(&[0u8; BPC] as &[u8], 3)) .for_each(|chunk| { packet.extend_from_slice(&[ 0x1d, 0x76, 0x30, 0x00, 0x30, 0x00, @@ -168,7 +167,4 @@ fn main() { // send image pp.write(&packet, 30).unwrap(); pp.confirm().unwrap(); - - pp.write(&packet, 30).unwrap(); - pp.confirm().unwrap(); }