platform: smart_leds: handle frame render error
This commit is contained in:
parent
e51ac02dc6
commit
e3b5a9bde4
@ -69,7 +69,9 @@ impl<T: SmartLedsWrite<Color = Rgb<u8>>, S: Surface, const PIXEL_NUM: usize> Dis
|
|||||||
|
|
||||||
fn end_frame(&mut self) {
|
fn end_frame(&mut self) {
|
||||||
let b = brightness_for_mw(self.pixbuf.as_milliwatts(), 255, self.max_mw);
|
let b = brightness_for_mw(self.pixbuf.as_milliwatts(), 255, self.max_mw);
|
||||||
let _ = self.target.write(brightness(self.pixbuf.iter().cloned(), b));
|
if let Err(_) = self.target.write(brightness(self.pixbuf.iter().cloned(), b).map(|x| { rgb::Bgr::new(x.r, x.g, x.b)})) {
|
||||||
|
panic!("Could not write frame");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_frame(&mut self) {
|
fn render_frame(&mut self) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user