Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit d3c37ac

Browse files
committed
use ID_PY32F07X
1 parent 0aa8edc commit d3c37ac

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/target/puya.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
#include "adiv5.h"
3939
#include "buffer_utils.h"
4040

41+
/* Chip IDs */
42+
#define ID_PY32F07X 0x06188061U
43+
4144
/* Flash */
4245
#define PUYA_FLASH_START 0x08000000U
4346
#define PUYA_00A_FLASH_PAGE_SIZE 128U
@@ -121,7 +124,7 @@ bool puya_probe(target_s *target)
121124
size_t flash_size = 0U;
122125

123126
const uint32_t dbg_idcode = target_mem32_read32(target, PUYA_DBG_IDCODE);
124-
if (dbg_idcode == 0x06188061U) {
127+
if (dbg_idcode == ID_PY32F07X) {
125128
const uint32_t flash_ram_sz = target_mem32_read32(target, PUYA_07X_FLASH_RAM_SZ);
126129
flash_size = (((flash_ram_sz >> PUYA_FLASH_SZ_SHIFT) & PUYA_FLASH_SZ_MASK) + 1) << PUYA_FLASH_UNIT_SHIFT;
127130
ram_size = (((flash_ram_sz >> PUYA_RAM_SZ_SHIFT) & PUYA_RAM_SZ_MASK) + 1) << PUYA_RAM_UNIT_SHIFT;
@@ -150,7 +153,7 @@ bool puya_probe(target_s *target)
150153
flash->length = flash_size;
151154
flash->erase = puya_flash_erase;
152155
flash->write = puya_flash_write;
153-
if (dbg_idcode == 0x06188061U) {
156+
if (dbg_idcode == ID_PY32F07X) {
154157
flash->blocksize = PUYA_07X_FLASH_PAGE_SIZE;
155158
flash->writesize = PUYA_07X_FLASH_PAGE_SIZE;
156159
flash->prepare = puya_07x_flash_prepare;

0 commit comments

Comments
 (0)