Skip to content

Commit 8e75d18

Browse files
authored
Merge pull request #63 from Neotron-Compute/fix-irq-backpower
Force IRQ Line line in power-off.
2 parents 75cd12d + 2a62614 commit 8e75d18

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

neotron-bmc-pico/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,10 @@ mod app {
382382
// Take this out of the `local` object to avoid sharing issues.
383383
let mut rcc = ctx.local.rcc.take().unwrap();
384384
defmt::info!("Idle is running...");
385-
let mut irq_masked = true;
385+
let mut irq_forced_low = true;
386386
let mut is_high = false;
387387
loop {
388-
if !irq_masked && !register_state.ps2_kb_bytes.is_empty() {
388+
if irq_forced_low || !register_state.ps2_kb_bytes.is_empty() {
389389
// We need service
390390
ctx.local.pin_irq.set_low().unwrap();
391391
if is_high {
@@ -432,7 +432,7 @@ mod app {
432432
// Shut off the 5V power
433433
ctx.shared.pin_dc_on.set_low().unwrap();
434434
// Mask the IRQ to avoid back-powering the host
435-
irq_masked = true;
435+
irq_forced_low = true;
436436
// Start LED blinking again
437437
led_power_blink::spawn().unwrap();
438438
}
@@ -458,7 +458,7 @@ mod app {
458458
// Returns an error if it's already scheduled (but we don't care)
459459
let _ = exit_reset::spawn_after(RESET_DURATION_MS.millis());
460460
// Set 6 - unmask the IRQ
461-
irq_masked = false;
461+
irq_forced_low = false;
462462
}
463463
}
464464
Some(Message::PowerButtonRelease) => {

0 commit comments

Comments
 (0)