}
-#ifdef _DEBUG
-
-/*
+/**
* Reset bad blocks map and erase all blocks.
- * DON'T USE on production chips: this function will try to erase
- * factory marked bad blocks too.
+ *
+ * \note DON'T USE on production chips: this function will try to erase
+ * factory marked bad blocks too.
*/
-static void mt29f_wipe(Mt29f *chip)
+void mt29f_format(Mt29f *chip)
{
int b;
chip->remap_start = MT29F_NUM_USER_BLOCKS;
}
+#ifdef _DEBUG
+
/*
* Create some bad blocks, erasing them and writing the bad block mark.
*/
-static void mt29f_ruinSomeBlocks(Mt29f *chip)
+void mt29f_ruinSomeBlocks(Mt29f *chip)
{
int bads[] = { 7, 99, 555, 1003, 1004, 1432 };
unsigned i;
bool mt29f_initUnbuffered(Mt29f *chip, struct Heap *heap, unsigned chip_select)
{
+ if (!commonInit(chip, heap, chip_select))
+ return false;
+
chip->fd.priv.vt = &mt29f_unbuffered_vt;
- return commonInit(chip, heap, chip_select);
+ return true;
}