Jump to content


  • Content Count

  • Joined

  • Last visited

  1. Well I never, I was offered a solution by somebody else.... instead of: volatile TPWM *pa; // Active list entry the actual declaration should be: volatile TPWM * volatile pa; // Active list entry This fixes the issue.
  2. My brain is frazzled, I realised after typing that lot out that the solution was easy. inline assembler __asm("neloop:\n" " cmp.w &p,&pa\n" " jne neloop"); __asm("eloop:\n" " cmp.w &p,&pa\n" " jeq eloop"); That's the solution for the CCS compiler, replace the two "C" lines with those assembler lines because we know better than the compiler! Hopefully that's of use to somebody! Adrian
  3. 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
  • Create New...