[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Struct problem
From: |
Richard Urwin |
Subject: |
Re: [avr-gcc-list] Struct problem |
Date: |
Mon, 2 Feb 2004 00:31:00 +0000 |
User-agent: |
KMail/1.5.3 |
On Saturday 31 Jan 2004 5:43 am, Eric Fu wrote:
> It works. That's great.
> But it added an unbelievable 500Bytes! It seems the code size under
> AVR GCC varies a lot for different implementations of the same task.
> In my case, what I changed was to access UART buffer from arrays to
> pointers with malloc.
> I redefined:
> ...
> byte *pTxBuf,*pRxBuf;
> ...
> Allocated memory as:
> uart0.pRxBuf = malloc(RX_BUFFER_SIZE0);
> uart0.pTxBuf = malloc(TX_BUFFER_SIZE0);
Try allocating the buffers in global memory, and then putting pointers
to them into the structure:
char rx0[RX_BUFFER_SIZE0]
...
UART0.PrXbUFF = &rx0[0];
--
Richard Urwin
- Re: [avr-gcc-list] Struct problem,
Richard Urwin <=
- Re: [avr-gcc-list] Struct problem, David Brown, 2004/02/02
- Re: [avr-gcc-list] Struct problem, Eric Fu, 2004/02/02
- Re: [avr-gcc-list] Struct problem, Joerg Wunsch, 2004/02/02
- Re: [avr-gcc-list] Struct problem, David Brown, 2004/02/02
- Re: [avr-gcc-list] Struct problem, Joerg Wunsch, 2004/02/02
- Re: [avr-gcc-list] Struct problem, David Brown, 2004/02/03
- Re: [avr-gcc-list] Struct problem, Erik Christiansen, 2004/02/03
- Re: [avr-gcc-list] Struct problem, Simon Han, 2004/02/03
- Re: [avr-gcc-list] Struct problem, Erik Christiansen, 2004/02/04
- Re: [avr-gcc-list] Struct problem, Simon Han, 2004/02/04