diff --git a/hal/mbed_lib.json b/hal/mbed_lib.json deleted file mode 100644 index 3b73a21426..0000000000 --- a/hal/mbed_lib.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "hal", - "config": { - "enable-objects-extensions": { - "help": "Enable inclusion of objects_extensions.h", - "value": false - } - } -} diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_EP_AGORA/device.h b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_EP_AGORA/device.h index a1b18fa296..2971cbb4f0 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_EP_AGORA/device.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_EP_AGORA/device.h @@ -17,21 +17,18 @@ #ifndef MBED_DEVICE_H #define MBED_DEVICE_H - - - - - - - - - - - - - - - #include "objects.h" +/** + * This allows applications and external libraries to provide + * structs typically included in objects.h + * + * Useful if a chip doesn't have a certain peripheral (eg: CAN) but + * can be equipped with one by external hardware (eg: CAN via SPI). This allows + * the standard APIs to be used without any extra hacks. + */ +#if MBED_CONF_TARGET_ENABLE_OBJECTS_EXTENSIONS +#include "objects_extensions.h" +#endif + #endif diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/device.h b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/device.h index 911a625f56..6aa6358230 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/device.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/device.h @@ -28,7 +28,7 @@ * can be equipped with one by external hardware (eg: CAN via SPI). This allows * the standard APIs to be used without any extra hacks. */ -#if MBED_CONF_HAL_ENABLE_OBJECTS_EXTENSIONS +#if MBED_CONF_TARGET_ENABLE_OBJECTS_EXTENSIONS #include "objects_extensions.h" #endif diff --git a/targets/targets.json b/targets/targets.json index f51b33039d..b50531dc97 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -11652,7 +11652,13 @@ ], "macros_add": [ "CONFIG_GPIO_AS_PINRESET" - ] + ], + "config": { + "enable-objects-extensions": { + "help": "Enable inclusion of objects_extensions.h", + "value": false + } + } }, "ARDUINO_NANO33BLE": { "inherits": [ @@ -14579,7 +14585,13 @@ ], "detect_code": [ "2600" - ] + ], + "config": { + "enable-objects-extensions": { + "help": "Enable inclusion of objects_extensions.h", + "value": false + } + } }, "IM880B": { "inherits": [