aboutsummaryrefslogtreecommitdiff
path: root/src/systemcmds
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-10-10 08:42:54 +0200
committerLorenz Meier <lm@inf.ethz.ch>2013-10-10 08:42:54 +0200
commit6745a910718b2a5fed313187f77a04de383aa8f7 (patch)
treefe7635e764ec518e9f42f7a0a573eb8c176b496a /src/systemcmds
parent6ffa2955b919a18abd94dd990c3447dfc68dd5c2 (diff)
downloadpx4-firmware-6745a910718b2a5fed313187f77a04de383aa8f7.tar.gz
px4-firmware-6745a910718b2a5fed313187f77a04de383aa8f7.tar.bz2
px4-firmware-6745a910718b2a5fed313187f77a04de383aa8f7.zip
Added alignment attribute
Diffstat (limited to 'src/systemcmds')
-rw-r--r--src/systemcmds/tests/tests_file.c8
1 files changed, 4 insertions, 4 deletions
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)*/);
}