forked from Archive/PX4-Autopilot
Merge remote-tracking branch 'px4/beta' into beta_mavlink
This commit is contained in:
commit
32b9834c52
|
@ -35,3 +35,4 @@ mavlink/include/mavlink/v0.9/
|
||||||
/Documentation/doxygen*objdb*tmp
|
/Documentation/doxygen*objdb*tmp
|
||||||
.tags
|
.tags
|
||||||
.tags_sorted_by_file
|
.tags_sorted_by_file
|
||||||
|
.pydevproject
|
||||||
|
|
|
@ -16,4 +16,5 @@ astyle \
|
||||||
--ignore-exclude-errors-x \
|
--ignore-exclude-errors-x \
|
||||||
--lineend=linux \
|
--lineend=linux \
|
||||||
--exclude=EASTL \
|
--exclude=EASTL \
|
||||||
|
--add-brackets \
|
||||||
$*
|
$*
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
astyle \
|
|
||||||
--style=linux \
|
|
||||||
--indent=force-tab=8 \
|
|
||||||
--indent-cases \
|
|
||||||
--indent-preprocessor \
|
|
||||||
--break-blocks=all \
|
|
||||||
--pad-oper \
|
|
||||||
--pad-header \
|
|
||||||
--unpad-paren \
|
|
||||||
--keep-one-line-blocks \
|
|
||||||
--keep-one-line-statements \
|
|
||||||
--align-pointer=name \
|
|
||||||
--suffix=none \
|
|
||||||
--lineend=linux \
|
|
||||||
$*
|
|
||||||
#--ignore-exclude-errors-x \
|
|
||||||
#--exclude=EASTL \
|
|
||||||
#--align-reference=name \
|
|
|
@ -1,7 +1,6 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2013, 2014 PX4 Development Team. All rights reserved.
|
||||||
* Author: Anton Babushkin <anton.babushkin@me.com>
|
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2014 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2012-2014 PX4 Development Team. All rights reserved.
|
||||||
* Author: Lorenz Meier <lm@inf.ethz.ch>
|
|
||||||
* Anton Babushkin <anton.babushkin@me.com>
|
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
|
@ -451,6 +449,7 @@ static void *logwriter_thread(void *arg)
|
||||||
n = available;
|
n = available;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lseek(log_fd, 0, SEEK_CUR);
|
||||||
n = write(log_fd, read_ptr, n);
|
n = write(log_fd, read_ptr, n);
|
||||||
|
|
||||||
should_wait = (n == available) && !is_part;
|
should_wait = (n == available) && !is_part;
|
||||||
|
|
|
@ -141,8 +141,8 @@ test_mount(int argc, char *argv[])
|
||||||
/* announce mode switch */
|
/* announce mode switch */
|
||||||
if (it_left_fsync_prev != it_left_fsync && it_left_fsync == 0) {
|
if (it_left_fsync_prev != it_left_fsync && it_left_fsync == 0) {
|
||||||
warnx("\n SUCCESSFULLY PASSED FSYNC'ED WRITES, CONTINUTING WITHOUT FSYNC");
|
warnx("\n SUCCESSFULLY PASSED FSYNC'ED WRITES, CONTINUTING WITHOUT FSYNC");
|
||||||
fsync(stdout);
|
fsync(fileno(stdout));
|
||||||
fsync(stderr);
|
fsync(fileno(stderr));
|
||||||
usleep(20000);
|
usleep(20000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ test_mount(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
char buf[64];
|
char buf[64];
|
||||||
int wret = sprintf(buf, "TEST: %d %d ", it_left_fsync, it_left_abort);
|
(void)sprintf(buf, "TEST: %d %d ", it_left_fsync, it_left_abort);
|
||||||
lseek(cmd_fd, 0, SEEK_SET);
|
lseek(cmd_fd, 0, SEEK_SET);
|
||||||
write(cmd_fd, buf, strlen(buf) + 1);
|
write(cmd_fd, buf, strlen(buf) + 1);
|
||||||
fsync(cmd_fd);
|
fsync(cmd_fd);
|
||||||
|
@ -174,8 +174,8 @@ test_mount(int argc, char *argv[])
|
||||||
|
|
||||||
printf("\n\n====== FILE TEST: %u bytes chunks (%s) ======\n", chunk_sizes[c], (it_left_fsync > 0) ? "FSYNC" : "NO FSYNC");
|
printf("\n\n====== FILE TEST: %u bytes chunks (%s) ======\n", chunk_sizes[c], (it_left_fsync > 0) ? "FSYNC" : "NO FSYNC");
|
||||||
printf("unpower the system immediately (within 0.5s) when the hash (#) sign appears\n");
|
printf("unpower the system immediately (within 0.5s) when the hash (#) sign appears\n");
|
||||||
fsync(stdout);
|
fsync(fileno(stdout));
|
||||||
fsync(stderr);
|
fsync(fileno(stderr));
|
||||||
usleep(50000);
|
usleep(50000);
|
||||||
|
|
||||||
for (unsigned a = 0; a < alignments; a++) {
|
for (unsigned a = 0; a < alignments; a++) {
|
||||||
|
@ -185,22 +185,20 @@ test_mount(int argc, char *argv[])
|
||||||
uint8_t write_buf[chunk_sizes[c] + alignments] __attribute__((aligned(64)));
|
uint8_t write_buf[chunk_sizes[c] + alignments] __attribute__((aligned(64)));
|
||||||
|
|
||||||
/* fill write buffer with known values */
|
/* fill write buffer with known values */
|
||||||
for (int i = 0; i < sizeof(write_buf); i++) {
|
for (unsigned i = 0; i < sizeof(write_buf); i++) {
|
||||||
/* this will wrap, but we just need a known value with spacing */
|
/* this will wrap, but we just need a known value with spacing */
|
||||||
write_buf[i] = i+11;
|
write_buf[i] = i+11;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t read_buf[chunk_sizes[c] + alignments] __attribute__((aligned(64)));
|
uint8_t read_buf[chunk_sizes[c] + alignments] __attribute__((aligned(64)));
|
||||||
hrt_abstime start, end;
|
|
||||||
|
|
||||||
int fd = open("/fs/microsd/testfile", O_TRUNC | O_WRONLY | O_CREAT);
|
int fd = open("/fs/microsd/testfile", O_TRUNC | O_WRONLY | O_CREAT);
|
||||||
|
|
||||||
start = hrt_absolute_time();
|
|
||||||
for (unsigned i = 0; i < iterations; i++) {
|
for (unsigned i = 0; i < iterations; i++) {
|
||||||
|
|
||||||
int wret = write(fd, write_buf + a, chunk_sizes[c]);
|
int wret = write(fd, write_buf + a, chunk_sizes[c]);
|
||||||
|
|
||||||
if (wret != chunk_sizes[c]) {
|
if (wret != (int)chunk_sizes[c]) {
|
||||||
warn("WRITE ERROR!");
|
warn("WRITE ERROR!");
|
||||||
|
|
||||||
if ((0x3 & (uintptr_t)(write_buf + a)))
|
if ((0x3 & (uintptr_t)(write_buf + a)))
|
||||||
|
@ -214,8 +212,8 @@ test_mount(int argc, char *argv[])
|
||||||
fsync(fd);
|
fsync(fd);
|
||||||
} else {
|
} else {
|
||||||
printf("#");
|
printf("#");
|
||||||
fsync(stdout);
|
fsync(fileno(stdout));
|
||||||
fsync(stderr);
|
fsync(fileno(stderr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,12 +222,10 @@ test_mount(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(".");
|
printf(".");
|
||||||
fsync(stdout);
|
fsync(fileno(stdout));
|
||||||
fsync(stderr);
|
fsync(fileno(stderr));
|
||||||
usleep(200000);
|
usleep(200000);
|
||||||
|
|
||||||
end = hrt_absolute_time();
|
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
fd = open("/fs/microsd/testfile", O_RDONLY);
|
fd = open("/fs/microsd/testfile", O_RDONLY);
|
||||||
|
|
||||||
|
@ -237,7 +233,7 @@ test_mount(int argc, char *argv[])
|
||||||
for (unsigned i = 0; i < iterations; i++) {
|
for (unsigned i = 0; i < iterations; i++) {
|
||||||
int rret = read(fd, read_buf, chunk_sizes[c]);
|
int rret = read(fd, read_buf, chunk_sizes[c]);
|
||||||
|
|
||||||
if (rret != chunk_sizes[c]) {
|
if (rret != (int)chunk_sizes[c]) {
|
||||||
warnx("READ ERROR!");
|
warnx("READ ERROR!");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -245,7 +241,7 @@ test_mount(int argc, char *argv[])
|
||||||
/* compare value */
|
/* compare value */
|
||||||
bool compare_ok = true;
|
bool compare_ok = true;
|
||||||
|
|
||||||
for (int j = 0; j < chunk_sizes[c]; j++) {
|
for (unsigned j = 0; j < chunk_sizes[c]; j++) {
|
||||||
if (read_buf[j] != write_buf[j + a]) {
|
if (read_buf[j] != write_buf[j + a]) {
|
||||||
warnx("COMPARISON ERROR: byte %d, align shift: %d", j, a);
|
warnx("COMPARISON ERROR: byte %d, align shift: %d", j, a);
|
||||||
compare_ok = false;
|
compare_ok = false;
|
||||||
|
@ -271,16 +267,16 @@ test_mount(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fsync(stdout);
|
fsync(fileno(stdout));
|
||||||
fsync(stderr);
|
fsync(fileno(stderr));
|
||||||
usleep(20000);
|
usleep(20000);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* we always reboot for the next test if we get here */
|
/* we always reboot for the next test if we get here */
|
||||||
warnx("Iteration done, rebooting..");
|
warnx("Iteration done, rebooting..");
|
||||||
fsync(stdout);
|
fsync(fileno(stdout));
|
||||||
fsync(stderr);
|
fsync(fileno(stderr));
|
||||||
usleep(50000);
|
usleep(50000);
|
||||||
systemreset(false);
|
systemreset(false);
|
||||||
|
|
||||||
|
|
|
@ -233,8 +233,8 @@ top_main(void)
|
||||||
system_load.tasks[i].tcb->pid,
|
system_load.tasks[i].tcb->pid,
|
||||||
CONFIG_TASK_NAME_SIZE, system_load.tasks[i].tcb->name,
|
CONFIG_TASK_NAME_SIZE, system_load.tasks[i].tcb->name,
|
||||||
(system_load.tasks[i].total_runtime / 1000),
|
(system_load.tasks[i].total_runtime / 1000),
|
||||||
(int)(curr_loads[i] * 100),
|
(int)(curr_loads[i] * 100.0f),
|
||||||
(int)(curr_loads[i] * 100000.0f - (int)(curr_loads[i] * 1000.0f) * 100),
|
(int)((curr_loads[i] * 100.0f - (int)(curr_loads[i] * 100.0f)) * 1000),
|
||||||
stack_size - stack_free,
|
stack_size - stack_free,
|
||||||
stack_size,
|
stack_size,
|
||||||
system_load.tasks[i].tcb->sched_priority,
|
system_load.tasks[i].tcb->sched_priority,
|
||||||
|
|
Loading…
Reference in New Issue