diff --git a/cmake/configs/nuttx_aerocore2_default.cmake b/cmake/configs/nuttx_aerocore2_default.cmake index 713b57e3fd..746df2dabe 100644 --- a/cmake/configs/nuttx_aerocore2_default.cmake +++ b/cmake/configs/nuttx_aerocore2_default.cmake @@ -149,10 +149,6 @@ set(config_module_list # https://px4.io/dev/px4_simple_app #examples/px4_simple_app - # Tutorial code from - # https://px4.io/dev/daemon - #examples/px4_daemon_app - # Tutorial code from # https://px4.io/dev/debug_values #examples/px4_mavlink_debug diff --git a/cmake/configs/nuttx_auav-x21_default.cmake b/cmake/configs/nuttx_auav-x21_default.cmake index 004a368547..9e22ec4448 100644 --- a/cmake/configs/nuttx_auav-x21_default.cmake +++ b/cmake/configs/nuttx_auav-x21_default.cmake @@ -159,10 +159,6 @@ set(config_module_list # https://px4.io/dev/px4_simple_app #examples/px4_simple_app - # Tutorial code from - # https://px4.io/dev/daemon - #examples/px4_daemon_app - # Tutorial code from # https://px4.io/dev/debug_values #examples/px4_mavlink_debug diff --git a/cmake/configs/nuttx_crazyflie_default.cmake b/cmake/configs/nuttx_crazyflie_default.cmake index e89dc07b26..8da7b1cb2a 100644 --- a/cmake/configs/nuttx_crazyflie_default.cmake +++ b/cmake/configs/nuttx_crazyflie_default.cmake @@ -117,10 +117,6 @@ set(config_module_list # https://px4.io/dev/px4_simple_app #examples/px4_simple_app - # Tutorial code from - # https://px4.io/dev/daemon - #examples/px4_daemon_app - # Tutorial code from # https://px4.io/dev/debug_values #examples/px4_mavlink_debug diff --git a/cmake/configs/nuttx_mindpx-v2_default.cmake b/cmake/configs/nuttx_mindpx-v2_default.cmake index e7cc117a7a..968893831e 100644 --- a/cmake/configs/nuttx_mindpx-v2_default.cmake +++ b/cmake/configs/nuttx_mindpx-v2_default.cmake @@ -163,10 +163,6 @@ set(config_module_list # https://px4.io/dev/px4_simple_app #examples/px4_simple_app - # Tutorial code from - # https://px4.io/dev/daemon - #examples/px4_daemon_app - # Tutorial code from # https://px4.io/dev/debug_values #examples/px4_mavlink_debug diff --git a/cmake/configs/nuttx_nxphlite-v3_default.cmake b/cmake/configs/nuttx_nxphlite-v3_default.cmake index 24923782bd..20db5d34dc 100644 --- a/cmake/configs/nuttx_nxphlite-v3_default.cmake +++ b/cmake/configs/nuttx_nxphlite-v3_default.cmake @@ -178,10 +178,6 @@ set(config_module_list # https://px4.io/dev/px4_simple_app examples/px4_simple_app - # Tutorial code from - # https://px4.io/dev/daemon - examples/px4_daemon_app - # Tutorial code from # https://px4.io/dev/debug_values examples/px4_mavlink_debug @@ -192,4 +188,4 @@ set(config_module_list # Hardware test examples/hwtest -) \ No newline at end of file +) diff --git a/cmake/configs/nuttx_px4-same70xplained-v1_default.cmake b/cmake/configs/nuttx_px4-same70xplained-v1_default.cmake index fb2e5f47c3..cffc6fb7d3 100644 --- a/cmake/configs/nuttx_px4-same70xplained-v1_default.cmake +++ b/cmake/configs/nuttx_px4-same70xplained-v1_default.cmake @@ -143,10 +143,6 @@ set(config_module_list # https://px4.io/dev/px4_simple_app #examples/px4_simple_app - # Tutorial code from - # https://px4.io/dev/daemon - #examples/px4_daemon_app - # Tutorial code from # https://px4.io/dev/debug_values #examples/px4_mavlink_debug diff --git a/cmake/configs/nuttx_px4-stm32f4discovery_default.cmake b/cmake/configs/nuttx_px4-stm32f4discovery_default.cmake index d91cb850b6..fa45a6d0bb 100644 --- a/cmake/configs/nuttx_px4-stm32f4discovery_default.cmake +++ b/cmake/configs/nuttx_px4-stm32f4discovery_default.cmake @@ -57,10 +57,6 @@ set(config_module_list # https://px4.io/dev/px4_simple_app examples/px4_simple_app - # Tutorial code from - # https://px4.io/dev/daemon - #examples/px4_daemon_app - # Tutorial code from # https://px4.io/dev/debug_values #examples/px4_mavlink_debug @@ -71,4 +67,4 @@ set(config_module_list # Hardware test #examples/hwtest -) \ No newline at end of file +) diff --git a/cmake/configs/nuttx_px4fmu-v2_default.cmake b/cmake/configs/nuttx_px4fmu-v2_default.cmake index 1da670cd32..7e0e16b8b0 100644 --- a/cmake/configs/nuttx_px4fmu-v2_default.cmake +++ b/cmake/configs/nuttx_px4fmu-v2_default.cmake @@ -182,10 +182,6 @@ set(config_module_list # https://px4.io/dev/px4_simple_app #examples/px4_simple_app - # Tutorial code from - # https://px4.io/dev/daemon - #examples/px4_daemon_app - # Tutorial code from # https://px4.io/dev/debug_values #examples/px4_mavlink_debug diff --git a/cmake/configs/nuttx_px4fmu-v2_test.cmake b/cmake/configs/nuttx_px4fmu-v2_test.cmake index 9308f27a21..e521f148b0 100644 --- a/cmake/configs/nuttx_px4fmu-v2_test.cmake +++ b/cmake/configs/nuttx_px4fmu-v2_test.cmake @@ -161,10 +161,6 @@ set(config_module_list # https://px4.io/dev/px4_simple_app #examples/px4_simple_app - # Tutorial code from - # https://px4.io/dev/daemon - #examples/px4_daemon_app - # Tutorial code from # https://px4.io/dev/debug_values #examples/px4_mavlink_debug diff --git a/cmake/configs/nuttx_px4fmu-v3_default.cmake b/cmake/configs/nuttx_px4fmu-v3_default.cmake index 24528b31b7..69aad5636a 100644 --- a/cmake/configs/nuttx_px4fmu-v3_default.cmake +++ b/cmake/configs/nuttx_px4fmu-v3_default.cmake @@ -183,10 +183,6 @@ set(config_module_list # https://px4.io/dev/px4_simple_app examples/px4_simple_app - # Tutorial code from - # https://px4.io/dev/daemon - examples/px4_daemon_app - # Tutorial code from # https://px4.io/dev/debug_values examples/px4_mavlink_debug diff --git a/cmake/configs/nuttx_px4fmu-v4_default.cmake b/cmake/configs/nuttx_px4fmu-v4_default.cmake index cb21ed34e0..bb0fbade46 100644 --- a/cmake/configs/nuttx_px4fmu-v4_default.cmake +++ b/cmake/configs/nuttx_px4fmu-v4_default.cmake @@ -176,10 +176,6 @@ set(config_module_list # https://px4.io/dev/px4_simple_app examples/px4_simple_app - # Tutorial code from - # https://px4.io/dev/daemon - examples/px4_daemon_app - # Tutorial code from # https://px4.io/dev/debug_values examples/px4_mavlink_debug @@ -190,4 +186,4 @@ set(config_module_list # Hardware test examples/hwtest -) \ No newline at end of file +) diff --git a/cmake/configs/nuttx_px4fmu-v4pro_default.cmake b/cmake/configs/nuttx_px4fmu-v4pro_default.cmake index 2356f2030f..8f25b67337 100644 --- a/cmake/configs/nuttx_px4fmu-v4pro_default.cmake +++ b/cmake/configs/nuttx_px4fmu-v4pro_default.cmake @@ -175,10 +175,6 @@ set(config_module_list # https://px4.io/dev/px4_simple_app #examples/px4_simple_app - # Tutorial code from - # https://px4.io/dev/daemon - #examples/px4_daemon_app - # Tutorial code from # https://px4.io/dev/debug_values #examples/px4_mavlink_debug @@ -189,4 +185,4 @@ set(config_module_list # Hardware test #examples/hwtest -) \ No newline at end of file +) diff --git a/cmake/configs/nuttx_px4fmu-v5_default.cmake b/cmake/configs/nuttx_px4fmu-v5_default.cmake index 14d7b57728..bd618f0ad6 100644 --- a/cmake/configs/nuttx_px4fmu-v5_default.cmake +++ b/cmake/configs/nuttx_px4fmu-v5_default.cmake @@ -176,10 +176,6 @@ set(config_module_list # https://px4.io/dev/px4_simple_app #examples/px4_simple_app - # Tutorial code from - # https://px4.io/dev/daemon - #examples/px4_daemon_app - # Tutorial code from # https://px4.io/dev/debug_values #examples/px4_mavlink_debug @@ -190,4 +186,4 @@ set(config_module_list # Hardware test #examples/hwtest -) \ No newline at end of file +) diff --git a/cmake/configs/nuttx_px4nucleoF767ZI-v1_default.cmake b/cmake/configs/nuttx_px4nucleoF767ZI-v1_default.cmake index 2baf46879f..74af0c819b 100644 --- a/cmake/configs/nuttx_px4nucleoF767ZI-v1_default.cmake +++ b/cmake/configs/nuttx_px4nucleoF767ZI-v1_default.cmake @@ -148,10 +148,6 @@ set(config_module_list # https://px4.io/dev/px4_simple_app examples/px4_simple_app - # Tutorial code from - # https://px4.io/dev/daemon - #examples/px4_daemon_app - # Tutorial code from # https://px4.io/dev/debug_values #examples/px4_mavlink_debug diff --git a/cmake/configs/posix_sitl_default.cmake b/cmake/configs/posix_sitl_default.cmake index 4137f23a8c..710a4c9f17 100644 --- a/cmake/configs/posix_sitl_default.cmake +++ b/cmake/configs/posix_sitl_default.cmake @@ -168,10 +168,6 @@ set(config_module_list # https://px4.io/dev/px4_simple_app examples/px4_simple_app - # Tutorial code from - # https://px4.io/dev/daemon - examples/px4_daemon_app - # Tutorial code from # https://px4.io/dev/debug_values examples/px4_mavlink_debug diff --git a/src/examples/px4_daemon_app/CMakeLists.txt b/src/examples/px4_daemon_app/CMakeLists.txt deleted file mode 100644 index 25308396cf..0000000000 --- a/src/examples/px4_daemon_app/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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 -# 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. -# -############################################################################ -px4_add_module( - MODULE examples__px4_daemon_app - MAIN px4_daemon_app - STACK_MAIN 1200 - SRCS - px4_daemon_app.c - DEPENDS - platforms__common - ) -# vim: set noet ft=cmake fenc=utf-8 ff=unix : diff --git a/src/examples/px4_daemon_app/px4_daemon_app.c b/src/examples/px4_daemon_app/px4_daemon_app.c deleted file mode 100644 index 625975ceaf..0000000000 --- a/src/examples/px4_daemon_app/px4_daemon_app.c +++ /dev/null @@ -1,151 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2015 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 - * 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. - * - ****************************************************************************/ - -/** - * @file px4_daemon_app.c - * daemon application example for PX4 autopilot - * - * @author Example User - */ - -#include -#include -#include -#include - -#include -#include - -#include -#include - -static bool thread_should_exit = false; /**< daemon exit flag */ -static bool thread_running = false; /**< daemon status flag */ -static int daemon_task; /**< Handle of daemon task / thread */ - -/** - * daemon management function. - */ -__EXPORT int px4_daemon_app_main(int argc, char *argv[]); - -/** - * Mainloop of daemon. - */ -int px4_daemon_thread_main(int argc, char *argv[]); - -/** - * Print the correct usage. - */ -static void usage(const char *reason); - -static void -usage(const char *reason) -{ - if (reason) { - warnx("%s\n", reason); - } - - warnx("usage: daemon {start|stop|status} [-p ]\n\n"); -} - -/** - * The daemon app only briefly exists to start - * the background job. The stack size assigned in the - * Makefile does only apply to this management task. - * - * The actual stack size should be set in the call - * to task_create(). - */ -int px4_daemon_app_main(int argc, char *argv[]) -{ - if (argc < 2) { - usage("missing command"); - return 1; - } - - if (!strcmp(argv[1], "start")) { - - if (thread_running) { - warnx("daemon already running\n"); - /* this is not an error */ - return 0; - } - - thread_should_exit = false; - daemon_task = px4_task_spawn_cmd("daemon", - SCHED_DEFAULT, - SCHED_PRIORITY_DEFAULT, - 2000, - px4_daemon_thread_main, - (argv) ? (char *const *)&argv[2] : (char *const *)NULL); - return 0; - } - - if (!strcmp(argv[1], "stop")) { - thread_should_exit = true; - return 0; - } - - if (!strcmp(argv[1], "status")) { - if (thread_running) { - warnx("\trunning\n"); - - } else { - warnx("\tnot started\n"); - } - - return 0; - } - - usage("unrecognized command"); - return 1; -} - -int px4_daemon_thread_main(int argc, char *argv[]) -{ - - warnx("[daemon] starting\n"); - - thread_running = true; - - while (!thread_should_exit) { - warnx("Hello daemon!\n"); - sleep(10); - } - - warnx("[daemon] exiting.\n"); - - thread_running = false; - - return 0; -}