Update embedded-graphics and update epd4in2-blue-pill-exampleg

This commit is contained in:
Caemor
2020-03-18 14:30:40 +01:00
parent 8829f9a315
commit dcaed6fb3e
21 changed files with 290 additions and 328 deletions
+10 -7
View File
@@ -1,6 +1,6 @@
use crate::epd1in54b::{DEFAULT_BACKGROUND_COLOR, HEIGHT, WIDTH};
use crate::graphics::{Display, DisplayRotation};
use crate::prelude::*;
use embedded_graphics::pixelcolor::BinaryColor;
use embedded_graphics::prelude::*;
pub struct Display1in54b {
@@ -18,12 +18,15 @@ impl Default for Display1in54b {
}
}
impl Drawing<Color> for Display1in54b {
fn draw<T>(&mut self, item_pixels: T)
where
T: IntoIterator<Item = Pixel<Color>>,
{
self.draw_helper(WIDTH, HEIGHT, item_pixels);
impl DrawTarget<BinaryColor> for Display1in54b {
type Error = core::convert::Infallible;
fn draw_pixel(&mut self, pixel: Pixel<BinaryColor>) -> Result<(), Self::Error> {
self.draw_helper(WIDTH, HEIGHT, pixel)
}
fn size(&self) -> Size {
Size::new(WIDTH, HEIGHT)
}
}