MCPcopy Index your code
hub / github.com/FrameworkComputer/inputmodule-rs / assign_sleep_reason

Function assign_sleep_reason

ledmatrix/src/main.rs:588–603  ·  view source on GitHub ↗
(
    previous: Option<SleepReason>,
    current: Option<SleepReason>,
    need_sleep: bool,
    // Whether the signal has actually changed in between firing
    signal_changed: bool,
    new: SleepRe

Source from the content-addressed store, hash-verified

586}
587
588fn assign_sleep_reason(
589 previous: Option<SleepReason>,
590 current: Option<SleepReason>,
591 need_sleep: bool,
592 // Whether the signal has actually changed in between firing
593 signal_changed: bool,
594 new: SleepReason,
595) -> Option<SleepReason> {
596 if !need_sleep {
597 None
598 } else if current.is_some() && (Some(new) == previous || !signal_changed) {
599 current
600 } else {
601 Some(new)
602 }
603}
604
605// Will do nothing if already in the right state
606fn handle_sleep(

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected