From e4480a171472d84247bf766ef809ec89303d1711 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Fri, 22 Dec 2023 21:13:00 +0000 Subject: [PATCH] Use libdragon function for sleep --- src/flashcart/ed64/ed64_ll.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/flashcart/ed64/ed64_ll.c b/src/flashcart/ed64/ed64_ll.c index faea332d..9e9f76d6 100644 --- a/src/flashcart/ed64/ed64_ll.c +++ b/src/flashcart/ed64/ed64_ll.c @@ -3,16 +3,6 @@ #include "utils/utils.h" #include "ed64_ll.h" -//FIXME find a better solution, perferably a libdragon one -void sleep (unsigned long ms); - -void sleep (unsigned long ms) { - - unsigned long current_ms = get_ticks_ms(); - - while (get_ticks_ms() - current_ms < ms); - -} /* ED64 configuration registers base address */ #define ED64_CONFIG_REGS_BASE (0xA8040000) @@ -221,7 +211,7 @@ void ed64_ll_get_sram (uint8_t *buffer, int size) { pi_initialize(); - sleep(250); + wait_ms(250); // checks if the save isnt large and if so grabs it from the large save area if(size == KiB(32)) @@ -252,14 +242,14 @@ void ed64_ll_get_eeprom (uint8_t *buffer, int size) { void ed64_ll_get_fram (uint8_t *buffer, int size) { ed64_ll_set_save_type(SAVE_TYPE_SRAM_128K); //2 - sleep(512); + wait_ms(512); data_cache_hit_writeback_invalidate(buffer,size); dma_wait(); ed64_ll_get_sram(buffer, size); - sleep(512); + wait_ms(512); ed64_ll_set_save_type(SAVE_TYPE_FLASHRAM); } @@ -313,14 +303,14 @@ void ed64_ll_set_eeprom (uint8_t *buffer, int size) { void ed64_ll_set_fram (uint8_t *buffer, int size) { ed64_ll_set_save_type(SAVE_TYPE_SRAM_128K); - sleep(512); + wait_ms(512); data_cache_hit_writeback_invalidate(buffer,size); dma_wait(); ed64_ll_set_sram(buffer, size); - sleep(512); + wait_ms(512); ed64_ll_set_save_type(SAVE_TYPE_FLASHRAM); }