diff --git a/src/games/tetris/highscore.c b/src/games/tetris/highscore.c index c915644..f073638 100644 --- a/src/games/tetris/highscore.c +++ b/src/games/tetris/highscore.c @@ -109,6 +109,7 @@ uint16_t tetris_highscore_inputName(void) uint16_t tetris_highscore_retrieveHighScore(tetris_highscore_index_t nIndex) { + eeprom_busy_wait(); uint16_t nHighScore = eeprom_read_word(&g_highScoreTable.nHighScore[nIndex]); diff --git a/src/games/tetris/highscore.h b/src/games/tetris/highscore.h index 3a89285..4a794cf 100644 --- a/src/games/tetris/highscore.h +++ b/src/games/tetris/highscore.h @@ -78,6 +78,7 @@ void tetris_highscore_saveHighScore(tetris_highscore_index_t nIndex, { if (nHighScore > tetris_highscore_retrieveHighScore(nIndex)) { + eeprom_busy_wait(); eeprom_write_word(&g_highScoreTable.nHighScore[nIndex], nHighScore); } } @@ -91,6 +92,7 @@ void tetris_highscore_saveHighScore(tetris_highscore_index_t nIndex, inline static uint16_t tetris_highscore_retrieveHighScoreName(tetris_highscore_index_t nIdx) { + eeprom_busy_wait(); uint16_t nHighScoreName = eeprom_read_word(&g_highScoreTable.nHighScoreName[nIdx]); @@ -107,6 +109,7 @@ inline static void tetris_highscore_saveHighScoreName(tetris_highscore_index_t nIndex, uint16_t nHighscoreName) { + eeprom_busy_wait(); eeprom_write_word(&g_highScoreTable.nHighScoreName[nIndex], nHighscoreName); } diff --git a/src/uart/uart_commands.c b/src/uart/uart_commands.c index f898b50..99e9797 100644 --- a/src/uart/uart_commands.c +++ b/src/uart/uart_commands.c @@ -97,6 +97,7 @@ static void uartcmd_erase_eeprom(void) { {0xFF, 0xFF}; # endif for (void *ee = 0; ee < (void *)E2END; ee += E2PAGESIZE) { + eeprom_busy_wait(); eeprom_update_block(eeclear, ee, E2PAGESIZE); } #else