Yes, you could start an endless timer interrupt (let's say few milliseconds) in which you check your value, then start the HPWM and keep track of the required delay.
OR, enable the timer interrupt in your code, and assign a duration or flags for the HPWM.
Bookmarks