Skip to content

Commit 3b23edb

Browse files
gpsimenosevedon
authored andcommitted
Fix CI for branch feature-public-headers (#11093)
* 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
1 parent 20f81e1 commit 3b23edb

File tree

28 files changed

+36
-8
lines changed

28 files changed

+36
-8
lines changed

TESTS/mbed_hal/qspi/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include "mbed.h"
2828
#include "qspi_api.h"
29+
#include "hal/us_ticker_api.h"
2930

3031

3132
#if !defined(QSPI_FLASH_CHIP_STRING)

TESTS/mbed_hal/qspi/qspi_test_utils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "utest/utest.h"
1818

1919
#include "hal/qspi_api.h"
20+
#include "hal/us_ticker_api.h"
2021
#include "qspi_test_utils.h"
2122

2223
#include "unity/unity.h"

TESTS/mbed_hal/sleep/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "unity/unity.h"
2525
#include "greentea-client/test_env.h"
2626
#include "mbed_lp_ticker_wrapper.h"
27+
#include "hal/us_ticker_api.h"
2728

2829
#include "sleep_test_utils.h"
2930
#include "sleep_api_tests.h"

TESTS/mbed_hal/sleep_manager/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <limits.h>
2020
#include "mbed.h"
2121
#include "mbed_lp_ticker_wrapper.h"
22+
#include "hal/us_ticker_api.h"
2223
#include "../sleep/sleep_test_utils.h"
2324
#include "sleep_manager_api_tests.h"
2425

TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#include "unity/unity.h"
2828
#include "greentea-client/test_env.h"
2929

30+
#include "platform/mbed_critical.h"
31+
3032
using namespace utest::v1;
3133

3234
#include <stdlib.h>

UNITTESTS/drivers/Watchdog/unittest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set(unittest-includes ${unittest-includes}
1212

1313
# Source files
1414
set(unittest-sources
15-
../drivers/Watchdog.cpp
15+
../drivers/source/Watchdog.cpp
1616
)
1717

1818
# Test files
File renamed without changes.
File renamed without changes.
File renamed without changes.

drivers/source/usb/mbed_lib.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "usb"
3+
}

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
// mbed Includes
2323
#include "mbed_assert.h"
24-
#include "rtos/rtos_idle.h"
24+
#include "rtos/source/rtos_idle.h"
2525
#include "platform/mbed_power_mgmt.h"
2626
#include "mbed_critical.h"
2727

@@ -368,7 +368,7 @@ bool NRFCordioHCIDriver::get_random_static_address(ble::address_t& address)
368368
return true;
369369
}
370370

371-
ble::vendor::cordio::CordioHCIDriver& ble_cordio_get_hci_driver() {
371+
ble::vendor::cordio::CordioHCIDriver& ble_cordio_get_hci_driver() {
372372
static NRFCordioHCITransportDriver transport_driver;
373373

374374
static NRFCordioHCIDriver hci_driver(

tools/build_api.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,10 +1068,16 @@ def build_mbed_libs(target, toolchain_name, clean=False, macros=None,
10681068

10691069
incdirs = cmsis_res.inc_dirs + hal_res.inc_dirs + library_incdirs
10701070

1071+
# Exclude USB related source files from Mbed OS 2 build as they contain
1072+
# references to RTOS API which is also not included.
1073+
exclude_paths = [join(MBED_DRIVERS, "source", "usb")]
1074+
10711075
# Build Things
10721076
notify.info("Building library %s (%s, %s)" %
10731077
('MBED', target.name, toolchain_name))
1074-
objects = toolchain.compile_sources(mbed_resources, incdirs)
1078+
objects = toolchain.compile_sources(
1079+
mbed_resources, incdirs, exclude_paths
1080+
)
10751081
separate_objects = []
10761082

10771083
for obj in objects:

tools/toolchains/mbed_toolchain.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,14 +397,27 @@ def get_arch_file(self, objects):
397397

398398
# THIS METHOD IS BEING CALLED BY THE MBED ONLINE BUILD SYSTEM
399399
# ANY CHANGE OF PARAMETERS OR RETURN VALUES WILL BREAK COMPATIBILITY
400-
def compile_sources(self, resources, inc_dirs=None):
400+
def compile_sources(self, resources, inc_dirs=None, exclude_paths=None):
401401
# Web IDE progress bar for project build
402402
files_to_compile = (
403403
resources.get_file_refs(FileType.ASM_SRC) +
404404
resources.get_file_refs(FileType.C_SRC) +
405405
resources.get_file_refs(FileType.CPP_SRC)
406406
)
407-
self.to_be_compiled = len(files_to_compile)
407+
# Remove files from paths to be excluded from the build and create
408+
# a compilation queue.
409+
compile_queue = (
410+
files_to_compile
411+
if not exclude_paths
412+
else [
413+
file_to_compile
414+
for exclude_path in exclude_paths
415+
for file_to_compile in files_to_compile
416+
if exclude_path not in file_to_compile.path
417+
]
418+
)
419+
420+
self.to_be_compiled = len(compile_queue)
408421
self.compiled = 0
409422

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

436449
# Sort compile queue for consistency
437-
files_to_compile.sort()
438-
for source in files_to_compile:
450+
compile_queue.sort()
451+
for source in compile_queue:
439452
object = self.relative_object_path(self.build_dir, source)
440453

441454
# Queue mode (multiprocessing)

0 commit comments

Comments
 (0)