Skip to content

Commit dc20bfd

Browse files
committed
RP2040: FLASH: don't increment exponentially on program()
1 parent 17f9f98 commit dc20bfd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

targets/TARGET_RASPBERRYPI/TARGET_RP2040/flash_api.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,12 @@ int32_t flash_program_page(flash_t *obj, uint32_t address, const uint8_t *data,
7777
for (int i = 0; i < FLASH_PAGE_SIZE; i++) {
7878
buf[i] = data[j*FLASH_PAGE_SIZE + i];
7979
}
80-
address = address + j*FLASH_PAGE_SIZE;
8180
core_util_critical_section_enter();
8281
flash_range_program(address, buf, FLASH_PAGE_SIZE);
8382
core_util_critical_section_exit();
83+
address = address + FLASH_PAGE_SIZE;
8484
}
8585

86-
8786
return 0;
8887

8988
}

0 commit comments

Comments
 (0)