- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everybody,
in my project I must optimaze a file as SPEED.
How to exclude a single instruction from being optimazed?
There some instruction that said to compiler to do not optimize the instruction?
I think in my case, the compiler makes optimization of CY_NOP instructions that I used as small delay and my routine do not works correctly. Is there something label to write before the CY_NOP to say to compiler that have not to optimize the instruction?
Something like the "volatile" for the variables..
Thank you
Solved! Go to Solution.
- Labels:
-
PSOC5 LP MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MaTr,
How do you know that CY_NOP is being optimized out? Did you check the delay in execution time?
One way to save code from being optimized out is to encapsulate it into custom component. Basically, make empty component, add add some API to it. Just a header file will suffice in your case. Then call that function containing CY_NOP code.
Miraculously (and unfortunately) Creator will not optimize out the dead code inside the component. I believe that this is a big, at least I didn't find the way to clean up dead code inside components' API.
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MaTr,
How do you know that CY_NOP is being optimized out? Did you check the delay in execution time?
One way to save code from being optimized out is to encapsulate it into custom component. Basically, make empty component, add add some API to it. Just a header file will suffice in your case. Then call that function containing CY_NOP code.
Miraculously (and unfortunately) Creator will not optimize out the dead code inside the component. I believe that this is a big, at least I didn't find the way to clean up dead code inside components' API.
/odissey1