Skip to content

Commit 71c9780

Browse files
authored
Merge pull request #12387 from AGlass0fMilk/objects-extensions
Add Objects Extensions Configuration Parameter to HAL
2 parents d089c86 + e1178be commit 71c9780

File tree

3 files changed

+38
-32
lines changed

3 files changed

+38
-32
lines changed

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_EP_AGORA/device.h

+12-15
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,18 @@
1717
#ifndef MBED_DEVICE_H
1818
#define MBED_DEVICE_H
1919

20-
21-
22-
23-
24-
25-
26-
27-
28-
29-
30-
31-
32-
33-
34-
3520
#include "objects.h"
3621

22+
/**
23+
* This allows applications and external libraries to provide
24+
* structs typically included in objects.h
25+
*
26+
* Useful if a chip doesn't have a certain peripheral (eg: CAN) but
27+
* can be equipped with one by external hardware (eg: CAN via SPI). This allows
28+
* the standard APIs to be used without any extra hacks.
29+
*/
30+
#if MBED_CONF_TARGET_ENABLE_OBJECTS_EXTENSIONS
31+
#include "objects_extensions.h"
32+
#endif
33+
3734
#endif

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/device.h

+12-15
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,18 @@
1818
#ifndef MBED_DEVICE_H
1919
#define MBED_DEVICE_H
2020

21-
22-
23-
24-
25-
26-
27-
28-
29-
30-
31-
32-
33-
34-
35-
3621
#include "objects.h"
3722

23+
/**
24+
* This allows applications and external libraries to provide
25+
* structs typically included in objects.h
26+
*
27+
* Useful if a chip doesn't have a certain peripheral (eg: CAN) but
28+
* can be equipped with one by external hardware (eg: CAN via SPI). This allows
29+
* the standard APIs to be used without any extra hacks.
30+
*/
31+
#if MBED_CONF_TARGET_ENABLE_OBJECTS_EXTENSIONS
32+
#include "objects_extensions.h"
33+
#endif
34+
3835
#endif

targets/targets.json

+14-2
Original file line numberDiff line numberDiff line change
@@ -11652,7 +11652,13 @@
1165211652
],
1165311653
"macros_add": [
1165411654
"CONFIG_GPIO_AS_PINRESET"
11655-
]
11655+
],
11656+
"config": {
11657+
"enable-objects-extensions": {
11658+
"help": "Enable inclusion of objects_extensions.h",
11659+
"value": false
11660+
}
11661+
}
1165611662
},
1165711663
"ARDUINO_NANO33BLE": {
1165811664
"inherits": [
@@ -14579,7 +14585,13 @@
1457914585
],
1458014586
"detect_code": [
1458114587
"2600"
14582-
]
14588+
],
14589+
"config": {
14590+
"enable-objects-extensions": {
14591+
"help": "Enable inclusion of objects_extensions.h",
14592+
"value": false
14593+
}
14594+
}
1458314595
},
1458414596
"IM880B": {
1458514597
"inherits": [

0 commit comments

Comments
 (0)