Update to new error type from eh 1.0a6

This commit is contained in:
Caemor
2021-12-01 11:27:39 +01:00
parent 2cb7775896
commit 53bfeab6cc
22 changed files with 374 additions and 329 deletions
+4 -1
View File
@@ -7,12 +7,15 @@ use linux_embedded_hal::{
sysfs_gpio::Direction,
Delay, Spidev, SysfsPin as Pin,
};
use core::convert::Infallible;
use linux_embedded_hal::SPIError;
// activate spi, gpio in raspi-config
// needs to be run with sudo because of some sysfs_gpio permission problems and follow-up timing problems
// see https://github.com/rust-embedded/rust-sysfs-gpio/issues/5 and follow-up issues
fn main() -> Result<(), linux_embedded_hal::SPIError> {
fn main() -> Result<(), epd_waveshare::Error<SPIError, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, Infallible>> {
// Configure SPI
// SPI settings are from eink-waveshare-rs documenation
let mut spi = Spidev::open("/dev/spidev0.0")?;
+4 -1
View File
@@ -18,12 +18,15 @@ use linux_embedded_hal::{
sysfs_gpio::Direction,
Delay, Spidev, SysfsPin as Pin,
};
use core::convert::Infallible;
use linux_embedded_hal::SPIError;
// activate spi, gpio in raspi-config
// needs to be run with sudo because of some sysfs_gpio permission problems and follow-up timing problems
// see https://github.com/rust-embedded/rust-sysfs-gpio/issues/5 and follow-up issues
fn main() -> Result<(), linux_embedded_hal::SPIError> {
fn main() -> Result<(), epd_waveshare::Error<SPIError, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, Infallible>> {
// Configure SPI
// Settings are taken from
let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory");
+4 -1
View File
@@ -18,6 +18,9 @@ use linux_embedded_hal::{
sysfs_gpio::Direction,
Delay, Spidev, SysfsPin as Pin,
};
use core::convert::Infallible;
use linux_embedded_hal::SPIError;
// activate spi, gpio in raspi-config
// needs to be run with sudo because of some sysfs_gpio permission problems and follow-up timing problems
@@ -34,7 +37,7 @@ use linux_embedded_hal::{
//
// after finishing, put the display to sleep
fn main() -> Result<(), linux_embedded_hal::SPIError> {
fn main() -> Result<(), epd_waveshare::Error<SPIError, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, Infallible>> {
let busy = Pin::new(24); // GPIO 24, board J-18
busy.export().expect("busy export");
while !busy.is_exported() {}
+3 -1
View File
@@ -18,12 +18,14 @@ use linux_embedded_hal::{
sysfs_gpio::Direction,
Delay, Spidev, SysfsPin as Pin,
};
use core::convert::Infallible;
use linux_embedded_hal::SPIError;
// activate spi, gpio in raspi-config
// needs to be run with sudo because of some sysfs_gpio permission problems and follow-up timing problems
// see https://github.com/rust-embedded/rust-sysfs-gpio/issues/5 and follow-up issues
fn main() -> Result<(), linux_embedded_hal::SPIError> {
fn main() -> Result<(), epd_waveshare::Error<SPIError, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, Infallible>> {
// Configure SPI
// Settings are taken from
let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory");
+5 -1
View File
@@ -19,12 +19,16 @@ use linux_embedded_hal::{
sysfs_gpio::Direction,
Delay, Spidev, SysfsPin as Pin,
};
use core::convert::Infallible;
use linux_embedded_hal::SPIError;
// activate spi, gpio in raspi-config
// needs to be run with sudo because of some sysfs_gpio permission problems and follow-up timing problems
// see https://github.com/rust-embedded/rust-sysfs-gpio/issues/5 and follow-up issues
fn main() -> Result<(), linux_embedded_hal::SPIError> {
fn main() -> Result<(), epd_waveshare::Error<SPIError, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, Infallible>> {
// Configure SPI
// Settings are taken from
let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory");