mirror of https://github.com/ARMmbed/mbed-os.git
restructure - Split hal into drivers+platform+hal
hal/common/AnalogIn.cpp -> drivers/AnalogIn.cpp hal/api/AnalogIn.h -> drivers/AnalogIn.h hal/api/AnalogOut.h -> drivers/AnalogOut.h hal/common/BusIn.cpp -> drivers/BusIn.cpp hal/api/BusIn.h -> drivers/BusIn.h hal/common/BusInOut.cpp -> drivers/BusInOut.cpp hal/api/BusInOut.h -> drivers/BusInOut.h hal/common/BusOut.cpp -> drivers/BusOut.cpp hal/api/BusOut.h -> drivers/BusOut.h hal/common/CAN.cpp -> drivers/CAN.cpp hal/api/CAN.h -> drivers/CAN.h hal/api/CircularBuffer.h -> drivers/CircularBuffer.h hal/api/DigitalIn.h -> drivers/DigitalIn.h hal/api/DigitalInOut.h -> drivers/DigitalInOut.h hal/api/DigitalOut.h -> drivers/DigitalOut.h hal/api/DirHandle.h -> drivers/DirHandle.h hal/common/Ethernet.cpp -> drivers/Ethernet.cpp hal/api/Ethernet.h -> drivers/Ethernet.h hal/common/FileBase.cpp -> drivers/FileBase.cpp hal/api/FileBase.h -> drivers/FileBase.h hal/api/FileHandle.h -> drivers/FileHandle.h hal/common/FileLike.cpp -> drivers/FileLike.cpp hal/api/FileLike.h -> drivers/FileLike.h hal/common/FilePath.cpp -> drivers/FilePath.cpp hal/api/FilePath.h -> drivers/FilePath.h hal/common/FileSystemLike.cpp -> drivers/FileSystemLike.cpp hal/api/FileSystemLike.h -> drivers/FileSystemLike.h hal/common/I2C.cpp -> drivers/I2C.cpp hal/api/I2C.h -> drivers/I2C.h hal/common/I2CSlave.cpp -> drivers/I2CSlave.cpp hal/api/I2CSlave.h -> drivers/I2CSlave.h hal/common/InterruptIn.cpp -> drivers/InterruptIn.cpp hal/api/InterruptIn.h -> drivers/InterruptIn.h hal/common/InterruptManager.cpp -> drivers/InterruptManager.cpp hal/api/InterruptManager.h -> drivers/InterruptManager.h hal/common/LocalFileSystem.cpp -> drivers/LocalFileSystem.cpp hal/api/LocalFileSystem.h -> drivers/LocalFileSystem.h hal/api/LowPowerTicker.h -> drivers/LowPowerTicker.h hal/api/LowPowerTimeout.h -> drivers/LowPowerTimeout.h hal/api/LowPowerTimer.h -> drivers/LowPowerTimer.h hal/api/PortIn.h -> drivers/PortIn.h hal/api/PortInOut.h -> drivers/PortInOut.h hal/api/PortOut.h -> drivers/PortOut.h hal/api/PwmOut.h -> drivers/PwmOut.h hal/common/RawSerial.cpp -> drivers/RawSerial.cpp hal/api/RawSerial.h -> drivers/RawSerial.h hal/common/SPI.cpp -> drivers/SPI.cpp hal/api/SPI.h -> drivers/SPI.h hal/common/SPISlave.cpp -> drivers/SPISlave.cpp hal/api/SPISlave.h -> drivers/SPISlave.h hal/common/Serial.cpp -> drivers/Serial.cpp hal/api/Serial.h -> drivers/Serial.h hal/common/SerialBase.cpp -> drivers/SerialBase.cpp hal/api/SerialBase.h -> drivers/SerialBase.h hal/common/Stream.cpp -> drivers/Stream.cpp hal/api/Stream.h -> drivers/Stream.h hal/common/Ticker.cpp -> drivers/Ticker.cpp hal/api/Ticker.h -> drivers/Ticker.h hal/common/Timeout.cpp -> drivers/Timeout.cpp hal/api/Timeout.h -> drivers/Timeout.h hal/common/Timer.cpp -> drivers/Timer.cpp hal/api/Timer.h -> drivers/Timer.h hal/common/TimerEvent.cpp -> drivers/TimerEvent.cpp hal/api/TimerEvent.h -> drivers/TimerEvent.h hal/api/Transaction.h -> drivers/Transaction.h hal/api/can_helper.h -> drivers/can_helper.h hal/.yotta_ignore hal/CMakeLists.txt hal/hal/analogin_api.h -> hal/analogin_api.h hal/hal/analogout_api.h -> hal/analogout_api.h hal/hal/buffer.h -> hal/buffer.h hal/hal/can_api.h -> hal/can_api.h hal/hal/dma_api.h -> hal/dma_api.h hal/hal/ethernet_api.h -> hal/ethernet_api.h hal/hal/gpio_api.h -> hal/gpio_api.h hal/hal/gpio_irq_api.h -> hal/gpio_irq_api.h hal/hal/i2c_api.h -> hal/i2c_api.h hal/hal/lp_ticker_api.h -> hal/lp_ticker_api.h hal/common/mbed_gpio.c -> hal/mbed_gpio.c hal/common/mbed_lp_ticker_api.c -> hal/mbed_lp_ticker_api.c hal/common/mbed_pinmap_common.c -> hal/mbed_pinmap_common.c hal/common/mbed_ticker_api.c -> hal/mbed_ticker_api.c hal/common/mbed_us_ticker_api.c -> hal/mbed_us_ticker_api.c hal/module.json hal/hal/pinmap.h -> hal/pinmap.h hal/hal/port_api.h -> hal/port_api.h hal/hal/pwmout_api.h -> hal/pwmout_api.h hal/hal/rtc_api.h -> hal/rtc_api.h hal/hal/serial_api.h -> hal/serial_api.h hal/hal/sleep_api.h -> hal/sleep_api.h hal/hal/spi_api.h -> hal/spi_api.h hal/hal/storage_abstraction/Driver_Common.h -> hal/storage_abstraction/Driver_Common.h hal/hal/storage_abstraction/Driver_Storage.h -> hal/storage_abstraction/Driver_Storage.h hal/hal/ticker_api.h -> hal/ticker_api.h hal/hal/trng_api.h -> hal/trng_api.h hal/hal/us_ticker_api.h -> hal/us_ticker_api.h hal/api/mbed.h -> mbed.h hal/api/CThunk.h -> platform/CThunk.h hal/common/CallChain.cpp -> platform/CallChain.cpp hal/api/CallChain.h -> platform/CallChain.h hal/api/Callback.h -> platform/Callback.h hal/api/FunctionPointer.h -> platform/FunctionPointer.h hal/api/PlatformMutex.h -> platform/PlatformMutex.h hal/api/SingletonPtr.h -> platform/SingletonPtr.h hal/api/critical.h -> platform/critical.h hal/common/mbed_alloc_wrappers.cpp -> platform/mbed_alloc_wrappers.cpp hal/common/mbed_assert.c -> platform/mbed_assert.c hal/api/mbed_assert.h -> platform/mbed_assert.h hal/common/mbed_board.c -> platform/mbed_board.c hal/common/mbed_critical.c -> platform/mbed_critical.c hal/api/mbed_debug.h -> platform/mbed_debug.h hal/common/mbed_error.c -> platform/mbed_error.c hal/api/mbed_error.h -> platform/mbed_error.h hal/common/mbed_interface.c -> platform/mbed_interface.c hal/api/mbed_interface.h -> platform/mbed_interface.h hal/common/mbed_mem_trace.c -> platform/mbed_mem_trace.c hal/api/mbed_mem_trace.h -> platform/mbed_mem_trace.h hal/common/mbed_rtc_time.cpp -> platform/mbed_rtc_time.cpp hal/common/mbed_semihost_api.c -> platform/mbed_semihost_api.c hal/api/mbed_stats.h -> platform/mbed_stats.h hal/common/mbed_wait_api_no_rtos.c -> platform/mbed_wait_api_no_rtos.c hal/common/mbed_wait_api_rtos.cpp -> platform/mbed_wait_api_rtos.cpp hal/api/platform.h -> platform/platform.h hal/common/retarget.cpp -> platform/retarget.cpp hal/api/rtc_time.h -> platform/rtc_time.h hal/api/semihost_api.h -> platform/semihost_api.h hal/api/toolchain.h -> platform/toolchain.h hal/api/wait_api.h -> platform/wait_api.hpull/2878/head
parent
0bad622a16
commit
15904b7544
|
@ -1,14 +0,0 @@
|
||||||
# ignore files for targets that aren't supported by the yotta build (to
|
|
||||||
# minimise the size of the published module)
|
|
||||||
|
|
||||||
TARGET_ARM_SSG
|
|
||||||
TARGET_Freescale
|
|
||||||
TARGET_RENESAS
|
|
||||||
TARGET_Silicon_Labs
|
|
||||||
TARGET_Atmel
|
|
||||||
TARGET_Maxim
|
|
||||||
TARGET_NXP
|
|
||||||
TARGET_STM
|
|
||||||
TARGET_WIZNET
|
|
||||||
TOOLCHAIN_IAR
|
|
||||||
|
|
|
@ -1,112 +0,0 @@
|
||||||
#
|
|
||||||
# mbed-2 yotta-compatible build system
|
|
||||||
#
|
|
||||||
|
|
||||||
# make sure necessary features are enabled:
|
|
||||||
project(mbed-classic)
|
|
||||||
enable_language(ASM)
|
|
||||||
|
|
||||||
# override compilation flags:
|
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES GNU)
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# the mbed.a library is built from two sets of source files + include
|
|
||||||
# directories:
|
|
||||||
#
|
|
||||||
# MBED_COMMON_SOURCES: the source files that are the same for all targets,
|
|
||||||
# these are easily found by globbing:
|
|
||||||
#
|
|
||||||
file(GLOB MBED_COMMON_SOURCES "common/*.cpp" "common/*.c")
|
|
||||||
#
|
|
||||||
# (always include the hal header directory, too)
|
|
||||||
set(MBED_COMMON_INCLUDE_DIRS "hal")
|
|
||||||
|
|
||||||
# and MBED_TARGET_SOURCES: these depend on which target we are building for. To
|
|
||||||
# find these we need to walk the directories in targets/, and wherever we see a
|
|
||||||
# TARGET_<something> name, recurse only if <something> matches what we're
|
|
||||||
# currently building for
|
|
||||||
macro(mbed_find_target_dirs PARENT_DIRECTORY SOURCES_LIST INCLUDES_LIST)
|
|
||||||
# append this directory to the search path:
|
|
||||||
list(APPEND ${INCLUDES_LIST} "${PARENT_DIRECTORY}")
|
|
||||||
# add all source files in this directory to the sources list:
|
|
||||||
file(GLOB sources "${PARENT_DIRECTORY}/*.cpp" "${PARENT_DIRECTORY}/*.c" "${PARENT_DIRECTORY}/*.s" "${PARENT_DIRECTORY}/*.S" )
|
|
||||||
list(APPEND ${SOURCES_LIST} ${sources})
|
|
||||||
|
|
||||||
# get a list of all subdirectories that we want to recurse into:
|
|
||||||
file(GLOB dir_children RELATIVE "${PARENT_DIRECTORY}" "${PARENT_DIRECTORY}/*")
|
|
||||||
set(matching_subdirs "")
|
|
||||||
foreach(child ${dir_children})
|
|
||||||
if(IS_DIRECTORY "${PARENT_DIRECTORY}/${child}")
|
|
||||||
# is this directory name a magic one?
|
|
||||||
if("${child}" MATCHES "^TARGET_")
|
|
||||||
# target-magic: recurse if the MBED_LEGACY_TARGET_DEFINITIONS **list**
|
|
||||||
# contains a matching value:
|
|
||||||
foreach(legacy_magic_def ${MBED_LEGACY_TARGET_DEFINITIONS})
|
|
||||||
# we could probably unroll the list into a single regex if
|
|
||||||
# this is a performance problem:
|
|
||||||
if("${child}" MATCHES "^TARGET_${legacy_magic_def}$")
|
|
||||||
list(APPEND matching_subdirs ${child})
|
|
||||||
break()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
elseif("${child}" MATCHES "^TOOLCHAIN_")
|
|
||||||
# toolchain-magic: (recurse if the MBED_LEGACY_TOOLCHAIN matches
|
|
||||||
# this name)
|
|
||||||
if("${child}" MATCHES "^TOOLCHAIN_${MBED_LEGACY_TOOLCHAIN}$")
|
|
||||||
list(APPEND matching_subdirs "${child}")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
# not special: always recurse into this directory
|
|
||||||
list(APPEND matching_subdirs "${child}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
#message("matching_subdirs: ${matching_subdirs}")
|
|
||||||
|
|
||||||
# recurse:
|
|
||||||
foreach(subdir ${matching_subdirs})
|
|
||||||
mbed_find_target_dirs("${PARENT_DIRECTORY}/${subdir}" ${SOURCES_LIST} ${INCLUDES_LIST})
|
|
||||||
endforeach()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
set(MBED_TARGET_SOURCES "")
|
|
||||||
set(MBED_TARGET_INCLUDE_DIRS "")
|
|
||||||
mbed_find_target_dirs("${CMAKE_CURRENT_SOURCE_DIR}/targets" MBED_TARGET_SOURCES MBED_TARGET_INCLUDE_DIRS)
|
|
||||||
#message("found target sources: ${MBED_TARGET_SOURCES}")
|
|
||||||
#message("found target include dirs: ${MBED_TARGET_INCLUDE_DIRS}")
|
|
||||||
|
|
||||||
# unfortunately, for ARMCC, the startup code needs to be provided as an object
|
|
||||||
# on the command line (not as part of an archive). To do this we override the
|
|
||||||
# CMake add_executable command.
|
|
||||||
if(CMAKE_C_COMPILER_ID STREQUAL "ARMCC")
|
|
||||||
set(MBED_TARGET_STARTUP_CODE_SOURCES "")
|
|
||||||
foreach(src ${MBED_TARGET_SOURCES})
|
|
||||||
if("${src}" MATCHES .*startup_.*\\.[sS])
|
|
||||||
LIST(APPEND MBED_TARGET_STARTUP_CODE_SOURCES "${src}")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
add_library(mbed_classic_startupcod OBJECT ${MBED_TARGET_STARTUP_CODE_SOURCES})
|
|
||||||
macro (add_executable _name)
|
|
||||||
_add_executable(${ARGV} $<TARGET_OBJECTS:mbed_classic_startupcod>)
|
|
||||||
endmacro()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# we have to append any target-specific include dirs to the global include dirs
|
|
||||||
# list, so that any indirect includes (e.g. via mbed.h) of files in those
|
|
||||||
# directories will work:
|
|
||||||
# (non-target-specific include dirs are listed in extraIncludes in module.json)
|
|
||||||
foreach(dir ${MBED_TARGET_INCLUDE_DIRS})
|
|
||||||
set_property(GLOBAL APPEND PROPERTY YOTTA_GLOBAL_INCLUDE_DIRS ${dir})
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# finally, we can construct a library using the determined set of include paths
|
|
||||||
# + source files. Note that the library name must match the name of the yotta
|
|
||||||
# module (defined in module.json) for this module to link properly with other
|
|
||||||
# yotta modules.
|
|
||||||
include_directories(${MBED_COMMON_INCLUDE_DIRS})
|
|
||||||
include_directories(${MBED_TARGET_INCLUDE_DIRS})
|
|
||||||
add_library(mbed-classic
|
|
||||||
${MBED_COMMON_SOURCES}
|
|
||||||
${MBED_TARGET_SOURCES}
|
|
||||||
)
|
|
|
@ -1,30 +0,0 @@
|
||||||
{
|
|
||||||
"name": "mbed-classic",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"description": "mbed core SDK (for mbed 2.0, *not* mbedOS)",
|
|
||||||
"keywords": [
|
|
||||||
"mbed"
|
|
||||||
],
|
|
||||||
"author": "Bogdan Marinescu <bogdan.marinescu@arm.com>",
|
|
||||||
"repository": {
|
|
||||||
"url": "git@github.com:mbedmicro/mbed.git",
|
|
||||||
"type": "git"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/mbedmicro/mbed",
|
|
||||||
"licenses": [
|
|
||||||
{
|
|
||||||
"url": "https://spdx.org/licenses/Apache-2.0",
|
|
||||||
"type": "Apache-2.0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"extraIncludes": [
|
|
||||||
"api",
|
|
||||||
"hal",
|
|
||||||
"targets/hal",
|
|
||||||
"targets/cmsis"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
|
||||||
},
|
|
||||||
"targetDependencies": {
|
|
||||||
}
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue