ch32f1: Fixed the assumption that uint32_t is an `unsigned int`

This commit is contained in:
dragonmux 2022-05-31 09:44:51 -04:00 committed by Rachel Mant
parent 94a0f1587d
commit 2d4d6aa65a
1 changed files with 9 additions and 10 deletions

View File

@ -241,14 +241,13 @@ int ch32f1_flash_erase (struct target_flash *f, target_addr addr, size_t len)
NB: Just reading fff is not enough as it could be a transient previous operation value NB: Just reading fff is not enough as it could be a transient previous operation value
*/ */
static bool ch32f1_wait_flash_ready(target *t,uint32_t adr) static bool ch32f1_wait_flash_ready(target *t, uint32_t adr)
{ {
uint32_t ff; uint32_t ff;
for(int i = 0; i < 32; i++) { for (int i = 0; i < 32; i++)
ff = target_mem_read32(t,adr); ff = target_mem_read32(t, adr);
} if (ff != 0xffffffffUL) {
if(ff != 0xffffffffUL) { ERROR_CH("ch32f1 Not erased properly at %" PRIx32 " or flash access issue\n", adr);
ERROR_CH("ch32f1 Not erased properly at %x or flash access issue\n",adr);
return false; return false;
} }
return true; return true;