cmake don't build param "c" files and remove param defines

- these aren't actual source code
This commit is contained in:
Daniel Agar
2019-11-09 18:43:52 -05:00
parent f984c4e450
commit 1c4e854f93
42 changed files with 34 additions and 68 deletions

View File

@@ -35,7 +35,7 @@ set(SRCS)
if (NOT "${PX4_PLATFORM}" MATCHES "qurt" AND NOT "${PX4_BOARD}" MATCHES "io-v2")
list(APPEND SRCS
px4_log.c
px4_log.cpp
)
endif()

View File

@@ -49,22 +49,9 @@
* Defines for all platforms.
****************************************************************************/
/* Get the name of the default value fiven the param name */
#define PX4_PARAM_DEFAULT_VALUE_NAME(_name) PARAM_##_name##_DEFAULT
/* Shortcuts to define parameters when the default value is defined according to PX4_PARAM_DEFAULT_VALUE_NAME */
#define PX4_PARAM_DEFINE_INT32(_name) PARAM_DEFINE_INT32(_name, PX4_PARAM_DEFAULT_VALUE_NAME(_name))
#define PX4_PARAM_DEFINE_FLOAT(_name) PARAM_DEFINE_FLOAT(_name, PX4_PARAM_DEFAULT_VALUE_NAME(_name))
#define PX4_ERROR (-1)
#define PX4_OK 0
/* Wrapper for 2d matrices */
#define PX4_ARRAY2D(_array, _ncols, _x, _y) (_array[_x * _ncols + _y])
/* Wrapper for rotation matrices stored in arrays */
#define PX4_R(_array, _x, _y) PX4_ARRAY2D(_array, 3, _x, _y)
/* Define PX4_ISFINITE */
#ifdef __cplusplus
constexpr bool PX4_ISFINITE(float x) { return __builtin_isfinite(x); }
@@ -79,13 +66,6 @@ constexpr bool PX4_ISFINITE(double x) { return __builtin_isfinite(x); }
/* Main entry point */
#define PX4_MAIN_FUNCTION(_prefix) int _prefix##_task_main(int argc, char *argv[])
/* Parameter handle datatype */
#include <parameters/param.h>
typedef param_t px4_param_t;
/* Get value of parameter by name */
#define PX4_PARAM_GET_BYNAME(_name, _destpt) param_get(param_find(_name), _destpt)
#else // defined(__PX4_NUTTX) || defined(__PX4_POSIX)
/****************************************************************************/
#error "No target OS defined"

View File

@@ -49,7 +49,7 @@
#include <uORB/topics/log_message.h>
#include <drivers/drv_hrt.h>
static orb_advert_t orb_log_message_pub = NULL;
static orb_advert_t orb_log_message_pub = nullptr;
__EXPORT const char *__px4_log_level_str[_PX4_LOG_LEVEL_PANIC + 1] = { "DEBUG", "INFO", "WARN", "ERROR", "PANIC" };
__EXPORT const char *__px4_log_level_color[_PX4_LOG_LEVEL_PANIC + 1] =
@@ -58,7 +58,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 == nullptr);
/* we need to advertise with a valid message */
struct log_message_s log_message;