Skip to content

Commit

Permalink
Flip low/high on SP -> host interupt GPIO (oxidecomputer#883)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgallagher authored Oct 28, 2022
1 parent 474f2fa commit fd3807c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions task/host-sp-comms/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,12 @@ impl ServerImpl {
fn set_status_impl(&mut self, status: Status) {
if status != self.status {
self.status = status;
// SP_TO_SP3_INT_L: `INT_L` is "interrupt low", so we assert the pin
// when we do not have status and deassert it when we do.
if self.status.is_empty() {
self.sys.gpio_reset(SP_TO_SP3_INT_L).unwrap_lite();
} else {
self.sys.gpio_set(SP_TO_SP3_INT_L).unwrap_lite();
} else {
self.sys.gpio_reset(SP_TO_SP3_INT_L).unwrap_lite();
}
}
}
Expand Down Expand Up @@ -851,7 +853,7 @@ cfg_if::cfg_if! {
}

fn sp_to_sp3_interrupt_enable(sys: &sys_api::Sys) {
sys.gpio_reset(SP_TO_SP3_INT_L).unwrap();
sys.gpio_set(SP_TO_SP3_INT_L).unwrap();

sys.gpio_configure_output(
SP_TO_SP3_INT_L,
Expand Down

0 comments on commit fd3807c

Please sign in to comment.