Allow other image file names through cli args, increase ram size, update readme

This commit is contained in:
2025-12-21 17:49:02 +01:00
parent 25dd685345
commit c10e1ec09b
2 changed files with 19 additions and 6 deletions

View File

@@ -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<usize> {
}
fn main() -> Result<(), Box<dyn Error>> {
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<String> = env::args().collect();
if args.len() != 2 {
eprintln!("USAGE: trve <ram_image>")
}
read_file_to_buffer(&args[1], buf)?;
let uart = BasicUart::new();
let uart = uart.spawn_poller(Duration::from_millis(10));