Skip to content

Commit

Permalink
Change wait method after identify
Browse files Browse the repository at this point in the history
  • Loading branch information
metroid-maniac committed Apr 17, 2023
1 parent a3b17ec commit 0763aeb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions payload.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,14 +416,12 @@ __attribute__((target("arm"))) void flush_sram_ram(unsigned sa, unsigned save_si
}

identified:
// wait 1 or 2 frames
while (*(volatile unsigned short*) 0x04000006)
{}
while (*(volatile unsigned short*) 0x04000006)
{}

if (flash_type == 0) return;

for (volatile int i = 0; i < 128; ++i)
__asm("nop");

if (flash_type == 1) {
// Erase flash sector
_FLASH_WRITE(sa, 0xFF);
Expand Down

0 comments on commit 0763aeb

Please sign in to comment.