Skip to content

Commit c6e0b9c

Browse files
committed
Revise to improve readability
Delete the blank line. Use Marcos rather than magic numbers Put brace at end of the while line
1 parent ef26a4c commit c6e0b9c

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/device.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,6 @@
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

3823
#endif

targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/mbed_overrides.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,20 @@
1515
*/
1616

1717
#include "cmsis.h"
18+
#include "PinNames.h"
1819

1920
void mbed_sdk_init()
2021
{
2122
char* debug_date = __DATE__;
2223
char* debug_time = __TIME__;
2324

2425
// Default RF switch setting, pull p19 to low and p28 to high for turning antenna switch to BLE radiated path
25-
NRF_GPIO->PIN_CNF[19] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
26+
NRF_GPIO->PIN_CNF[p19] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
2627
| (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos)
2728
| (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos)
2829
| (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos)
2930
| (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos);
30-
NRF_GPIO->PIN_CNF[28] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
31+
NRF_GPIO->PIN_CNF[p28] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
3132
| (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos)
3233
| (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos)
3334
| (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos)
@@ -40,8 +41,8 @@ void mbed_sdk_init()
4041
NRF_CLOCK->XTALFREQ = 0x00;
4142
NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
4243
NRF_CLOCK->TASKS_HFCLKSTART = 1;
43-
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
44-
{// Do nothing.
44+
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0) {
45+
// Do nothing.
4546
}
4647

4748
}

0 commit comments

Comments
 (0)