Skip to content

double call of flash_page_erase for copy_page use in file system code #230

@kevinjwalters

Description

@kevinjwalters

In microbitfs.c there's a single call to copy_page() with a preceeding called to flash_page_erase().

while (page != end_page) {
uint8_t *next_page = page+step;
flash_page_erase((uint32_t)page);
copy_page(page, next_page);
page = next_page;
}

Inside copy_page() it also calls flash_page_erase() on first arg.

static void copy_page(void *dest, void *src) {
DEBUG(("FILE DEBUG: Copying page from %lx to %lx.\r\n", (uint32_t)src, (uint32_t)dest));
flash_page_erase((uint32_t)dest);

Unless there's some magic under the covers I think this will be causing unnecessary wear on the flash? And maybe slowing things down a tiny bit?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions