Skip to content

Commit 382a554

Browse files
committed
Added object extensions configuration parameter to HAL
1 parent c8ab263 commit 382a554

File tree

2 files changed

+21
-15
lines changed
  • hal
  • targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_NRF52840_DK

2 files changed

+21
-15
lines changed

hal/mbed_lib.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "hal",
3+
"config": {
4+
"enable-objects-extensions": {
5+
"help": "Enable inclusion of objects_extensions.h",
6+
"value": false
7+
}
8+
}
9+
}

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_HAL_ENABLE_OBJECTS_EXTENSIONS
32+
#include "objects_extensions.h"
33+
#endif
34+
3835
#endif

0 commit comments

Comments
 (0)