mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 19:32:36 +08:00
Qurt uORB SLPI Implementation (#20538)
- allow uORB to be compiled and run on the qurt architecture.
This commit is contained in:
@@ -3,3 +3,4 @@ CONFIG_BOARD_LINUX=y
|
|||||||
CONFIG_BOARD_TOOLCHAIN="aarch64-linux-gnu"
|
CONFIG_BOARD_TOOLCHAIN="aarch64-linux-gnu"
|
||||||
CONFIG_MODULES_MUORB_APPS=y
|
CONFIG_MODULES_MUORB_APPS=y
|
||||||
CONFIG_SYSTEMCMDS_PERF=y
|
CONFIG_SYSTEMCMDS_PERF=y
|
||||||
|
CONFIG_SYSTEMCMDS_UORB=y
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
CONFIG_PLATFORM_QURT=y
|
CONFIG_PLATFORM_QURT=y
|
||||||
CONFIG_BOARD_TOOLCHAIN="qurt"
|
CONFIG_BOARD_TOOLCHAIN="qurt"
|
||||||
CONFIG_MODULES_MUORB_SLPI=y
|
CONFIG_MODULES_MUORB_SLPI=y
|
||||||
|
CONFIG_SYSTEMCMDS_UORB=y
|
||||||
|
|||||||
@@ -170,6 +170,9 @@ function(px4_add_module)
|
|||||||
if (${PX4_PLATFORM} STREQUAL "nuttx" AND NOT CONFIG_BUILD_FLAT AND KERNEL)
|
if (${PX4_PLATFORM} STREQUAL "nuttx" AND NOT CONFIG_BUILD_FLAT AND KERNEL)
|
||||||
target_link_libraries(${MODULE} PRIVATE kernel_parameters_interface px4_kernel_layer uORB_kernel)
|
target_link_libraries(${MODULE} PRIVATE kernel_parameters_interface px4_kernel_layer uORB_kernel)
|
||||||
set_property(GLOBAL APPEND PROPERTY PX4_KERNEL_MODULE_LIBRARIES ${MODULE})
|
set_property(GLOBAL APPEND PROPERTY PX4_KERNEL_MODULE_LIBRARIES ${MODULE})
|
||||||
|
elseif(${PX4_PLATFORM} STREQUAL "qurt")
|
||||||
|
target_link_libraries(${MODULE} PRIVATE px4_layer uORB)
|
||||||
|
set_property(GLOBAL APPEND PROPERTY PX4_MODULE_LIBRARIES ${MODULE})
|
||||||
else()
|
else()
|
||||||
target_link_libraries(${MODULE} PRIVATE parameters_interface px4_layer uORB)
|
target_link_libraries(${MODULE} PRIVATE parameters_interface px4_layer uORB)
|
||||||
set_property(GLOBAL APPEND PROPERTY PX4_MODULE_LIBRARIES ${MODULE})
|
set_property(GLOBAL APPEND PROPERTY PX4_MODULE_LIBRARIES ${MODULE})
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
set(SRCS)
|
set(SRCS)
|
||||||
|
|
||||||
if(NOT "${PX4_BOARD}" MATCHES "io-v2" AND NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader")
|
if(NOT "${PX4_PLATFORM}" MATCHES "qurt" AND NOT "${PX4_BOARD}" MATCHES "io-v2" AND NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader")
|
||||||
list(APPEND SRCS
|
list(APPEND SRCS
|
||||||
px4_log.cpp
|
px4_log.cpp
|
||||||
px4_log_history.cpp
|
px4_log_history.cpp
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ __END_DECLS
|
|||||||
|
|
||||||
#if defined(__PX4_QURT)
|
#if defined(__PX4_QURT)
|
||||||
#include "qurt_log.h"
|
#include "qurt_log.h"
|
||||||
|
#include <px4_platform_common/defines.h>
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Messages that should never be filtered or compiled out
|
* Messages that should never be filtered or compiled out
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|||||||
@@ -31,12 +31,13 @@
|
|||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
set(module_libraries modules__muorb__slpi)
|
get_property(module_libraries GLOBAL PROPERTY PX4_MODULE_LIBRARIES)
|
||||||
|
|
||||||
QURT_LIB(LIB_NAME px4
|
QURT_LIB(LIB_NAME px4
|
||||||
SOURCES
|
SOURCES
|
||||||
${PX4_SOURCE_DIR}/platforms/qurt/unresolved_symbols.c
|
${PX4_SOURCE_DIR}/platforms/qurt/unresolved_symbols.c
|
||||||
LINK_LIBS
|
LINK_LIBS
|
||||||
|
modules__muorb__slpi
|
||||||
${module_libraries}
|
${module_libraries}
|
||||||
px4_layer
|
px4_layer
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -36,13 +36,13 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#include <pthread.h>
|
||||||
extern "C" {
|
#include <visibility.h>
|
||||||
#endif
|
|
||||||
|
__BEGIN_DECLS
|
||||||
|
|
||||||
typedef unsigned long useconds_t;
|
typedef unsigned long useconds_t;
|
||||||
int usleep(useconds_t usec);
|
int usleep(useconds_t usec);
|
||||||
|
int pthread_setname_np(pthread_t __target_thread, const char *__name);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
__END_DECLS
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
set(QURT_LAYER_SRCS
|
set(QURT_LAYER_SRCS
|
||||||
drv_hrt.cpp
|
drv_hrt.cpp
|
||||||
tasks.cpp
|
tasks.cpp
|
||||||
|
px4_qurt_impl.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(px4_layer
|
add_library(px4_layer
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
*
|
||||||
|
* Copyright (C) 2022 ModalAI, Inc. 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.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
#include <px4_platform_common/defines.h>
|
||||||
|
|
||||||
|
__BEGIN_DECLS
|
||||||
|
|
||||||
|
long PX4_TICKS_PER_SEC = 1000L;
|
||||||
|
|
||||||
|
__END_DECLS
|
||||||
Reference in New Issue
Block a user