From 1ca1be04478561a362ab5a8005e7b6bb512146e8 Mon Sep 17 00:00:00 2001 From: MCUdude Date: Thu, 6 Oct 2022 20:59:32 +0200 Subject: [PATCH] Use avr_mem_is_flash_type() instead of checking m->desc directly --- src/jtag3.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/jtag3.c b/src/jtag3.c index ce9fbe36..112701f6 100644 --- a/src/jtag3.c +++ b/src/jtag3.c @@ -1700,7 +1700,7 @@ static int jtag3_page_erase(const PROGRAMMER *pgm, const AVRPART *p, const AVRME cmd[1] = CMD3_ERASE_MEMORY; cmd[2] = 0; - if (strcmp(m->desc, "flash") == 0) { + if (avr_mem_is_flash_type(m)) { if (p->prog_modes & PM_UPDI || jtag3_memtype(pgm, p, addr) == MTYPE_FLASH) cmd[3] = XMEGA_ERASE_APP_PAGE; else @@ -1710,8 +1710,6 @@ static int jtag3_page_erase(const PROGRAMMER *pgm, const AVRPART *p, const AVRME } else if (strcmp(m->desc, "usersig") == 0 || strcmp(m->desc, "userrow") == 0) { cmd[3] = XMEGA_ERASE_USERSIG; - } else if (strcmp(m->desc, "boot") == 0) { - cmd[3] = XMEGA_ERASE_BOOT_PAGE; } else { cmd[3] = XMEGA_ERASE_APP_PAGE; }