Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Array of Long

2009-03-06 by subscriptions@aeolusdevelopment.com

David Kelly Wrote
>On Fri, Mar 06, 2009 at 10:57:03AM -0500,
subscriptions@aeolusdevelopment.com wrote:
>> 
>> void put_bytes( unsigned char * const buf, int num)
>> {
>>   int i;
>> 
>>   for( i=0; i < num; i++){
>>      serial_out( *buf);
>>      buf++;
>>      }
>> }
>
>Benchmark that against the same using index logic rather than pointers.
>The last compiler I used that generated faster/smaller code with
>pointers was for the 68k.

Written for clarity.  I generally use array syntax for arrays and pointer
syntax for pointers.  Let the compiler sort it out.

In any case the serial port overhead will likely swamp the pointer/indexing
overhead.

Robert

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://link.mail2web.com/mail2web

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.