Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Fix esp32s3_usb_otg and anyhow calls (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihai Dinculescu authored May 15, 2022
1 parent 45f041d commit fba0aa3
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -797,10 +797,10 @@ fn ttgo_hello_world(

display
.init(&mut delay::Ets)
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;
display
.set_orientation(st7789::Orientation::Portrait)
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;

// The TTGO board's screen does not start at offset 0x0, and the physical size is 135x240, instead of 240x320
let top_left = Point::new(52, 40);
Expand Down Expand Up @@ -862,10 +862,10 @@ fn kaluga_hello_world(

display
.init(&mut delay::Ets)
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;
display
.set_orientation(st7789::Orientation::Landscape)
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;

led_draw(&mut display)
}
Expand Down Expand Up @@ -908,13 +908,13 @@ fn heltec_hello_world(

display
.init()
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;

led_draw(&mut display)?;

display
.flush()
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;

Ok(())
}
Expand Down Expand Up @@ -966,13 +966,13 @@ fn ssd1306g_hello_world_spi(

display
.init()
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;

led_draw(&mut display)?;

display
.flush()
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;

Ok(())
}
Expand Down Expand Up @@ -1014,13 +1014,13 @@ fn ssd1306g_hello_world(

display
.init()
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;

led_draw(&mut display)?;

display
.flush()
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;

Ok(power)
}
Expand Down Expand Up @@ -1062,12 +1062,12 @@ fn esp32s3_usb_otg_hello_world(

display
.init(&mut delay::Ets)
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;
display
.set_orientation(st7789::Orientation::Landscape)
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;

led_draw(&mut display)
led_draw(&mut display).map_err(|e| anyhow::anyhow!("Led draw error: {:?}", e))
}

#[allow(dead_code)]
Expand Down

0 comments on commit fba0aa3

Please sign in to comment.