Open marcio-ao opened 5 years ago
Please refactor, then I can review it. See also private email on concerns and validation testing.
One other note: there are other host controllers that would have to be modified, not just the MAX chip. EHCI and Kinetis, plus anything in the future. Might be best to have a variable or a define to enable this feature as well.
Currently, the frame IRQ fires continuously every 1ms. This causes problems with timing critical code, especially code which also has a 1kHz interrupt (I'm talking about Marlin).
This PR modifies the handling of the frame IRQ so it is enabled only when needed:
sof_countdown
variable has been refactored into aSOF_Timer
classSOF_Timer
now has a "woken" and a "sleeping" state.Don't merge this code in quite yet. I believe it can be cleaned up a bit more. I just wanted you to look over it and maybe test it on your devices.