Firstly, many thanks for this code, I've never though about implementing multiple soft PWM's like this! Great idea.
I've been playing with the code, but I've now come up against something which I can't figure out how to fix.
Junk compiler code generation.
Despite my best efforts (and the variable being defined as volatile!!!) , when using code composer studio and compiling the code in "release mode", the following lines:
while(pa != p); // Wait for this entry to be active
while(pa == p);
get compiled to:
$C$L2:
CMP.W &p,&pa
JNE ($C$L2)
$C