This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS V 4.2.4 compiler optimization

Hi,

I am using protothreads in my project, and I see certain code lines inside thread (as simple as a=0;) being skipped over by the compiler.

So here are my 2 questions

1. how and where should i change compiler settings so that it does not optimize my code?

2. Does CCS compiler works with protothreads?

 

Thanks!

 

Parag Rao.

  • Hello,

    parag rao said:
    1. how and where should i change compiler settings so that it does not optimize my code?

    right-click on the project in the Projects view and select Build Properties in the context menu. Then for the Basic Options, make sure the Optimization level field is blank.

    parag rao said:
    2. Does CCS compiler works with protothreads?

    I'll have someone more familiar with the compiler to respond to this question.

    Thanks

    ki

  • parag rao said:
    . Does CCS compiler works with protothreads?

    No.  To be honest, this is the first I have heard the term protothreads.  And I've worked with TI compilers for a very long time. 

    Thanks and regards,

    -George

  • Georgem,

    Here is the website for Protothreads - http://www.sics.se/~adam/pt/.    They are not part of the compiler but are a header/macro construct that automatically generates switch-case statements from the line number.  The compiler pragme directive __LINE__ inserts the number of the C file line into the case statement.  You can google the word "Protothreads" to find the protothreads website. And yes, they do work and yes, I have implemented them successfully using the C2000 compilers and the C2400 compilers.  I expect that they would work with any C compliant compiler.