tasks: rendering: commit surfaces before drawing
This commit is contained in:
@@ -22,6 +22,7 @@ pub async fn oled_render(mut output: SsdOutput, surfaces: OledUiSurfacePool, uni
|
|||||||
|
|
||||||
loop {
|
loop {
|
||||||
let start = Instant::now();
|
let start = Instant::now();
|
||||||
|
surfaces.commit();
|
||||||
{
|
{
|
||||||
let mut locked = uniforms.lock().await;
|
let mut locked = uniforms.lock().await;
|
||||||
output.clear(BinaryColor::Off).unwrap();
|
output.clear(BinaryColor::Off).unwrap();
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ pub async fn render(rmt: esp_hal::peripherals::RMT<'static>, gpio: AnyPin<'stati
|
|||||||
output.blank();
|
output.blank();
|
||||||
|
|
||||||
uniforms.frame = (Instant::now().as_millis() / ANIMATION_FRAME_TIME.as_millis()) as usize;
|
uniforms.frame = (Instant::now().as_millis() / ANIMATION_FRAME_TIME.as_millis()) as usize;
|
||||||
|
surfaces.commit();
|
||||||
|
safety_surfaces.commit();
|
||||||
surfaces.render_to(&mut output, &uniforms);
|
surfaces.render_to(&mut output, &uniforms);
|
||||||
// TODO: We should split up the safety layers so they always have full power
|
// TODO: We should split up the safety layers so they always have full power
|
||||||
safety_surfaces.render_to(&mut output, &uniforms);
|
safety_surfaces.render_to(&mut output, &uniforms);
|
||||||
|
|||||||
Reference in New Issue
Block a user