src/drivers/boards/common/{stm32,kinetis}: move under platforms/nuttx/src/px4

This commit is contained in:
Beat Küng
2019-10-25 16:17:37 +02:00
parent 58e161347b
commit be7ed5e388
14 changed files with 152 additions and 24 deletions

View File

@@ -79,7 +79,6 @@ target_link_libraries(nuttx_arch
INTERFACE INTERFACE
drivers_board drivers_board
drivers_boards_common drivers_boards_common
drivers_boards_common_arch
arch_hrt arch_hrt
) )
@@ -102,7 +101,6 @@ target_link_libraries(px4 PRIVATE
-Wl,--gc-sections -Wl,--gc-sections
-Wl,--start-group -Wl,--start-group
drivers_boards_common_arch
${nuttx_libs} ${nuttx_libs}
-Wl,--end-group -Wl,--end-group

View File

@@ -43,10 +43,11 @@ if (NOT ${PX4_BOARD} MATCHES "px4_io")
) )
target_link_libraries(px4_layer target_link_libraries(px4_layer
PRIVATE PRIVATE
arch_board_reset
arch_board_critmon
arch_version arch_version
nuttx_apps # up_cxxinitialize nuttx_apps # up_cxxinitialize
nuttx_sched nuttx_sched
drivers_boards_common_arch
px4_work_queue px4_work_queue
) )
else() else()

View File

@@ -33,6 +33,8 @@
add_subdirectory(../kinetis/adc adc) add_subdirectory(../kinetis/adc adc)
add_subdirectory(../kinetis/board_reset board_reset)
add_subdirectory(../kinetis/board_critmon board_critmon)
add_subdirectory(../kinetis/led_pwm led_pwm) add_subdirectory(../kinetis/led_pwm led_pwm)
add_subdirectory(../kinetis/hrt hrt) add_subdirectory(../kinetis/hrt hrt)
add_subdirectory(../kinetis/io_pins io_pins) add_subdirectory(../kinetis/io_pins io_pins)

View File

@@ -1,6 +1,6 @@
############################################################################ ############################################################################
# #
# Copyright (c) 2017 PX4 Development Team. All rights reserved. # Copyright (c) 2019 PX4 Development Team. All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions # modification, are permitted provided that the following conditions
@@ -31,10 +31,6 @@
# #
############################################################################ ############################################################################
add_library(drivers_boards_common_arch px4_add_library(arch_board_critmon
board_reset.c
board_critmon.c board_critmon.c
) )
add_dependencies(drivers_boards_common_arch prebuild_targets)
target_compile_options(drivers_boards_common_arch PRIVATE -Wno-cast-align) # TODO: fix and enable
target_link_libraries(drivers_boards_common_arch PRIVATE nuttx_arch)

View File

@@ -0,0 +1,66 @@
/************************************************************************************
*
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 NuttX 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.
*
************************************************************************************/
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include <arch/board/board.h>
#if defined(CONFIG_SCHED_CRITMONITOR) || defined(CONFIG_SCHED_IRQMONITOR)
/************************************************************************************
* Public Functions
************************************************************************************/
#error "missing implementation for up_critmon_gettime() and up_critmon_convert()"
/************************************************************************************
* Name: up_critmon_gettime
************************************************************************************/
// uint32_t up_critmon_gettime(void)
// {
// }
/************************************************************************************
* Name: up_critmon_convert
************************************************************************************/
// void up_critmon_convert(uint32_t elapsed, FAR struct timespec *ts)
// {
// }
#endif /* CONFIG_SCHED_CRITMONITOR */

View File

@@ -1,6 +1,6 @@
############################################################################ ############################################################################
# #
# Copyright (c) 2017 PX4 Development Team. All rights reserved. # Copyright (c) 2019 PX4 Development Team. All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions # modification, are permitted provided that the following conditions
@@ -31,9 +31,6 @@
# #
############################################################################ ############################################################################
add_library(drivers_boards_common_arch px4_add_library(arch_board_reset
board_reset.c board_reset.c
) )
add_dependencies(drivers_boards_common_arch prebuild_targets)
target_compile_options(drivers_boards_common_arch PRIVATE -Wno-cast-align) # TODO: fix and enable
target_link_libraries(drivers_boards_common_arch PRIVATE nuttx_arch)

View File

@@ -0,0 +1,36 @@
############################################################################
#
# Copyright (c) 2019 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.
#
############################################################################
px4_add_library(arch_board_critmon
board_critmon.c
)

View File

@@ -64,7 +64,7 @@ uint32_t up_critmon_gettime(void)
} }
/************************************************************************************ /************************************************************************************
* Name: up_critmon_gettime * Name: up_critmon_convert
************************************************************************************/ ************************************************************************************/
void up_critmon_convert(uint32_t elapsed, FAR struct timespec *ts) void up_critmon_convert(uint32_t elapsed, FAR struct timespec *ts)

View File

@@ -0,0 +1,36 @@
############################################################################
#
# Copyright (c) 2019 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.
#
############################################################################
px4_add_library(arch_board_reset
board_reset.c
)

View File

@@ -33,6 +33,8 @@
add_subdirectory(../stm32_common/adc adc) add_subdirectory(../stm32_common/adc adc)
add_subdirectory(../stm32_common/board_critmon board_critmon)
add_subdirectory(../stm32_common/board_reset board_reset)
add_subdirectory(../stm32_common/dshot dshot) add_subdirectory(../stm32_common/dshot dshot)
add_subdirectory(../stm32_common/hrt hrt) add_subdirectory(../stm32_common/hrt hrt)
add_subdirectory(../stm32_common/led_pwm led_pwm) add_subdirectory(../stm32_common/led_pwm led_pwm)

View File

@@ -33,7 +33,9 @@
add_subdirectory(../stm32_common/adc adc) add_subdirectory(../stm32_common/adc adc)
add_subdirectory(../stm32_common/board_critmon board_critmon)
add_subdirectory(../stm32_common/board_hw_info board_hw_info) add_subdirectory(../stm32_common/board_hw_info board_hw_info)
add_subdirectory(../stm32_common/board_reset board_reset)
add_subdirectory(../stm32_common/dshot dshot) add_subdirectory(../stm32_common/dshot dshot)
add_subdirectory(../stm32_common/hrt hrt) add_subdirectory(../stm32_common/hrt hrt)
add_subdirectory(../stm32_common/led_pwm led_pwm) add_subdirectory(../stm32_common/led_pwm led_pwm)

View File

@@ -40,15 +40,8 @@ if ((${PX4_PLATFORM} MATCHES "nuttx") AND NOT ${PX4_BOARD} MATCHES "px4_io")
board_fat_dma_alloc.c board_fat_dma_alloc.c
) )
if (${CONFIG_ARCH_CHIP} MATCHES "kinetis")
add_subdirectory(kinetis)
elseif (${CONFIG_ARCH_CHIP} MATCHES "stm32")
add_subdirectory(stm32)
endif()
target_link_libraries(drivers_boards_common target_link_libraries(drivers_boards_common
PRIVATE PRIVATE
drivers_boards_common_arch
nuttx_arch # bbsram nuttx_arch # bbsram
nuttx_mm # dma gran alloc nuttx_mm # dma gran alloc
systemlib systemlib
@@ -56,5 +49,4 @@ if ((${PX4_PLATFORM} MATCHES "nuttx") AND NOT ${PX4_BOARD} MATCHES "px4_io")
else() else()
add_library(drivers_boards_common INTERFACE) add_library(drivers_boards_common INTERFACE)
add_library(drivers_boards_common_arch INTERFACE)
endif() endif()