AP_Bootloader: fixed build with TEST_FLASH enabled

This commit is contained in:
Andrew Tridgell 2024-01-28 11:23:46 +11:00 committed by Peter Barker
parent 3171b5321a
commit 065ef471e7
1 changed files with 4 additions and 4 deletions

View File

@ -422,23 +422,23 @@ static void test_flash()
}
uint32_t num_writes = flash_func_sector_size(page) / sizeof(v);
uprintf("page %u size %u addr=0x%08x v=0x%08x\n",
page, flash_func_sector_size(page), addr, v[0]); delay(10);
unsigned(page), unsigned(flash_func_sector_size(page)), unsigned(addr), unsigned(v[0])); delay(10);
if (init_done) {
for (uint32_t j=0; j<flash_func_sector_size(page)/4; j++) {
uint32_t v1 = (page<<16) + (loop-1);
uint32_t v2 = flash_func_read_word(addr+j*4);
if (v2 != v1) {
uprintf("read error at 0x%08x v=0x%08x v2=0x%08x\n", addr+j*4, v1, v2);
uprintf("read error at 0x%08x v=0x%08x v2=0x%08x\n", unsigned(addr+j*4), unsigned(v1), unsigned(v2));
break;
}
}
}
if (!flash_func_erase_sector(page)) {
uprintf("erase of %u failed\n", page);
uprintf("erase of %u failed\n", unsigned(page));
}
for (uint32_t j=0; j<num_writes; j++) {
if (!flash_func_write_words(addr+j*sizeof(v), v, ARRAY_SIZE(v))) {
uprintf("write failed at 0x%08x\n", addr+j*sizeof(v));
uprintf("write failed at 0x%08x\n", unsigned(addr+j*sizeof(v)));
break;
}
}