SV: [Icc-avr] Bootloader problem

John Baraclough j_baraclough at zetnet.co.uk
Thu Nov 1 09:31:51 PST 2007


At 16:12 01/11/2007, you wrote:
>Hi,
>
>     Thanks for all your reply!  The main reason I`m asking the question I
>need more space in my code and those line take less space
>
>PageAddressHigh = RxChar() + (RxChar() << 8);
>
>and this one take more space
>
>         uint8_t tmpLo = RxChar();
>         uint8_t tmpHi = RxChar();
>         PageAddressHigh = tmpLo | (((uint16_t) tmpHi) << 8);
>
>So with your reply I will try to find another way to reduce my code
>space,.....
>
>Thanks
>Sylvain Bissonnette

Hi Sylvain,

You could always compromise on this:

         uint8_t tmpLo = RxChar();
         PageAddressHigh = tmpLo | (((uint16_t)(RxChar())) << 8);

which will certainly ensure the calls to RxChar() are done in the 
correct order and may be smaller in code size.

Are you still trying to fit your bootloader into 256 bytes for a 
mega256x, or is it too large for the 512 block?

John 



More information about the Icc-avr mailing list