From 4d505f188d5c1738dd171a1b3c04139c196e88cb Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 5 May 2026 23:54:06 +0800 Subject: [PATCH] add non-blocking version of screen brightness dimming this is useful for dimming "animations" where it's not critical if a dimming step is missed and you're spamming the graphics server with dim requests --- libs/ux-api/src/service/gfx.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/ux-api/src/service/gfx.rs b/libs/ux-api/src/service/gfx.rs index 383c5ace8..1c88a073e 100644 --- a/libs/ux-api/src/service/gfx.rs +++ b/libs/ux-api/src/service/gfx.rs @@ -824,6 +824,15 @@ impl Gfx { .map(|_| ()) } + #[cfg(feature = "board-baosec")] + pub fn brightness_nonblocking(&self, level: u8) { + xous::try_send_message( + self.conn, + Message::new_scalar(GfxOpcode::Brightness.to_usize().unwrap(), level as usize, 0, 0, 0), + ) + .ok(); + } + #[cfg(feature = "board-baosec")] pub fn flip_screen(&self, flip: bool) -> Result<(), xous::Error> { send_message(