Skip to content

Commit 66b51bb

Browse files
Capitalise all targets & set TARGET_NRF52_MICROBIT_V2 the main target.
1 parent da29773 commit 66b51bb

File tree

8 files changed

+32
-29
lines changed

8 files changed

+32
-29
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ as they are exposed via the Edge Connector to be used as normal GPIOs.
157157
To change this and use them for NFC you can perform the following changes:
158158
- Mbed: Update the `mbed_app.json` file to include a remove macro entry in the micro:bit target.
159159
```
160-
"NRF52_MICROBIT_v2": {
160+
"NRF52_MICROBIT_V2": {
161161
"target.macros_remove": ["CONFIG_NFCT_PINS_AS_GPIOS"]
162162
}
163163
```

TARGET_MCU_NRF52833/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ https://github.com/microbit-foundation/mbedos-microbit-v2-starter/pull/12#issuec
1616
Things we tried, and didn't work, to reduce the flash and RAM without having a
1717
custom linker file:
1818

19-
- Tried adding `"NRF52_MICROBIT_v1_43": { "overrides": { "target.restrict_size": "0x40000" } }`
19+
- Tried adding `"NRF52_MICROBIT_V1_43": { "overrides": { "target.restrict_size": "0x40000" } }`
2020
in `custom_targets.json`, didn't seem to produce a different hex file.
21-
- However adding `"NRF52_MICROBIT_v1_43": { "target.restrict_size": "0x40000" }`
21+
- However adding `"NRF52_MICROBIT_V1_43": { "target.restrict_size": "0x40000" }`
2222
to the `mbed_app.json` file did produce a different hex file, so we assume
2323
it works?
24-
- Tried adding ` "NRF52_MICROBIT_v1_43": { "macros_add": ["MBED_RAM_SIZE=0x20000"]}`
24+
- Tried adding ` "NRF52_MICROBIT_V1_43": { "macros_add": ["MBED_RAM_SIZE=0x20000"]}`
2525
in `custom_targets.json` but didn't work (nRF52833 didn't do anything).
26-
- Tried adding `"NRF52_MICROBIT_v1_43": { "target.macros_add": ["MBED_RAM_SIZE=0x20000""] }`
26+
- Tried adding `"NRF52_MICROBIT_V1_43": { "target.macros_add": ["MBED_RAM_SIZE=0x20000""] }`
2727
in `mbed_app.json`, but didn't work either (nRF52833 didn't do anything).
2828

2929

custom_targets.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
],
3030
"device_has_remove": ["ITM"]
3131
},
32-
"NRF52_MICROBIT_v1_43": {
32+
"NRF52_MICROBIT_V2": {
3333
"inherits": ["MCU_NRF52833"],
3434
"macros_add": [
3535
"WSF_MAX_HANDLERS=10",
@@ -55,23 +55,23 @@
5555
"lf_clock_src": "NRF_LF_SRC_RC"
5656
}
5757
},
58-
"NRF52_MICROBIT_v1_44": {
59-
"inherits": ["NRF52_MICROBIT_v1_43"]
58+
"NRF52_MICROBIT_V1_43": {
59+
"inherits": ["NRF52_MICROBIT_V2"]
6060
},
61-
"NRF52_MICROBIT_v1_45": {
62-
"inherits": ["NRF52_MICROBIT_v1_43"]
61+
"NRF52_MICROBIT_V1_44": {
62+
"inherits": ["NRF52_MICROBIT_V2"]
6363
},
64-
"NRF52_MICROBIT_v1_46": {
65-
"inherits": ["NRF52_MICROBIT_v1_43"]
64+
"NRF52_MICROBIT_V1_45": {
65+
"inherits": ["NRF52_MICROBIT_V2"]
6666
},
67-
"NRF52_MICROBIT_v1_47": {
68-
"inherits": ["NRF52_MICROBIT_v1_43"]
67+
"NRF52_MICROBIT_V1_46": {
68+
"inherits": ["NRF52_MICROBIT_V2"]
6969
},
70-
"NRF52_MICROBIT_v2": {
71-
"inherits": ["NRF52_MICROBIT_v1_43"]
70+
"NRF52_MICROBIT_V1_47": {
71+
"inherits": ["NRF52_MICROBIT_V2"]
7272
},
7373
"NRF52_MICROBIT_V2_IF_820": {
74-
"inherits": ["NRF52_MICROBIT_v1_43"],
74+
"inherits": ["NRF52_MICROBIT_V2"],
7575
"core": "Cortex-M4",
7676
"extra_labels_remove": [
7777
],

examples/sensors.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@
2525

2626

2727
// Different boards have different I2C addresses for the sensors
28-
#if defined(TARGET_NRF52_MICROBIT_v2)
28+
#if defined(TARGET_NRF52_MICROBIT_V1_43)
29+
// All TARGET_NRF52_MICROBIT_V1_4x targets are based on TARGET_NRF52_MICROBIT_V2,
30+
// so they all contain the TARGET_NRF52_MICROBIT_V2 macro as well.
31+
// Make sure any conditional compilation checks first for the V1_4x defines
32+
#define FXOS_ADDR (0x1F << 1)
33+
#define FXOS_PRESENT 1
2934
#define LSM_ACC_ADDR (0x19 << 1)
3035
#define LSM_MAG_ADDR (0x1E << 1)
3136
#define LSM_PRESENT 1
32-
#elif defined(TARGET_NRF52_MICROBIT_v1_43)
33-
#define FXOS_ADDR (0x1F << 1)
34-
#define FXOS_PRESENT 1
37+
#elif defined(TARGET_NRF52_MICROBIT_V2)
3538
#define LSM_ACC_ADDR (0x19 << 1)
3639
#define LSM_MAG_ADDR (0x1E << 1)
3740
#define LSM_PRESENT 1
@@ -48,7 +51,7 @@ FileHandle *mbed::mbed_override_console(int fd) {
4851

4952
int main(void) {
5053
// Initialise the serial
51-
54+
5255
char start_str[] = "Starting programme.\n";
5356
pc.write(start_str, strlen(start_str));
5457

@@ -100,7 +103,7 @@ int main(void) {
100103
#ifdef FXOS_PRESENT
101104
accFxos.getAxis(accFxosData);
102105
magFxos.getAxis(magFxosData);
103-
printf("FXOS Acc: [X:%d] [Y:%d] [Z:%d]\n", accFxosData.x, accFxosData.y, accFxosData.z);
106+
printf("\nFXOS Acc: [X:%d] [Y:%d] [Z:%d]\n", accFxosData.x, accFxosData.y, accFxosData.z);
104107
printf("FXOS Mag: [X:%d] [Y:%d] [Z:%d]\n", magFxosData.x, magFxosData.y, magFxosData.z);
105108
#endif
106109
#ifdef LSM_PRESENT

mbed_app.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
"NRF52833_DK": {
88
"target.lf_clock_src": "NRF_LF_SRC_RC"
99
},
10-
"NRF52_MICROBIT_v1_43": {
10+
"NRF52_MICROBIT_V1_43": {
1111
},
12-
"NRF52_MICROBIT_v1_44": {
12+
"NRF52_MICROBIT_V1_44": {
1313
},
14-
"NRF52_MICROBIT_v1_45": {
14+
"NRF52_MICROBIT_V1_45": {
1515
},
16-
"NRF52_MICROBIT_v1_46": {
16+
"NRF52_MICROBIT_V1_46": {
1717
},
18-
"NRF52_MICROBIT_v1_47": {
18+
"NRF52_MICROBIT_V1_47": {
1919
},
20-
"NRF52_MICROBIT_v2": {
20+
"NRF52_MICROBIT_V2": {
2121
},
2222
"NRF52_MICROBIT_V2_IF_820": {
2323
},

0 commit comments

Comments
 (0)