mousefood works!

This commit is contained in:
2025-06-26 14:46:05 -06:00
parent 2de2c865c2
commit 2bb196a968
2 changed files with 8 additions and 17 deletions

6
Cargo.lock generated
View File

@@ -1070,9 +1070,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "2.9.0" version = "2.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661"
dependencies = [ dependencies = [
"equivalent", "equivalent",
"hashbrown", "hashbrown",
@@ -1310,7 +1310,7 @@ checksum = "c3c8dda44ff03a2f238717214da50f65d5a53b45cd213a7370424ffdb6fae815"
[[package]] [[package]]
name = "mousefood" name = "mousefood"
version = "0.2.1" version = "0.2.1"
source = "git+https://github.com/j-g00da/mousefood#e2b4985c986a2b9c3786aa73f388a24a87e0198d" source = "git+https://github.com/j-g00da/mousefood#8d78348cebad78ee9929fd09b656bf7382fcd4b5"
dependencies = [ dependencies = [
"embedded-graphics", "embedded-graphics",
"embedded-graphics-unicodefonts", "embedded-graphics-unicodefonts",

View File

@@ -32,18 +32,9 @@ pub async fn display_task(
320, 320,
320, 320,
); );
display.set_offset(0, 0);
display.init(&mut Delay).unwrap(); display.init(&mut Delay).unwrap();
display.set_orientation(&Orientation::Portrait).unwrap();
display.set_address_window(0, 0, 319, 319).unwrap(); display.set_address_window(0, 0, 319, 319).unwrap();
display.set_custom_orientation(0x40).unwrap(); // inverts X axis (reverts the natural mirroring)
// Rectangle::new(Point::new(0, 0), Size::new(1, 1))
// .draw_styled(&PrimitiveStyle::with_fill(Rgb565::GREEN), &mut display)
// .unwrap();
// Rectangle::new(Point::new(319, 319), Size::new(1, 1))
// .draw_styled(&PrimitiveStyle::with_fill(Rgb565::GREEN), &mut display)
// .unwrap();
let mut virtual_display = VirtualDisplay::new(display, 320, 320); let mut virtual_display = VirtualDisplay::new(display, 320, 320);
@@ -53,13 +44,13 @@ pub async fn display_task(
loop { loop {
terminal.draw(draw).unwrap(); terminal.draw(draw).unwrap();
} }
// loop { loop {
// Timer::after_millis(100).await Timer::after_millis(100).await
// } }
} }
fn draw(frame: &mut Frame) { fn draw(frame: &mut Frame) {
let greeting = Paragraph::new("Hello World!"); let greeting = Paragraph::new("Hello World!\nLine2");
frame.render_widget(greeting, frame.area()); frame.render_widget(greeting, frame.area());
} }