AT25DF_INFO

Uwe Bonnes <bon-1JbLm1bU5j5ZIx36JBfelj3+ndqKAYMe9FMPySWZwLkb1SvskN2V4Q@public.gmane.org> Mon, 21 Mar 2016 15:19:56 +0100
Newsgroups gmane.comp.hardware.microcontrollers.ethernut
Message-ID <[email protected]>
Hello (Ole),

dev/spi_at25df.h defines in struct _AT25DF_INFO {

    /*! \brief Total number of pages. */
    uint32_t at25df_erase_blocks;

Description and name contradict.  Shouldn't it read something like

    /*! \brief Total number of blocks. */
    uint32_t at25df_blocks;

Otherwise, I think at25df_ebshft is not needed and instead of e.g.
./dev/spi_flash_at25df.c:        pga = pgn << at->dxb_dfinfo->at25df_ebshft;
we could use
./dev/spi_flash_at25df.c:        pga = pgn << 12;
Having redundant parameters increases the chance for wrong
parameters. Smallest erase size is always 4096 bytes for all XX25 serial
flash I had a look at,

Shouldn't
./dev/spi_at25df_info.c:AT25DF_INFO at25df_info[] = {
read
./dev/spi_at25df_info.c:const AT25DF_INFO at25df_info[] = {
                        ^^^^
to not waste RAM?

Any comments?

Bye
-- 
Uwe Bonnes                bon-1JbLm1bU5j5ZIx36JBfelj3+ndqKAYMe9FMPySWZwLkb1SvskN2V4Q@public.gmane.org

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 1623569 ------- Fax. 06151 1623305 ---------
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion