diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs index 54ba967..f512eb7 100644 --- a/rp2040/src/main.rs +++ b/rp2040/src/main.rs @@ -325,8 +325,6 @@ fn main() -> ! { buttons[5].usb_button = 0; buttons[6].usb_button = 7; buttons[7].usb_button = 8; - buttons[7].usb_button_sec = 16; - buttons[7].usb_button_toggle_enable = true; buttons[8].usb_button = 9; buttons[9].usb_button = 10; buttons[10].usb_button = 11; @@ -338,8 +336,6 @@ fn main() -> ! { buttons[11].usb_button_sec = 24; buttons[11].usb_button_sec_trigger_index = 0; buttons[12].usb_button = 13; - buttons[12].usb_button_sec = 17; - buttons[12].usb_button_toggle_enable = true; buttons[13].usb_button = 14; buttons[14].usb_button = 15; buttons[15].usb_button = 18; @@ -612,11 +608,10 @@ fn main() -> ! { // Dont send USB HID joystick report if there is no activity // This is to avoid preventing the computer from going to sleep if usb_update_count_down.wait().is_ok() && usb_activity { - match usb_hid_joystick.device().write_report(&get_joystick_report( - &mut buttons, - &mut axis, - &throttle_hold_enable, - )) { + match usb_hid_joystick + .device() + .write_report(&get_joystick_report(&mut buttons, &mut axis)) + { Err(UsbHidError::WouldBlock) => {} Ok(_) => {} Err(e) => { @@ -673,7 +668,6 @@ fn update_status_led
( fn get_joystick_report( matrix_keys: &mut [Button; NUMBER_OF_BUTTONS + 2], axis: &mut [GimbalAxis; 4], - throttle_hold_enable: &bool, ) -> JoystickReport { let x: u16 = axis[GIMBAL_AXIS_LEFT_X].value; let y: u16 = AXIS_MAX - axis[GIMBAL_AXIS_LEFT_Y].value; @@ -776,14 +770,13 @@ fn get_joystick_report( if key.pressed && key.usb_button != 0 && key.usb_button_toggle_enable - && (key.usb_release_timeout > 1 || *throttle_hold_enable) + && key.usb_release_timeout > 1 { buttons |= 1 << (key.usb_button - 1); } else if !key.pressed && key.usb_button_sec != 0 && key.usb_button_toggle_enable && key.usb_release_timeout > 1 - && !throttle_hold_enable { buttons |= 1 << (key.usb_button_sec - 1); // Sec button mode