From f548473f28023cc2565c6b11e27f463693a8dadd Mon Sep 17 00:00:00 2001 From: dragonmux Date: Sat, 30 Jul 2022 10:00:48 +0100 Subject: [PATCH] ch32f1: Fixed the return type for ch32f1_flash_unlock --- src/target/ch32f1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/target/ch32f1.c b/src/target/ch32f1.c index 1fa1918..d8c70ce 100644 --- a/src/target/ch32f1.c +++ b/src/target/ch32f1.c @@ -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)