[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] [PATCH] Bootloader buffer size defines
From: |
E. Weddington |
Subject: |
Re: [avr-libc-dev] [PATCH] Bootloader buffer size defines |
Date: |
Wed, 05 Feb 2003 15:23:23 -0700 |
On 5 Feb 2003 at 21:37, Volkmar Dierkes wrote:
> On Wed, 05 Feb 2003 10:48:09 -0700, E. Weddington wrote:
>
> > I forgot to mention, that the reason why the bootloader temporary
> > buffer sizes are in byte sizes and not the word sizes that Volkmar
> > listed, is because of how the AVR writes to the bootloader temporary
> > buffer.
>
> I took the values from the datasheets, but that's ok for me. I took
> just a look in my bootloader and have seen that I always used
> SPM_PAGESIZE*2 or SPM_PAGESIZE<<1 ;-)
>
> So, that's the best solution I think.
>
Really it could go either way, and both ways have to be documented.
If SPM_PAGESIZE is the size in bytes then
for(i = address_start; i < SPM_PAGESIZE; i += 2)
{
boot_page_fill(i, data_word);
}
is needed. If SPM_PAGESIZE is the size in words then
for(i = address_start; i < SPM_PAGESIZE; i++)
{
boot_page_fill(i * 2, data_word);
}
is needed.
IMO, dealing with units of bytes is always easier than dealing with
units of words.
Does anybody else have a preference?
Eric