1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00

prodtest: fix calls to sdcard functions

This commit is contained in:
Pavol Rusnak 2017-10-29 17:51:16 +01:00
parent 6738796d8b
commit 30ddb53c11
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -197,8 +197,8 @@ static void test_pwm(const char *args)
static void test_sd(void) static void test_sd(void)
{ {
#define BLOCK_SIZE (32 * 1024) #define BLOCK_SIZE (32 * 1024)
static uint8_t buf1[BLOCK_SIZE]; static uint32_t buf1[BLOCK_SIZE / sizeof(uint32_t)];
static uint8_t buf2[BLOCK_SIZE]; static uint32_t buf2[BLOCK_SIZE / sizeof(uint32_t)];
if (sectrue != sdcard_is_present()) { if (sectrue != sdcard_is_present()) {
vcp_printf("ERROR NOCARD"); vcp_printf("ERROR NOCARD");
@ -211,8 +211,8 @@ static void test_sd(void)
goto power_off; goto power_off;
} }
for (int j = 1; j <= 2; j++) { for (int j = 1; j <= 2; j++) {
for (int i = 0; i < BLOCK_SIZE; i++) { for (int i = 0; i < BLOCK_SIZE / sizeof(uint32_t); i++) {
buf1[i] ^= 0xFF; buf1[i] ^= 0xFFFFFFFF;
} }
if (sectrue != sdcard_write_blocks(buf1, 0, BLOCK_SIZE / SDCARD_BLOCK_SIZE)) { if (sectrue != sdcard_write_blocks(buf1, 0, BLOCK_SIZE / SDCARD_BLOCK_SIZE)) {
vcp_printf("ERROR sdcard_write_blocks (%d)", j); vcp_printf("ERROR sdcard_write_blocks (%d)", j);