diff --git a/src/epd4in2/mod.rs b/src/epd4in2/mod.rs index fbddc57..d8dbdf3 100644 --- a/src/epd4in2/mod.rs +++ b/src/epd4in2/mod.rs @@ -196,12 +196,12 @@ where &mut self, spi: &mut SPI, buffer: &[u8], - x: u16, - y: u16, - width: u16, - height: u16, + x: u32, + y: u32, + width: u32, + height: u32, ) -> Result<(), SPI::Error> { - if buffer.len() as u16 != width / 8 * height { + if buffer.len() as u32 != width / 8 * height { //TODO: panic!! or sth like that //return Err("Wrong buffersize"); } diff --git a/src/graphics.rs b/src/graphics.rs index a477985..10fc30d 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -28,10 +28,10 @@ pub trait Display { } pub struct Graphics<'a> { - pub(crate) width: u32, - pub(crate) height: u32, - pub(crate) rotation: DisplayRotation, - pub(crate) buffer: &'a mut [u8], //buffer: Box//[u8; 15000] + width: u32, + height: u32, + rotation: DisplayRotation, + buffer: &'a mut [u8], //buffer: Box//[u8; 15000] } impl<'a> Graphics<'a> {