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

Commit fba0aa3

Browse files
author
Mihai Dinculescu
authored
Fix esp32s3_usb_otg and anyhow calls (#88)
1 parent 45f041d commit fba0aa3

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/main.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -797,10 +797,10 @@ fn ttgo_hello_world(
797797

798798
display
799799
.init(&mut delay::Ets)
800-
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
800+
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;
801801
display
802802
.set_orientation(st7789::Orientation::Portrait)
803-
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
803+
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;
804804

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

863863
display
864864
.init(&mut delay::Ets)
865-
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
865+
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;
866866
display
867867
.set_orientation(st7789::Orientation::Landscape)
868-
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
868+
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;
869869

870870
led_draw(&mut display)
871871
}
@@ -908,13 +908,13 @@ fn heltec_hello_world(
908908

909909
display
910910
.init()
911-
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
911+
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;
912912

913913
led_draw(&mut display)?;
914914

915915
display
916916
.flush()
917-
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
917+
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;
918918

919919
Ok(())
920920
}
@@ -966,13 +966,13 @@ fn ssd1306g_hello_world_spi(
966966

967967
display
968968
.init()
969-
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
969+
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;
970970

971971
led_draw(&mut display)?;
972972

973973
display
974974
.flush()
975-
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
975+
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;
976976

977977
Ok(())
978978
}
@@ -1014,13 +1014,13 @@ fn ssd1306g_hello_world(
10141014

10151015
display
10161016
.init()
1017-
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
1017+
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;
10181018

10191019
led_draw(&mut display)?;
10201020

10211021
display
10221022
.flush()
1023-
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
1023+
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;
10241024

10251025
Ok(power)
10261026
}
@@ -1062,12 +1062,12 @@ fn esp32s3_usb_otg_hello_world(
10621062

10631063
display
10641064
.init(&mut delay::Ets)
1065-
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
1065+
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;
10661066
display
10671067
.set_orientation(st7789::Orientation::Landscape)
1068-
.map_err(|e| anyhow::message("Display error: {:?}", e))?;
1068+
.map_err(|e| anyhow::anyhow!("Display error: {:?}", e))?;
10691069

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

10731073
#[allow(dead_code)]

0 commit comments

Comments
 (0)