From c10e1ec09bca38d634b632d4afc75d80b893c41f Mon Sep 17 00:00:00 2001 From: taitep Date: Sun, 21 Dec 2025 17:49:02 +0100 Subject: Allow other image file names through cli args, increase ram size, update readme --- src/main.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index cdaa6eb..67186bb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,6 +5,7 @@ // See LICENSE file in the project root for full license text. use std::{ + env, error::Error, fs::File, io::{self, Read}, @@ -41,9 +42,16 @@ fn read_file_to_buffer(path: &str, buffer: &mut [u8]) -> io::Result { } fn main() -> Result<(), Box> { - let mut ram = Ram::try_new(1024 * 1024 / 4096)?; + let mut ram = Ram::try_new(16 * 1024 * 1024 / 4096)?; let buf = ram.buf_mut(); - read_file_to_buffer("./img", buf)?; + + let args: Vec = env::args().collect(); + + if args.len() != 2 { + eprintln!("USAGE: trve ") + } + + read_file_to_buffer(&args[1], buf)?; let uart = BasicUart::new(); let uart = uart.spawn_poller(Duration::from_millis(10)); -- cgit v1.2.3