delete px4_includes.h header and update boards/ to use syslog

This commit is contained in:
Daniel Agar
2019-01-22 11:23:29 -05:00
parent 376e078c24
commit 2ffb49b734
86 changed files with 190 additions and 563 deletions
@@ -44,6 +44,7 @@
#include <drivers/drv_hrt.h>
#include <drivers/device/ringbuffer.h>
#include <drivers/drv_device.h>
#include <systemlib/err.h>
#include <uORB/uORB.h>
+2
View File
@@ -43,6 +43,8 @@
#include "batt_smbus.h"
#include <stdlib.h>
extern "C" __EXPORT int batt_smbus_main(int argc, char *argv[]);
struct work_s BATT_SMBUS::_work = {};
@@ -35,6 +35,8 @@
#include <px4_getopt.h>
#include <stdlib.h>
// Driver 'main' command.
extern "C" __EXPORT int ms5525_airspeed_main(int argc, char *argv[]);
@@ -32,8 +32,11 @@
****************************************************************************/
#include "SDP3X.hpp"
#include <px4_getopt.h>
#include <stdlib.h>
// Driver 'main' command.
extern "C" __EXPORT int sdp3x_airspeed_main(int argc, char *argv[]);
@@ -36,6 +36,7 @@
#include <px4_getopt.h>
#include <px4_defines.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
@@ -122,7 +122,7 @@ void LidarLitePWM::print_info()
perf_print_counter(_sample_perf);
perf_print_counter(_read_errors);
perf_print_counter(_sensor_zero_resets);
warnx("poll interval: %u ticks", getMeasureTicks());
PX4_INFO("poll interval: %u ticks", getMeasureTicks());
print_message(_range);
}
@@ -303,8 +303,6 @@ Radar::task_main_trampoline(int argc, char *argv[])
int
Radar::start()
{
ASSERT(_task_handle == -1);
/* start the task */
_task_handle = px4_task_spawn_cmd("ulanding_radar",
SCHED_DEFAULT,
+1
View File
@@ -49,6 +49,7 @@
#include <lib/conversion/rotation.h>
#include <perf/perf_counter.h>
#include <ecl/geo/geo.h>
#include <systemlib/err.h>
#define ADIS16477_GYRO_DEFAULT_RATE 250
#define ADIS16477_GYRO_DEFAULT_DRIVER_FILTER_FREQ 30
+1
View File
@@ -40,6 +40,7 @@
#include <lib/perf/perf_counter.h>
#include <px4_config.h>
#include <systemlib/conversions.h>
#include <systemlib/err.h>
#define DIR_READ 0x80
#define DIR_WRITE 0x00
@@ -73,6 +73,7 @@
#include <mathlib/math/filter/LowPassFilter2p.hpp>
#include <lib/conversion/rotation.h>
#include <platforms/px4_getopt.h>
#include <systemlib/err.h>
/* SPI protocol address bits */
#define DIR_READ(a) ((a) | (1 << 7))
@@ -77,6 +77,7 @@
#include <mathlib/math/filter/LowPassFilter2p.hpp>
#include <lib/conversion/rotation.h>
#include <platforms/px4_getopt.h>
#include <systemlib/err.h>
/* SPI protocol address bits */
#define DIR_READ(a) ((a) & 0x7f)
+1
View File
@@ -48,6 +48,7 @@
#include <drivers/drv_mag.h>
#include <mathlib/math/filter/LowPassFilter2p.hpp>
#include <lib/conversion/rotation.h>
#include <systemlib/err.h>
#include <uORB/uORB.h>
#include <uORB/topics/debug_key_value.h>
+6 -5
View File
@@ -31,13 +31,16 @@
*
****************************************************************************/
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <px4_tasks.h>
#include <px4_getopt.h>
#include <px4_posix.h>
#include <errno.h>
#include <cmath> // NAN
#include <uORB/uORB.h>
#include <uORB/topics/actuator_controls.h>
@@ -461,8 +464,6 @@ void task_main_trampoline(int argc, char *argv[])
void start()
{
ASSERT(_task_handle == -1);
_task_should_exit = false;
/* start the task */
@@ -474,7 +475,7 @@ void start()
nullptr);
if (_task_handle < 0) {
warn("task start failed");
PX4_ERR("task start failed");
return;
}
+5
View File
@@ -33,7 +33,12 @@
*
****************************************************************************/
#include "linux_sbus.h"
#include <stdlib.h>
#include <string.h>
using namespace linux_sbus;
//---------------------------------------------------------------------------------------------------------//
int RcInput::init()
{
@@ -47,6 +47,7 @@
#include <drivers/drv_mag.h>
#include <lib/conversion/rotation.h>
#include <systemlib/err.h>
#include <perf/perf_counter.h>
#include <px4_defines.h>
@@ -43,6 +43,7 @@
#include <lib/conversion/rotation.h>
#include <perf/perf_counter.h>
#include <px4_workqueue.h>
#include <systemlib/err.h>
// Register mapping
static constexpr uint8_t WHO_AM_I_M = 0x4F;
+1
View File
@@ -50,6 +50,7 @@
#include <perf/perf_counter.h>
#include <px4_defines.h>
#include <systemlib/err.h>
#ifndef CONFIG_SCHED_WORKQUEUE
# error This requires CONFIG_SCHED_WORKQUEUE.
@@ -38,7 +38,7 @@
#include <px4_posix.h>
#include <errno.h>
#include <cmath> // NAN
#include <string.h>
#include <uORB/uORB.h>
#include <uORB/topics/actuator_controls.h>
@@ -505,8 +505,6 @@ void task_main_trampoline(int argc, char *argv[])
void start()
{
ASSERT(_task_handle == -1);
_task_should_exit = false;
/* start the task */
@@ -518,7 +516,7 @@ void start()
nullptr);
if (_task_handle < 0) {
warn("task start failed");
PX4_ERR("task start failed");
return;
}
+2 -2
View File
@@ -39,6 +39,8 @@
* on the serial port. By default port J12 (next to J13, power module side) is used.
*/
#include <string.h>
#include <px4_tasks.h>
#include <px4_posix.h>
#include <px4_getopt.h>
@@ -212,8 +214,6 @@ int start(int argc, char *argv[])
return -1;
}
ASSERT(_task_handle == -1);
_task_should_exit = false;
_task_handle = px4_task_spawn_cmd("spektrum_rc_main",
@@ -41,6 +41,7 @@
#include <uavcan/uavcan.hpp>
#include <drivers/device/device.h>
#include <drivers/drv_orb_dev.h>
#include <uORB/uORB.h>
/**
* A sensor bridge class must implement this interface.
-2
View File
@@ -222,8 +222,6 @@ BottleDrop::~BottleDrop()
int
BottleDrop::start()
{
ASSERT(_main_task == -1);
/* start the task */
_main_task = px4_task_spawn_cmd("bottle_drop",
SCHED_DEFAULT,
-1
View File
@@ -39,7 +39,6 @@
#pragma once
#include "../platforms/px4_includes.h"
#include "../platforms/px4_defines.h"
#ifdef __cplusplus
#include "../platforms/px4_middleware.h"
+1
View File
@@ -2,6 +2,7 @@
#pragma once
#include <inttypes.h>
#include <string.h>
#define ATOMIC_ENTER lock()
#define ATOMIC_LEAVE unlock()
+5 -1
View File
@@ -33,10 +33,14 @@
#include "linux_gpio.h"
#include <px4_posix.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <px4_posix.h>
#define PIN_INDEX_BUFFER_MAX (16)
#define PIN_DIRECTION_BUFFER_MAX (30 + PIN_INDEX_BUFFER_MAX)
@@ -45,9 +45,11 @@
#include <px4_defines.h>
#include <px4_posix.h>
#include <px4_shutdown.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <errno.h>
#include <parameters/param.h>
+1
View File
@@ -40,6 +40,7 @@
#include <px4_log.h>
#include <math.h>
#include <ctype.h>
#include <errno.h>
#define TUNE_ERROR -1
#define TUNE_STOP 0
@@ -229,8 +229,6 @@ AttitudeEstimatorQ::~AttitudeEstimatorQ()
int AttitudeEstimatorQ::start()
{
ASSERT(_control_task == -1);
/* start the task */
_control_task = px4_task_spawn_cmd("attitude_estimator_q",
SCHED_DEFAULT,
@@ -223,7 +223,7 @@ GroundRoverAttitudeControl::task_main()
/* this is undesirable but not much we can do - might want to flag unhappy status */
if (pret < 0) {
warn("poll error %d, %d", pret, errno);
PX4_ERR("poll error %d, %d", pret, errno);
continue;
}
@@ -298,7 +298,7 @@ GroundRoverAttitudeControl::task_main()
perf_count(_nonfinite_output_perf);
if (_debug && loop_counter % 10 == 0) {
warnx("yaw_u %.4f", (double)yaw_u);
PX4_INFO("yaw_u %.4f", (double)yaw_u);
}
}
@@ -343,7 +343,7 @@ GroundRoverAttitudeControl::task_main()
perf_end(_loop_perf);
}
warnx("exiting.\n");
PX4_INFO("exiting.");
_control_task = -1;
_task_running = false;
@@ -352,8 +352,6 @@ GroundRoverAttitudeControl::task_main()
int
GroundRoverAttitudeControl::start()
{
ASSERT(_control_task == -1);
/* start the task */
_control_task = px4_task_spawn_cmd("gnd_att_control",
SCHED_DEFAULT,
@@ -363,7 +361,7 @@ GroundRoverAttitudeControl::start()
nullptr);
if (_control_task < 0) {
warn("task start failed");
PX4_ERR("task start failed");
return -errno;
}
@@ -373,28 +371,28 @@ GroundRoverAttitudeControl::start()
int gnd_att_control_main(int argc, char *argv[])
{
if (argc < 2) {
warnx("usage: gnd_att_control {start|stop|status}");
PX4_INFO("usage: gnd_att_control {start|stop|status}");
return 1;
}
if (!strcmp(argv[1], "start")) {
if (att_gnd_control::g_control != nullptr) {
warnx("already running");
PX4_WARN("already running");
return 1;
}
att_gnd_control::g_control = new GroundRoverAttitudeControl;
if (att_gnd_control::g_control == nullptr) {
warnx("alloc failed");
PX4_ERR("alloc failed");
return 1;
}
if (PX4_OK != att_gnd_control::g_control->start()) {
delete att_gnd_control::g_control;
att_gnd_control::g_control = nullptr;
warn("start failed");
PX4_ERR("start failed");
return 1;
}
@@ -416,7 +414,7 @@ int gnd_att_control_main(int argc, char *argv[])
if (!strcmp(argv[1], "stop")) {
if (att_gnd_control::g_control == nullptr) {
warnx("not running");
PX4_WARN("not running");
return 1;
}
@@ -427,15 +425,15 @@ int gnd_att_control_main(int argc, char *argv[])
if (!strcmp(argv[1], "status")) {
if (att_gnd_control::g_control) {
warnx("running");
PX4_INFO("running");
return 0;
} else {
warnx("not running");
PX4_INFO("not running");
return 1;
}
}
warnx("unrecognized command");
PX4_WARN("unrecognized command");
return 1;
}
@@ -484,8 +484,6 @@ GroundRoverPositionControl::task_main_trampoline(int argc, char *argv[])
int
GroundRoverPositionControl::start()
{
ASSERT(_control_task == -1);
/* start the task */
_control_task = px4_task_spawn_cmd("gnd_pos_ctrl",
SCHED_DEFAULT,
+2
View File
@@ -33,8 +33,10 @@
#include "log_writer_file.h"
#include "messages.h"
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <mathlib/mathlib.h>
#include <px4_posix.h>
-1
View File
@@ -52,7 +52,6 @@
#include <uORB/topics/vehicle_command_ack.h>
#include <drivers/drv_hrt.h>
#include <px4_includes.h>
#include <px4_getopt.h>
#include <px4_log.h>
#include <px4_posix.h>
+2
View File
@@ -41,6 +41,8 @@
#include "mavlink_timesync.h"
#include "mavlink_main.h"
#include <stdlib.h>
MavlinkTimesync::MavlinkTimesync(Mavlink *mavlink) :
_mavlink(mavlink)
{
@@ -33,6 +33,7 @@
#include "uORBFastRpcChannel.hpp"
#include "px4_log.h"
#include <algorithm>
#include <string.h>
#include <drivers/drv_hrt.h>
// static initialization.
@@ -40,6 +40,7 @@
#include "px4_log.h"
#include <shmem.h>
#include <drivers/drv_hrt.h>
#include <string.h>
using namespace px4muorb;
@@ -37,6 +37,7 @@
#include <drivers/drv_hrt.h>
#include <cstdio>
#include <pthread.h>
#include <string.h>
#define LOG_TAG "uORBKraitFastRpcChannel.cpp"
+3 -1
View File
@@ -31,9 +31,11 @@
*
****************************************************************************/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <px4_log.h>
#if defined(__PX4_POSIX)
#if !defined(__PX4_CYGWIN)
@@ -55,7 +57,7 @@ __EXPORT const char *__px4_log_level_color[_PX4_LOG_LEVEL_PANIC + 1] =
void px4_log_initialize(void)
{
ASSERT(orb_log_message_pub == NULL);
assert(orb_log_message_pub == NULL);
/* we need to advertise with a valid message */
struct log_message_s log_message;
@@ -52,6 +52,8 @@
#include <drivers/drv_hrt.h>
#include "hrt_work.h"
#include <string.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@@ -39,6 +39,7 @@
* motor and contol commands to the Bebop and reads its status and informations.
*/
#include <stdlib.h>
#include <stdint.h>
#include <px4_tasks.h>
@@ -300,7 +301,7 @@ int initialize_mixers(const char *mixers_filename)
PX4_INFO("Trying to initialize mixers from config file %s", mixers_filename);
if (load_mixer_file(mixers_filename, &buf[0], sizeof(buf)) < 0) {
warnx("can't load mixer: %s", mixers_filename);
PX4_ERR("can't load mixer: %s", mixers_filename);
return -1;
}
@@ -484,9 +485,6 @@ int start()
DevMgr::releaseHandle(h);
// Start the task to forward the motor control commands
ASSERT(_task_handle == -1);
/* start the task */
_task_handle = px4_task_spawn_cmd("bebop_bus_esc_main",
SCHED_DEFAULT,
SCHED_PRIORITY_MAX,
@@ -495,7 +493,7 @@ int start()
nullptr);
if (_task_handle < 0) {
warn("task start failed");
PX4_ERR("task start failed");
return -1;
}
-1
View File
@@ -77,7 +77,6 @@
* Building for NuttX or POSIX.
****************************************************************************/
#include <platforms/px4_includes.h>
/* Main entry point */
#define PX4_MAIN_FUNCTION(_prefix) int _prefix##_task_main(int argc, char *argv[])
-80
View File
@@ -1,80 +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_includes.h
*
* Includes headers depending on the build target
*/
#pragma once
#if defined(__PX4_NUTTX)
/*
* Building for NuttX
*/
#include <nuttx/config.h>
#include <uORB/uORB.h>
#include <systemlib/err.h>
#include <parameters/param.h>
#elif defined(__PX4_POSIX) && !defined(__PX4_QURT)
/*
* Building for Posix
*/
#include <string.h>
#include <assert.h>
#include <uORB/uORB.h>
#define ASSERT(x) assert(x)
#include <systemlib/err.h>
#include <parameters/param.h>
#elif defined(__PX4_QURT)
/*
* Building for QuRT
*/
#include <string.h>
#include <assert.h>
#include <uORB/uORB.h>
#define ASSERT(x) assert(x)
#include <systemlib/err.h>
#include <parameters/param.h>
#else
#error "No target platform defined"
#endif
-1
View File
@@ -38,7 +38,6 @@
#pragma once
#define _PX4_LOG_LEVEL_DEBUG 0
#define _PX4_LOG_LEVEL_INFO 1
#define _PX4_LOG_LEVEL_WARN 2
@@ -39,6 +39,7 @@
#include <px4_module.h>
#include <px4_log.h>
#include <stdlib.h>
#include <unistd.h>
#include <drivers/drv_hrt.h>
-1
View File
@@ -44,7 +44,6 @@
#include <px4_config.h>
#include <px4_module.h>
#include <px4_includes.h>
#include <px4_getopt.h>
#include <px4_log.h>
+4 -2
View File
@@ -38,8 +38,10 @@
*/
#include <dirent.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include <px4_config.h>
#include <mixer/mixer.h>
@@ -397,13 +399,13 @@ bool MixerTest::mixerTest()
if (i != actuator_controls_s::INDEX_THROTTLE) {
if (r_page_servos[i] < r_page_servo_control_min[i]) {
warnx("active servo < min");
PX4_ERR("active servo < min");
return false;
}
} else {
if (r_page_servos[i] != r_page_servo_disarmed[i]) {
warnx("throttle output != 0 (this check assumed the IO pass mixer!)");
PX4_ERR("throttle output != 0 (this check assumed the IO pass mixer!)");
return false;
}
}
+2
View File
@@ -1,6 +1,8 @@
#include <unit_test.h>
#include <px4_defines.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
@@ -41,8 +41,10 @@
#include <px4_getopt.h>
#include <px4_log.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <px4_module.h>