mirror of
https://github.com/marcriera/ddgo-pnp-controller.git
synced 2025-05-18 13:48:34 +02:00
Finish TCPP-20009, initial work on VOK-00106
This commit is contained in:
parent
37cd8456d1
commit
c500940f26
3 changed files with 71 additions and 5 deletions
|
@ -1,11 +1,14 @@
|
|||
use crate::state::ControllerState;
|
||||
mod dgoc44u;
|
||||
mod tcpp20009;
|
||||
mod vok00106;
|
||||
|
||||
#[derive(PartialEq)]
|
||||
pub enum ControllerModel {
|
||||
NONE,
|
||||
DGOC44U,
|
||||
TYPE2,
|
||||
TCPP20009,
|
||||
VOK00106,
|
||||
}
|
||||
|
||||
pub fn set_model(state: &ControllerState) -> ControllerModel {
|
||||
|
@ -15,7 +18,11 @@ pub fn set_model(state: &ControllerState) -> ControllerModel {
|
|||
}
|
||||
else if state.button_up {
|
||||
println!("Selected controller TCPP-20009.");
|
||||
return ControllerModel::TYPE2;
|
||||
return ControllerModel::TCPP20009;
|
||||
}
|
||||
else if state.button_a {
|
||||
println!("Selected controller VOK-00106.");
|
||||
return ControllerModel::VOK00106;
|
||||
}
|
||||
else {
|
||||
println!("No controller selected.");
|
||||
|
@ -28,9 +35,12 @@ pub fn set_state(state: &mut ControllerState, model: &ControllerModel) {
|
|||
ControllerModel::DGOC44U => {
|
||||
dgoc44u::update_gadget(state);
|
||||
}
|
||||
ControllerModel::TYPE2 => {
|
||||
|
||||
ControllerModel::TCPP20009 => {
|
||||
tcpp20009::update_gadget(state);
|
||||
}
|
||||
ControllerModel::NONE => (),
|
||||
ControllerModel::VOK00106 => {
|
||||
vok00106::update_gadget(state);
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue