Skip to content

Commit

Permalink
Fix CI for branch feature-public-headers (#11093)
Browse files Browse the repository at this point in the history
* Fix rtos include path in NRFCordioHCIDriver
* Flatten USB driver directory structure
* Add missing include for us_ticker
* Add more missing includes for us_ticker
* Fix mbed_hal_fpga_ci_test_shield/uart test
* Fix bare-metal build
* Fix Watchdog UNITTEST
* Fix Mbed OS 2 build for Public/Internal headers relocating
  • Loading branch information
gpsimenos authored and evedon committed Aug 2, 2019
1 parent 20f81e1 commit 3b23edb
Show file tree
Hide file tree
Showing 28 changed files with 36 additions and 8 deletions.
1 change: 1 addition & 0 deletions TESTS/mbed_hal/qspi/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include "mbed.h"
#include "qspi_api.h"
#include "hal/us_ticker_api.h"


#if !defined(QSPI_FLASH_CHIP_STRING)
Expand Down
1 change: 1 addition & 0 deletions TESTS/mbed_hal/qspi/qspi_test_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "utest/utest.h"

#include "hal/qspi_api.h"
#include "hal/us_ticker_api.h"
#include "qspi_test_utils.h"

#include "unity/unity.h"
Expand Down
1 change: 1 addition & 0 deletions TESTS/mbed_hal/sleep/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "unity/unity.h"
#include "greentea-client/test_env.h"
#include "mbed_lp_ticker_wrapper.h"
#include "hal/us_ticker_api.h"

#include "sleep_test_utils.h"
#include "sleep_api_tests.h"
Expand Down
1 change: 1 addition & 0 deletions TESTS/mbed_hal/sleep_manager/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <limits.h>
#include "mbed.h"
#include "mbed_lp_ticker_wrapper.h"
#include "hal/us_ticker_api.h"
#include "../sleep/sleep_test_utils.h"
#include "sleep_manager_api_tests.h"

Expand Down
2 changes: 2 additions & 0 deletions TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "unity/unity.h"
#include "greentea-client/test_env.h"

#include "platform/mbed_critical.h"

using namespace utest::v1;

#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion UNITTESTS/drivers/Watchdog/unittest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(unittest-includes ${unittest-includes}

# Source files
set(unittest-sources
../drivers/Watchdog.cpp
../drivers/source/Watchdog.cpp
)

# Test files
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions drivers/source/usb/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "usb"
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

// mbed Includes
#include "mbed_assert.h"
#include "rtos/rtos_idle.h"
#include "rtos/source/rtos_idle.h"
#include "platform/mbed_power_mgmt.h"
#include "mbed_critical.h"

Expand Down Expand Up @@ -368,7 +368,7 @@ bool NRFCordioHCIDriver::get_random_static_address(ble::address_t& address)
return true;
}

ble::vendor::cordio::CordioHCIDriver& ble_cordio_get_hci_driver() {
ble::vendor::cordio::CordioHCIDriver& ble_cordio_get_hci_driver() {
static NRFCordioHCITransportDriver transport_driver;

static NRFCordioHCIDriver hci_driver(
Expand Down
8 changes: 7 additions & 1 deletion tools/build_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,10 +1068,16 @@ def build_mbed_libs(target, toolchain_name, clean=False, macros=None,

incdirs = cmsis_res.inc_dirs + hal_res.inc_dirs + library_incdirs

# Exclude USB related source files from Mbed OS 2 build as they contain
# references to RTOS API which is also not included.
exclude_paths = [join(MBED_DRIVERS, "source", "usb")]

# Build Things
notify.info("Building library %s (%s, %s)" %
('MBED', target.name, toolchain_name))
objects = toolchain.compile_sources(mbed_resources, incdirs)
objects = toolchain.compile_sources(
mbed_resources, incdirs, exclude_paths
)
separate_objects = []

for obj in objects:
Expand Down
21 changes: 17 additions & 4 deletions tools/toolchains/mbed_toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,14 +397,27 @@ def get_arch_file(self, objects):

# THIS METHOD IS BEING CALLED BY THE MBED ONLINE BUILD SYSTEM
# ANY CHANGE OF PARAMETERS OR RETURN VALUES WILL BREAK COMPATIBILITY
def compile_sources(self, resources, inc_dirs=None):
def compile_sources(self, resources, inc_dirs=None, exclude_paths=None):
# Web IDE progress bar for project build
files_to_compile = (
resources.get_file_refs(FileType.ASM_SRC) +
resources.get_file_refs(FileType.C_SRC) +
resources.get_file_refs(FileType.CPP_SRC)
)
self.to_be_compiled = len(files_to_compile)
# Remove files from paths to be excluded from the build and create
# a compilation queue.
compile_queue = (
files_to_compile
if not exclude_paths
else [
file_to_compile
for exclude_path in exclude_paths
for file_to_compile in files_to_compile
if exclude_path not in file_to_compile.path
]
)

self.to_be_compiled = len(compile_queue)
self.compiled = 0

self.notify.cc_verbose("Macros: " + ' '.join([
Expand Down Expand Up @@ -434,8 +447,8 @@ def compile_sources(self, resources, inc_dirs=None):
self.dump_build_profile()

# Sort compile queue for consistency
files_to_compile.sort()
for source in files_to_compile:
compile_queue.sort()
for source in compile_queue:
object = self.relative_object_path(self.build_dir, source)

# Queue mode (multiprocessing)
Expand Down

0 comments on commit 3b23edb

Please sign in to comment.