Skip to content

Commit

Permalink
px4_middleware: remove that header and move px4::init to px4_init.h
Browse files Browse the repository at this point in the history
delete include:
for i in $(grep -rl 'px4_middleware.h' src platforms); do sed -i '/#include <px4_middleware.h/d' $i; done
  • Loading branch information
bkueng committed Aug 30, 2019
1 parent f32abe8 commit 43fdcd7
Show file tree
Hide file tree
Showing 24 changed files with 27 additions and 105 deletions.
2 changes: 1 addition & 1 deletion platforms/common/px4_work_queue/test/wqueue_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion platforms/common/work_queue/wqueue_test/wqueue_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include "wqueue_test.h"

#include <px4_log.h>
#include <px4_middleware.h>
#include <px4_app.h>
#include <stdio.h>

Expand Down
6 changes: 0 additions & 6 deletions platforms/nuttx/src/px4/common/px4_nuttx_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
*/

#include <px4_defines.h>
#include <px4_middleware.h>
#include <drivers/drv_hrt.h>

namespace px4
Expand All @@ -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();
}

}
3 changes: 1 addition & 2 deletions platforms/posix/src/px4/common/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 0 additions & 6 deletions platforms/posix/src/px4/common/px4_posix_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
*/

#include <px4_defines.h>
#include <px4_middleware.h>
#include <px4_workqueue.h>
#include <px4_defines.h>
#include <stdint.h>
Expand Down Expand Up @@ -98,10 +97,5 @@ void init(int argc, char *argv[], const char *app_name)
#endif
}

uint64_t get_time_micros()
{
return hrt_absolute_time();
}

}

1 change: 0 additions & 1 deletion platforms/posix/src/px4/common/px4_sem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
*/

#include <px4_defines.h>
#include <px4_middleware.h>
#include <px4_workqueue.h>
#include <px4_time.h>
#include <stdint.h>
Expand Down
2 changes: 1 addition & 1 deletion platforms/qurt/src/px4/common/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
* @author Julian Oes <[email protected]>
*/

#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>
Expand Down
1 change: 0 additions & 1 deletion platforms/qurt/src/px4/common/px4_qurt_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 0 additions & 1 deletion src/drivers/pwm_out_sim/PWMSim.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 0 additions & 1 deletion src/drivers/qshell/qurt/qshell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 1 addition & 1 deletion src/drivers/qshell/qurt/qshell_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
* @author Nicolas de Palezieux <[email protected]>
*/

#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);
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/qurt/tests/hello/hello_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
*
* @author Mark Charlebois <[email protected]>
*/
#include <px4_middleware.h>
#include <px4_log.h>
#include <px4_app.h>
#include <px4_init.h>
#include "hello_example.h"
#include <stdio.h>

Expand Down
2 changes: 1 addition & 1 deletion src/drivers/qurt/tests/muorb/muorb_test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
*
* @author Mark Charlebois <[email protected]>
*/
#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);
Expand Down
1 change: 1 addition & 0 deletions src/drivers/qurt/tests/muorb/muorb_test_start_qurt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/examples/hello/hello_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cdev/test/cdevtest_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/modules/muorb/adsp/px4muorb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/muorb/test/muorb_test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
*
* @author Mark Charlebois <[email protected]>
*/
#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"
Expand Down
7 changes: 0 additions & 7 deletions src/platforms/px4_common.h

This file was deleted.

16 changes: 16 additions & 0 deletions src/platforms/px4_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

67 changes: 0 additions & 67 deletions src/platforms/px4_middleware.h

This file was deleted.

2 changes: 1 addition & 1 deletion src/systemcmds/tests/hrt_test/hrt_test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 0 additions & 1 deletion src/systemcmds/topic_listener/generate_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
*/
#include <drivers/drv_hrt.h>
#include <px4_middleware.h>
#include <px4_app.h>
#include <px4_config.h>
#include <px4_log.h>
Expand Down
1 change: 0 additions & 1 deletion src/systemcmds/topic_listener/topic_listener.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 43fdcd7

Please sign in to comment.