@@ -136,6 +136,7 @@ pub struct InputDeckStatus {
136136 pub state : InputDeckState ,
137137 pub hubboard_present : bool ,
138138 pub touchpad_present : bool ,
139+ pub touchpad_id : u8 ,
139140 pub top_row : TopRowPositions ,
140141}
141142
@@ -177,16 +178,20 @@ impl InputDeckStatus {
177178
178179impl From < EcResponseDeckState > for InputDeckStatus {
179180 fn from ( item : EcResponseDeckState ) -> Self {
181+ let tp_id = InputModuleType :: from ( item. board_id [ InputDeckMux :: Touchpad as usize ] ) ;
182+ let tp_present = !matches ! (
183+ tp_id,
184+ InputModuleType :: Short | InputModuleType :: Disconnected
185+ ) ;
186+
180187 InputDeckStatus {
181188 state : InputDeckState :: from ( item. deck_state ) ,
182189 hubboard_present : matches ! (
183190 InputModuleType :: from( item. board_id[ InputDeckMux :: HubBoard as usize ] , ) ,
184191 InputModuleType :: HubBoard
185192 ) ,
186- touchpad_present : matches ! (
187- InputModuleType :: from( item. board_id[ InputDeckMux :: Touchpad as usize ] , ) ,
188- InputModuleType :: Touchpad
189- ) ,
193+ touchpad_present : tp_present,
194+ touchpad_id : item. board_id [ InputDeckMux :: Touchpad as usize ] ,
190195 top_row : TopRowPositions {
191196 pos0 : InputModuleType :: from ( item. board_id [ InputDeckMux :: TopRow0 as usize ] ) ,
192197 pos1 : InputModuleType :: from ( item. board_id [ InputDeckMux :: TopRow1 as usize ] ) ,
0 commit comments