37
37
#include "supervisor/port.h"
38
38
#include "supervisor/shared/translate.h"
39
39
40
+ #include "peripherals/broadcom/cpu.h"
40
41
#include "peripherals/broadcom/defines.h"
41
42
#include "peripherals/broadcom/gpio.h"
42
43
@@ -256,6 +257,8 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self,
256
257
GPIO -> EXTRA_MUX_b .SDIO = GPIO_EXTRA_MUX_SDIO_ARASAN ;
257
258
}
258
259
260
+ COMPLETE_MEMORY_READS ;
261
+
259
262
self -> host_info = (sdmmc_host_t ) {
260
263
.flags = SDMMC_HOST_FLAG_1BIT | SDMMC_HOST_FLAG_4BIT | SDMMC_HOST_FLAG_DEINIT_ARG ,
261
264
.slot = 0 ,
@@ -301,6 +304,7 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self,
301
304
self -> init = err == SDMMC_OK ;
302
305
303
306
self -> capacity = self -> card_info .csd .capacity ;
307
+ COMPLETE_MEMORY_READS ;
304
308
}
305
309
306
310
uint32_t common_hal_sdioio_sdcard_get_count (sdioio_sdcard_obj_t * self ) {
@@ -328,9 +332,10 @@ int common_hal_sdioio_sdcard_writeblocks(sdioio_sdcard_obj_t *self, uint32_t sta
328
332
check_whole_block (bufinfo );
329
333
self -> state_programming = true;
330
334
335
+ COMPLETE_MEMORY_READS ;
331
336
sdmmc_err_t error = sdmmc_write_sectors (& self -> card_info , bufinfo -> buf ,
332
337
start_block , bufinfo -> len / 512 );
333
-
338
+ COMPLETE_MEMORY_READS ;
334
339
335
340
if (error != SDMMC_OK ) {
336
341
mp_printf (& mp_plat_print , "write sectors result %d\n" , error );
@@ -345,8 +350,10 @@ int common_hal_sdioio_sdcard_readblocks(sdioio_sdcard_obj_t *self, uint32_t star
345
350
return - EIO ;
346
351
}
347
352
check_whole_block (bufinfo );
353
+ COMPLETE_MEMORY_READS ;
348
354
sdmmc_err_t error = sdmmc_read_sectors (& self -> card_info , bufinfo -> buf ,
349
355
start_block , bufinfo -> len / 512 );
356
+ COMPLETE_MEMORY_READS ;
350
357
351
358
if (error != SDMMC_OK ) {
352
359
mp_printf (& mp_plat_print , "read sectors result %d when reading block %d for %d\n" , error , start_block , bufinfo -> len / 512 );
0 commit comments