Skip to content

Commit

Permalink
mac: polishing power state handling
Browse files Browse the repository at this point in the history
  • Loading branch information
benedekkupper committed Oct 11, 2024
1 parent c1677e0 commit 7bb202e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion c2usb/usb/df/mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ void mac::stop()
if (running())
{
running_ = set_attached(false);
set_power_state(power::state::L3_OFF);
}
}

Expand Down Expand Up @@ -95,7 +96,8 @@ uint32_t mac::granted_bus_current_uA() const

bool mac::remote_wakeup()
{
if (not std_status().remote_wakeup)
if (!std_status().remote_wakeup or (power_state() == power::state::L0_ON) or
(power_state() == power::state::L3_OFF))
{
return false;
}
Expand Down

0 comments on commit 7bb202e

Please sign in to comment.