From eb579f932f10c77bbc808c644568f325b3ee6111 Mon Sep 17 00:00:00 2001 From: beerpsi Date: Fri, 29 Dec 2023 00:04:22 +0700 Subject: [PATCH] chore: formatting --- src/backends/dummy.rs | 6 ++---- src/lib.rs | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/backends/dummy.rs b/src/backends/dummy.rs index 1bf19fa..7080dad 100644 --- a/src/backends/dummy.rs +++ b/src/backends/dummy.rs @@ -58,13 +58,11 @@ pub fn read_pressure_data(_input: &[u8]) -> [u8; 32] { [0u8; 32] } -/// Do some one-time initialization to the USB out buffer +/// Do some one-time initialization to the USB out buffer /// (e.g. set magic bytes). #[cfg(any(chuni, chusanapp))] #[inline(always)] -pub fn init_output_buffer(_output: &mut [u8]) { - -} +pub fn init_output_buffer(_output: &mut [u8]) {} /// Update the RGB lighting on the slider. A slice `rgb` is provided, alternating /// between 16 touch pad pixels and 15 divider pixels, going from right to left. diff --git a/src/lib.rs b/src/lib.rs index 4c6f261..401ba19 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -299,9 +299,9 @@ pub extern "C" fn chuni_io_slider_set_leds(_rgb: *const u8) {} #[cfg(any(chuni, chusanapp))] pub extern "C" fn chuni_io_led_init() -> HRESULT { let mut output = SLIDER_OUTPUT.write(); - + con_impl::init_output_buffer(output.as_mut_slice()); - + S_OK } @@ -354,14 +354,14 @@ fn device_init() -> Result<()> { fn input_thread_proc() { info!("Input thread started"); - let mut shmem = - match create_shared_memory(INPUT_SHMEM_OS_ID, con_impl::INPUT_MEMORY_SIZE, true) { - Ok(s) => s, - Err(e) => { - error!("Could not obtain shared memory for controller input: {e:#?}"); - return; - } - }; + let mut shmem = match create_shared_memory(INPUT_SHMEM_OS_ID, con_impl::INPUT_MEMORY_SIZE, true) + { + Ok(s) => s, + Err(e) => { + error!("Could not obtain shared memory for controller input: {e:#?}"); + return; + } + }; let usb_in = unsafe { shmem.as_slice_mut() }; let device = DEVICE.get().unwrap();