Allow other image file names through cli args, increase ram size, update readme
This commit is contained in:
12
src/main.rs
12
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<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));
|
||||
|
||||
Reference in New Issue
Block a user