Le 07/01/2012 14:09, David Brown a écrit :
> On 06/01/12 20:30, Grant Edwards wrote:
>> On 2012-01-06, steve ayer<a...@handhelds.org>   wrote:
>>
>>> of course, you could put a wire on an unused gpio pin and put the
>>> device on a scope; that will give you accurate timing of code
>>> segments.
>>
>> In my experience that's usually the easiest method by far...
>>
>
> One thing to watch out for here is that when you write something like:
>
>       ...
>       setPinHi();
>       test code ...
>       setPinLo();
>       ...
>
> you might not be timing all of the test code, or only the test code.
> The compiler can often move the code around the "setPin" statements,
> especially if they are macros or functions that the compiler can see
> during the compilation.

Hmm, if they are functions they should be sequence points, and thus 
should be kept in sequence. For macros of course, it would depend on 
what they expand to.

In any case, one can always force sequence points /memory barriers. 
Don't know how they'd look like for MSP430 gcc, but for ARM gcc that 
would be "asm volatile ("" : : : "memory");"

Amicalement,
-- 
Albert.

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to