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 David Kelly

On Fri, Mar 06, 2009 at 10:57:03AM -0500, subscriptions@aeolusdevelopment.com wrote:
> 
> Assuming you are sending the long out as binary, something like the
> following is what I would use (serial_out is left out, I'm assuming
> the HW control you have a handle on)
> 
> 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.

-- 
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

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.