rename pin command handler factory method
This commit is contained in:
@@ -5,7 +5,7 @@ use std::time::Instant;
|
|||||||
pub trait PinDevice {
|
pub trait PinDevice {
|
||||||
fn set_pin(&self, pin: u8, value: PinState, valid_until: Instant, priority: u8);
|
fn set_pin(&self, pin: u8, value: PinState, valid_until: Instant, priority: u8);
|
||||||
|
|
||||||
fn new_pinset_callback<'a>(&self) -> impl Fn(ValidPriorityCommand<SetPin>) + 'a
|
fn new_set_pin_callback<'a>(&self) -> impl Fn(ValidPriorityCommand<SetPin>) + 'a
|
||||||
where
|
where
|
||||||
Self: Sized + Clone + 'a,
|
Self: Sized + Clone + 'a,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -71,8 +71,8 @@ pub fn run() -> Result<()> {
|
|||||||
|
|
||||||
let mut comms = CommsTask::new(15000, "nautilus-ground:14000")?;
|
let mut comms = CommsTask::new(15000, "nautilus-ground:14000")?;
|
||||||
comms.add_command_handler("/shutdown", new_shutdown_handler(&running))?;
|
comms.add_command_handler("/shutdown", new_shutdown_handler(&running))?;
|
||||||
comms.add_command_handler("/mcp23017a/set", task_a.new_pinset_callback())?;
|
comms.add_command_handler("/mcp23017a/set", task_a.new_set_pin_callback())?;
|
||||||
comms.add_command_handler("/mcp23017b/set", task_b.new_pinset_callback())?;
|
comms.add_command_handler("/mcp23017b/set", task_b.new_set_pin_callback())?;
|
||||||
let comms = s.run_cyclic("comms-task", comms, 10)?;
|
let comms = s.run_cyclic("comms-task", comms, 10)?;
|
||||||
|
|
||||||
let sv = &state_vector;
|
let sv = &state_vector;
|
||||||
|
|||||||
Reference in New Issue
Block a user