From 6745a910718b2a5fed313187f77a04de383aa8f7 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 10 Oct 2013 08:42:54 +0200 Subject: Added alignment attribute --- src/systemcmds/tests/tests_file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/systemcmds') diff --git a/src/systemcmds/tests/tests_file.c b/src/systemcmds/tests/tests_file.c index 14532e48c..3c0c48cfe 100644 --- a/src/systemcmds/tests/tests_file.c +++ b/src/systemcmds/tests/tests_file.c @@ -63,7 +63,7 @@ test_file(int argc, char *argv[]) return 1; } - uint8_t write_buf[512 + 64]; + uint8_t write_buf[512 + 64] __attribute__((aligned(64))); /* fill write buffer with known values */ for (int i = 0; i < sizeof(write_buf); i++) { @@ -71,7 +71,7 @@ test_file(int argc, char *argv[]) write_buf[i] = i+11; } - uint8_t read_buf[512 + 64]; + uint8_t read_buf[512 + 64] __attribute__((aligned(64))); hrt_abstime start, end; perf_counter_t wperf = perf_alloc(PC_ELAPSED, "SD writes (aligned)"); @@ -87,8 +87,8 @@ test_file(int argc, char *argv[]) if (wret != 512) { warn("WRITE ERROR!"); - if ((0x3 & (uintptr_t)(write_buf + (i % 64)))) - warnx("memory is unaligned, align shift: %d", (i % 64)); + if ((0x3 & (uintptr_t)(write_buf + 1 /* (i % 64)*/))) + warnx("memory is unaligned, align shift: %d", 1/*(i % 64)*/); } -- cgit v1.2.3