px4_middleware: remove that header and move px4::init to px4_init.h

delete include:
for i in $(grep -rl 'px4_middleware.h' src platforms); do sed -i '/#include <px4_middleware.h/d' $i; done
This commit is contained in:
Beat Küng 2019-08-27 11:45:31 +02:00
parent f32abe8534
commit 43fdcd7876
24 changed files with 27 additions and 105 deletions

View File

@ -35,8 +35,8 @@
#include "wqueue_scheduled_test.h"
#include <px4_log.h>
#include <px4_middleware.h>
#include <px4_app.h>
#include <px4_init.h>
#include <stdio.h>
int PX4_MAIN(int argc, char **argv)

View File

@ -40,7 +40,6 @@
#include "wqueue_test.h"
#include <px4_log.h>
#include <px4_middleware.h>
#include <px4_app.h>
#include <stdio.h>

View File

@ -38,7 +38,6 @@
*/
#include <px4_defines.h>
#include <px4_middleware.h>
#include <drivers/drv_hrt.h>
namespace px4
@ -49,9 +48,4 @@ void init(int argc, char *argv[], const char *process_name)
printf("process: %s\n", process_name);
}
uint64_t get_time_micros()
{
return hrt_absolute_time();
}
}

View File

@ -64,14 +64,13 @@
#include <px4_time.h>
#include <px4_log.h>
#include <px4_init.h>
#include <px4_getopt.h>
#include <px4_tasks.h>
#include <px4_posix.h>
#include "apps.h"
#include "px4_middleware.h"
#include "DriverFramework.hpp"
#include "px4_middleware.h"
#include "px4_daemon/client.h"
#include "px4_daemon/server.h"
#include "px4_daemon/pxh.h"

View File

@ -38,7 +38,6 @@
*/
#include <px4_defines.h>
#include <px4_middleware.h>
#include <px4_workqueue.h>
#include <px4_defines.h>
#include <stdint.h>
@ -98,10 +97,5 @@ void init(int argc, char *argv[], const char *app_name)
#endif
}
uint64_t get_time_micros()
{
return hrt_absolute_time();
}
}

View File

@ -38,7 +38,6 @@
*/
#include <px4_defines.h>
#include <px4_middleware.h>
#include <px4_workqueue.h>
#include <px4_time.h>
#include <stdint.h>

View File

@ -38,10 +38,10 @@
* @author Julian Oes <julian@oes.ch>
*/
#include <px4_middleware.h>
#include <px4_tasks.h>
#include <px4_time.h>
#include <px4_posix.h>
#include <px4_init.h>
#include <px4_defines.h>
#include <dspal_platform.h>
#include <vector>

View File

@ -39,7 +39,6 @@
#include <px4_defines.h>
#include <px4_tasks.h>
#include <px4_middleware.h>
#include <px4_workqueue.h>
#include <dataman/dataman.h>
#include <stdint.h>

View File

@ -41,7 +41,6 @@
#include <drivers/drv_pwm_output.h>
#include <lib/mixer/mixer.h>
#include <perf/perf_counter.h>
#include <px4_common.h>
#include <px4_config.h>
#include <px4_module.h>
#include <px4_tasks.h>

View File

@ -43,7 +43,6 @@
#include <px4_log.h>
#include <px4_time.h>
#include <px4_posix.h>
#include <px4_middleware.h>
#include <px4_defines.h>
#include <dspal_platform.h>

View File

@ -38,9 +38,9 @@
* @author Nicolas de Palezieux <ndepal@gmail.com>
*/
#include <px4_middleware.h>
#include <px4_log.h>
#include <px4_app.h>
#include <px4_init.h>
#include "qshell.h"
extern "C" __EXPORT int qshell_entry(int argc, char **argv);

View File

@ -37,9 +37,9 @@
*
* @author Mark Charlebois <charlebm@gmail.com>
*/
#include <px4_middleware.h>
#include <px4_log.h>
#include <px4_app.h>
#include <px4_init.h>
#include "hello_example.h"
#include <stdio.h>

View File

@ -37,9 +37,9 @@
*
* @author Mark Charlebois <charlebm@gmail.com>
*/
#include <px4_middleware.h>
#include <px4_log.h>
#include <px4_app.h>
#include <px4_init.h>
#include "muorb_test_example.h"
extern "C" __EXPORT int muorb_test_entry(int argc, char **argv);

View File

@ -39,6 +39,7 @@
#include "muorb_test_example.h"
#include <px4_log.h>
#include <px4_app.h>
#include <px4_init.h>
#include <px4_tasks.h>
#include <stdio.h>
#include <string.h>

View File

@ -40,8 +40,8 @@
#include "hello_example.h"
#include <px4_middleware.h>
#include <px4_app.h>
#include <px4_init.h>
#include <stdio.h>
int PX4_MAIN(int argc, char **argv)

View File

@ -39,8 +39,8 @@
*/
#include "cdevtest_example.h"
#include <px4_middleware.h>
#include <px4_app.h>
#include <px4_init.h>
#include <stdio.h>
int PX4_MAIN(int argc, char **argv)

View File

@ -35,7 +35,6 @@
#include "uORBFastRpcChannel.hpp"
#include "uORBManager.hpp"
#include <px4_middleware.h>
#include <px4_tasks.h>
#include <px4_posix.h>
#include <dspal_platform.h>

View File

@ -37,9 +37,9 @@
*
* @author Mark Charlebois <charlebm@gmail.com>
*/
#include <px4_middleware.h>
#include <px4_log.h>
#include <px4_app.h>
#include <px4_init.h>
#include "muorb_test_example.h"
#include <stdio.h>
#include "uORB/uORBManager.hpp"

View File

@ -1,7 +0,0 @@
#pragma once
#ifdef __PX4_QURT
#include <types.h>
size_t strnlen(const char *s, size_t maxlen);
#endif

View File

@ -36,3 +36,19 @@ __BEGIN_DECLS
int px4_platform_init(void);
__END_DECLS
#ifdef __cplusplus
namespace px4
{
/**
* Startup init method. It has no specific functionality, just prints a welcome
* message and sets the thread name
*/
__EXPORT void init(int argc, char *argv[], const char *process_name);
} // namespace px4
#endif /* __cplusplus */

View File

@ -1,67 +0,0 @@
/****************************************************************************
*
* Copyright (c) 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
* 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_middleware.h
*
* PX4 generic middleware wrapper
*/
#pragma once
#include <stdint.h>
#include <unistd.h>
namespace px4
{
__EXPORT void init(int argc, char *argv[], const char *process_name);
__EXPORT uint64_t get_time_micros();
#if defined(__PX4_NUTTX)
extern bool task_should_exit;
/**
* Returns true if the app/task should continue to run
*/
__EXPORT inline bool ok() { return !task_should_exit; }
#elif defined(__PX4_QURT)
// FIXME - usleep not supported by DSPAL
inline void usleep(uint64_t sleep_interval) { }
#else
/**
* Linux needs to have globally unique checks for thread/task status
*/
#endif
} // namespace px4

View File

@ -42,8 +42,8 @@
#include <stdio.h>
#include <px4_middleware.h>
#include <px4_app.h>
#include <px4_init.h>
int PX4_MAIN(int argc, char **argv)
{

View File

@ -89,7 +89,6 @@ print("""
*/
#include <drivers/drv_hrt.h>
#include <px4_middleware.h>
#include <px4_app.h>
#include <px4_config.h>
#include <px4_log.h>

View File

@ -40,7 +40,6 @@
#include <px4_defines.h>
#include <drivers/drv_hrt.h>
#include <px4_middleware.h>
#include <px4_app.h>
#include <px4_config.h>
#include <px4_log.h>