add eeprom_busy_wait() to some routines; better safe than sorry
This commit is contained in:
parent
7d0022a22d
commit
d5d58f8c0d
|
@ -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]);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue