Fix issues with MCDU

Signed-off-by: fly <merspieler@alwaysdata.net>
This commit is contained in:
fly 2024-12-03 13:32:14 +01:00
parent 08127eb7b0
commit 79684bdd0a
2 changed files with 3 additions and 6 deletions

View file

@ -30,7 +30,7 @@ use crate::device::{CustomConfig, CustomInputReport};
macro_rules! define_output_states { macro_rules! define_output_states {
($bit:literal, $pin:ident, $output:ident, $io_pins:ident) => { ($bit:literal, $pin:ident, $output:ident, $io_pins:ident) => {
if $output.leds >= $bit { if $output.leds & $bit == $bit {
$io_pins.$pin.set_high(); $io_pins.$pin.set_high();
} }
else { else {
@ -324,10 +324,7 @@ fn main() -> ! {
if usb_dev.poll(&mut [&mut consumer]) { if usb_dev.poll(&mut [&mut consumer]) {
match consumer.device().read_report() { match consumer.device().read_report() {
Err(UsbHidError::WouldBlock) => { Err(UsbHidError::WouldBlock) => { }
// TODO somehow always gets stuck here
io_pins.pa10.set_high();
}
Ok(output) => { Ok(output) => {
// LED outputs // LED outputs
define_output_states!(0x1, pa9, output, io_pins); // FM define_output_states!(0x1, pa9, output, io_pins); // FM

View file

@ -14,7 +14,7 @@
</nasal> </nasal>
<!-- Outputs --> <!-- Outputs -->
<event> <event>
<name>unknown-0</name> <name>unknown</name>
<setting> <setting>
<property>/FLC/MCDU/Capt/leds</property> <property>/FLC/MCDU/Capt/leds</property>
</setting> </setting>