/** * \file * * * \brief Test function for serial Flash memory. * * \author Daniele Basile */ /** * Test function for flash25. * * \note: This implentation use a SPI channel. */ #include #include #include #warning FIXME:Review and refactor this test.. bool flash25_test(KFile *channel) { Flash25 fd; uint8_t test_buf[256]; /* * Init a spi kfile interface and * flash driver. */ flash25_init(&fd, channel); kprintf("Init serial flash\n"); flash25_chipErase(&fd); flash25_sectorErase(&fd, FLASH25_SECT1); flash25_sectorErase(&fd, FLASH25_SECT2); flash25_sectorErase(&fd, FLASH25_SECT3); flash25_sectorErase(&fd, FLASH25_SECT4); /* * Launche a kfile test interface. */ kprintf("Kfile test start..\n"); if (!kfile_testRunGeneric(&fd.fd, test_buf, NULL, sizeof(test_buf))) return false; return true; }