瀏覽代碼

Merge pull request #539 from FrankBoesing/patch-2

fix flash_wait(), fixes EEPROM write with -Os optimization
https://forum.pjrc.com/threads/66200
main
Paul Stoffregen 3 年之前
父節點
當前提交
61c47edbbd
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 2 行新增3 行删除
  1. +2
    -3
      teensy4/eeprom.c

+ 2
- 3
teensy4/eeprom.c 查看文件

@@ -231,10 +231,9 @@ static void flash_wait()
FLEXSPI_IPCR0 = 0;
FLEXSPI_IPCR1 = FLEXSPI_IPCR1_ISEQID(15) | FLEXSPI_IPCR1_IDATSZ(1);
FLEXSPI_IPCMD = FLEXSPI_IPCMD_TRG;
while (!(FLEXSPI_INTR & FLEXSPI_INTR_IPCMDDONE)) {
asm("nop");
}
while (!(FLEXSPI_INTR & FLEXSPI_INTR_IPCMDDONE)) {;}
FLEXSPI_INTR = FLEXSPI_INTR_IPCMDDONE;
asm("":::"memory");
status = *(uint8_t *)&FLEXSPI_RFDR0;
} while (status & 1);
FLEXSPI_MCR0 |= FLEXSPI_MCR0_SWRESET; // purge stale data from FlexSPI's AHB FIFO

Loading…
取消
儲存