ch32f1: Fixed the return type for ch32f1_flash_unlock

This commit is contained in:
dragonmux 2022-07-30 10:00:48 +01:00 committed by Piotr Esden-Tempski
parent 9d43ade05c
commit f548473f28
1 changed files with 3 additions and 3 deletions

View File

@ -129,7 +129,7 @@ static void ch32f1_add_flash(target *t, uint32_t addr, size_t length, size_t era
\fn ch32f1_flash_unlock
\brief unlock ch32f103 in fast mode
*/
static int ch32f1_flash_unlock(target *t)
static bool ch32f1_flash_unlock(target *t)
{
DEBUG_INFO("CH32: flash unlock \n");
@ -141,9 +141,9 @@ static int ch32f1_flash_unlock(target *t)
uint32_t cr = target_mem_read32(t, FLASH_CR);
if (cr & FLASH_CR_FLOCK_CH32) {
DEBUG_WARN("Fast unlock failed, cr: 0x%08" PRIx32 "\n", cr);
return -1;
return true;
}
return 0;
return false;
}
static int ch32f1_flash_lock(target *t)