From 82b90281e97ac67a3d0590e26f3661555c1d008c Mon Sep 17 00:00:00 2001 From: Mark Charlebois Date: Thu, 4 Jun 2015 16:39:01 -0700 Subject: [PATCH] Cleanup of copyright headers Signed-off-by: Mark Charlebois --- src/platforms/px4_log.h | 37 +++++++++--------- src/platforms/qurt/dspal/dspal_stub.c | 32 ++++++++++++++++ src/platforms/qurt/px4_layer/qurt_stubs.c | 32 ++++++++++++++++ src/platforms/qurt/px4_layer/work_lock.c | 38 +++++++++++++++++-- .../qurt/tests/muorb/muorb_test_example.h | 6 --- .../qurt/tests/muorb/muorb_test_main.cpp | 5 +-- .../tests/muorb/muorb_test_start_qurt.cpp | 3 +- 7 files changed, 122 insertions(+), 31 deletions(-) diff --git a/src/platforms/px4_log.h b/src/platforms/px4_log.h index 2adfd40f9f..0461689f2a 100644 --- a/src/platforms/px4_log.h +++ b/src/platforms/px4_log.h @@ -54,19 +54,22 @@ #include #include "HAP_farf.h" -//#define PX4_DEBUG(...) __px4_log_omit("DEBUG", __VA_ARGS__); -//#define PX4_DEBUG(...) __px4_log("DEBUG", __VA_ARGS__); -//#define PX4_INFO(...) __px4_log("INFO", __VA_ARGS__); -//#define PX4_WARN(...) __px4_log_verbose("WARN", __VA_ARGS__); -//#define PX4_ERR(...) __px4_log_verbose("ERROR", __VA_ARGS__); -#define PX4_DEBUG(...) FARF(HIGH, __VA_ARGS__); -#define PX4_INFO(...) FARF(HIGH, __VA_ARGS__); -#define PX4_WARN(...) FARF(HIGH, __VA_ARGS__); -#define PX4_ERR(...) FARF(HIGH, __VA_ARGS__); - -//#define PX4_INFO(...) __px4_log_omit("INFO", __VA_ARGS__); -//#define PX4_WARN(...) __px4_log_omit("WARN", __VA_ARGS__); -//#define PX4_ERR(...) __px4_log_omit("ERROR", __VA_ARGS__); +#define __FARF_omit(level, ...) { } +#define __FARF_log(level, ...) { \ + FARF("%-5s ", level);\ + FARF(__VA_ARGS__);\ + FARF("\n");\ +} +#define __FARF_log_verbose(level, ...) { \ + FARF("%-5s ", level);\ + FARF(__VA_ARGS__);\ + FARF(" (file %s line %d)\n", __FILE__, __LINE__);\ +} + +#define PX4_DEBUG(...) __FARF_omit(HIGH, __VA_ARGS__) +#define PX4_INFO(...) __FARF_log(HIGH, __VA_ARGS__) +#define PX4_WARN(...) __FARF_log_verbose(HIGH, __VA_ARGS__) +#define PX4_ERR(...) __FARF_log_verbose(HIGH, __VA_ARGS__) #elif defined(__PX4_LINUX) #include @@ -78,10 +81,10 @@ printf(" (file %s line %d)\n", __FILE__, __LINE__);\ } -#define PX4_DEBUG(...) __px4_log_omit("DEBUG", __VA_ARGS__); -#define PX4_INFO(...) __px4_log("INFO", __VA_ARGS__); -#define PX4_WARN(...) __px4_log_verbose("WARN", __VA_ARGS__); -#define PX4_ERR(...) __px4_log_verbose("ERROR", __VA_ARGS__); +#define PX4_DEBUG(...) __px4_log_omit("DEBUG", __VA_ARGS__) +#define PX4_INFO(...) __px4_log("INFO", __VA_ARGS__) +#define PX4_WARN(...) __px4_log_verbose("WARN", __VA_ARGS__) +#define PX4_ERR(...) __px4_log_verbose("ERROR", __VA_ARGS__) #elif defined(__PX4_ROS) diff --git a/src/platforms/qurt/dspal/dspal_stub.c b/src/platforms/qurt/dspal/dspal_stub.c index 311a352909..996a279d87 100644 --- a/src/platforms/qurt/dspal/dspal_stub.c +++ b/src/platforms/qurt/dspal/dspal_stub.c @@ -1,3 +1,35 @@ +/**************************************************************************** + * + * Copyright (C) 2015 Mark Charlebois. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name PX4 nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ #include #include diff --git a/src/platforms/qurt/px4_layer/qurt_stubs.c b/src/platforms/qurt/px4_layer/qurt_stubs.c index 67955e5121..05e84995d3 100644 --- a/src/platforms/qurt/px4_layer/qurt_stubs.c +++ b/src/platforms/qurt/px4_layer/qurt_stubs.c @@ -1,3 +1,35 @@ +/**************************************************************************** + * + * Copyright (C) 2015 Mark Charlebois. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name PX4 nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ //extern "C" { diff --git a/src/platforms/qurt/px4_layer/work_lock.c b/src/platforms/qurt/px4_layer/work_lock.c index b2ad307d7c..99464a6a12 100644 --- a/src/platforms/qurt/px4_layer/work_lock.c +++ b/src/platforms/qurt/px4_layer/work_lock.c @@ -1,4 +1,36 @@ -//#pragma once +/**************************************************************************** + * + * Copyright (C) 2015 Mark Charlebois. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name PX4 nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ +#include #include #include #include "work_lock.h" @@ -8,12 +40,12 @@ extern sem_t _work_lock[]; void work_lock(int id) { - //printf("work_lock %d\n", id); + //PX4_INFO("work_lock %d", id); sem_wait(&_work_lock[id]); } void work_unlock(int id) { - //printf("work_unlock %d\n", id); + //PX4_INFO("work_unlock %d", id); sem_post(&_work_lock[id]); } diff --git a/src/platforms/qurt/tests/muorb/muorb_test_example.h b/src/platforms/qurt/tests/muorb/muorb_test_example.h index d330233b37..304b8464e0 100644 --- a/src/platforms/qurt/tests/muorb/muorb_test_example.h +++ b/src/platforms/qurt/tests/muorb/muorb_test_example.h @@ -31,12 +31,6 @@ * ****************************************************************************/ -/** - * @file hello_example.h - * Example app for Linux - * - * @author Mark Charlebois - */ #pragma once #include diff --git a/src/platforms/qurt/tests/muorb/muorb_test_main.cpp b/src/platforms/qurt/tests/muorb/muorb_test_main.cpp index 5e3ad9bb22..2ded8976c6 100644 --- a/src/platforms/qurt/tests/muorb/muorb_test_main.cpp +++ b/src/platforms/qurt/tests/muorb/muorb_test_main.cpp @@ -32,8 +32,8 @@ ****************************************************************************/ /** - * @file hello_main.cpp - * Example for Linux + * @file muorb_test_main.cpp + * Test of Multi-uORB supoprt * * @author Mark Charlebois */ @@ -41,7 +41,6 @@ #include #include #include "muorb_test_example.h" -#include int PX4_MAIN(int argc, char **argv) { diff --git a/src/platforms/qurt/tests/muorb/muorb_test_start_qurt.cpp b/src/platforms/qurt/tests/muorb/muorb_test_start_qurt.cpp index 943605f531..f063806766 100644 --- a/src/platforms/qurt/tests/muorb/muorb_test_start_qurt.cpp +++ b/src/platforms/qurt/tests/muorb/muorb_test_start_qurt.cpp @@ -32,9 +32,8 @@ ****************************************************************************/ /** - * @file hello_start_linux.cpp + * @file muorb_test_start_qurt.cpp * - * @author Thomas Gubler * @author Mark Charlebois */ #include "muorb_test_example.h"