LP PHY ACI Update
The definition for struct lpphy_aci is {int on_thresh; int on_timeout; int off_thresh; int off_timeout; int glitch_timeout; int glitch_cnt; int ts; }
- Read Shared Memory location 0x68 and save as cnt
Let delta be (cnt - lpphy_aci.glitch_cnt) & 0xFFFF
Store cnt in lpphy_aci.glitch_cnt
If (!(aci_state & 2) && (delta < lpphy_aci.on_thresh)) || ((aci_state & 2) && (delta > lpphy_aci.off_thresh))
Copy now to lpphy_aci.ts
Let t be now - lpphy_aci.ts
If !(aci_state & 2) && (t >= lpphy_aci.on_timeout)
Call LP PHY ACI with 1 as argument
Else if (aci_state & 2) && (t > lpphy_aci.off_timeout)
Call LP PHY ACI with 0 as argument