para die





0
Date Submitted Sat. May. 2nd, 2009 4:36 PM
Revision 1 of 1
Beginner Janso
Tags none
Comments 0 comments
o hay

signed long      Channel1Bfr[BufferCh1Len];

void LoadToBufferCirc( signed long* ChannelBfr, signed long Data )
{
        Pointer = ChannelBfr[0];                // Get the current pointer for the buffer
        // Next pointer is pointer + 1, except that we are on the end of the buffer

        Pointer++;

        if( Pointer >= (sizeof((signed long*)ChannelBfr)/sizeof(signed long)) )
                Pointer = 0x01;

        ChannelBfr[Pointer] = Data;
        ChannelBfr[0] = Pointer;

}

// El problema es que "(sizeof((signed long*)ChannelBfr)/sizeof(signed long))" deberia
// dar como resultado BufferCh1Len, pero ni ahi...

Yo llamo a la funcion asi:

        do{
                for( longtemp = 0; longtemp < 100; longtemp++ )
                        LoadToBufferCirc( Channel2Bfr, longtemp );
        }while(1);
 

Mauricio Jancic

Comments

There are currently no comments for this snippet.

Voting

Votes Up


Votes Down