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
|
||||
.tags
|
||||
.tags_sorted_by_file
|
||||
.pydevproject
|
||||
|
|
|
@ -16,4 +16,5 @@ astyle \
|
|||
--ignore-exclude-errors-x \
|
||||
--lineend=linux \
|
||||
--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.
|
||||
* Author: Anton Babushkin <anton.babushkin@me.com>
|
||||
* Copyright (c) 2013, 2014 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
/****************************************************************************
|
||||
*
|
||||
* 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
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -451,6 +449,7 @@ static void *logwriter_thread(void *arg)
|
|||
n = available;
|
||||
}
|
||||
|
||||
lseek(log_fd, 0, SEEK_CUR);
|
||||
n = write(log_fd, read_ptr, n);
|
||||
|
||||
should_wait = (n == available) && !is_part;
|
||||
|
|
|
@ -141,8 +141,8 @@ test_mount(int argc, char *argv[])
|
|||
/* announce mode switch */
|
||||
if (it_left_fsync_prev != it_left_fsync && it_left_fsync == 0) {
|
||||
warnx("\n SUCCESSFULLY PASSED FSYNC'ED WRITES, CONTINUTING WITHOUT FSYNC");
|
||||
fsync(stdout);
|
||||
fsync(stderr);
|
||||
fsync(fileno(stdout));
|
||||
fsync(fileno(stderr));
|
||||
usleep(20000);
|
||||
}
|
||||
|
||||
|
@ -162,7 +162,7 @@ test_mount(int argc, char *argv[])
|
|||
}
|
||||
|
||||
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);
|
||||
write(cmd_fd, buf, strlen(buf) + 1);
|
||||
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("unpower the system immediately (within 0.5s) when the hash (#) sign appears\n");
|
||||
fsync(stdout);
|
||||
fsync(stderr);
|
||||
fsync(fileno(stdout));
|
||||
fsync(fileno(stderr));
|
||||
usleep(50000);
|
||||
|
||||
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)));
|
||||
|
||||
/* 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 */
|
||||
write_buf[i] = i+11;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
start = hrt_absolute_time();
|
||||
for (unsigned i = 0; i < iterations; i++) {
|
||||
|
||||
int wret = write(fd, write_buf + a, chunk_sizes[c]);
|
||||
|
||||
if (wret != chunk_sizes[c]) {
|
||||
if (wret != (int)chunk_sizes[c]) {
|
||||
warn("WRITE ERROR!");
|
||||
|
||||
if ((0x3 & (uintptr_t)(write_buf + a)))
|
||||
|
@ -214,8 +212,8 @@ test_mount(int argc, char *argv[])
|
|||
fsync(fd);
|
||||
} else {
|
||||
printf("#");
|
||||
fsync(stdout);
|
||||
fsync(stderr);
|
||||
fsync(fileno(stdout));
|
||||
fsync(fileno(stderr));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -224,12 +222,10 @@ test_mount(int argc, char *argv[])
|
|||
}
|
||||
|
||||
printf(".");
|
||||
fsync(stdout);
|
||||
fsync(stderr);
|
||||
fsync(fileno(stdout));
|
||||
fsync(fileno(stderr));
|
||||
usleep(200000);
|
||||
|
||||
end = hrt_absolute_time();
|
||||
|
||||
close(fd);
|
||||
fd = open("/fs/microsd/testfile", O_RDONLY);
|
||||
|
||||
|
@ -237,7 +233,7 @@ test_mount(int argc, char *argv[])
|
|||
for (unsigned i = 0; i < iterations; i++) {
|
||||
int rret = read(fd, read_buf, chunk_sizes[c]);
|
||||
|
||||
if (rret != chunk_sizes[c]) {
|
||||
if (rret != (int)chunk_sizes[c]) {
|
||||
warnx("READ ERROR!");
|
||||
return 1;
|
||||
}
|
||||
|
@ -245,7 +241,7 @@ test_mount(int argc, char *argv[])
|
|||
/* compare value */
|
||||
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]) {
|
||||
warnx("COMPARISON ERROR: byte %d, align shift: %d", j, a);
|
||||
compare_ok = false;
|
||||
|
@ -271,16 +267,16 @@ test_mount(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
fsync(stdout);
|
||||
fsync(stderr);
|
||||
fsync(fileno(stdout));
|
||||
fsync(fileno(stderr));
|
||||
usleep(20000);
|
||||
|
||||
|
||||
|
||||
/* we always reboot for the next test if we get here */
|
||||
warnx("Iteration done, rebooting..");
|
||||
fsync(stdout);
|
||||
fsync(stderr);
|
||||
fsync(fileno(stdout));
|
||||
fsync(fileno(stderr));
|
||||
usleep(50000);
|
||||
systemreset(false);
|
||||
|
||||
|
|
|
@ -233,8 +233,8 @@ top_main(void)
|
|||
system_load.tasks[i].tcb->pid,
|
||||
CONFIG_TASK_NAME_SIZE, system_load.tasks[i].tcb->name,
|
||||
(system_load.tasks[i].total_runtime / 1000),
|
||||
(int)(curr_loads[i] * 100),
|
||||
(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 - (int)(curr_loads[i] * 100.0f)) * 1000),
|
||||
stack_size - stack_free,
|
||||
stack_size,
|
||||
system_load.tasks[i].tcb->sched_priority,
|
||||
|
|
Loading…
Reference in New Issue