mirror of https://github.com/ARMmbed/mbed-os.git
Revise to improve readability
Delete the blank line. Use Marcos rather than magic numbers Put brace at end of the while linepull/3605/head
parent
ef26a4c0e7
commit
c6e0b9c20e
|
@ -18,21 +18,6 @@
|
||||||
#ifndef MBED_DEVICE_H
|
#ifndef MBED_DEVICE_H
|
||||||
#define MBED_DEVICE_H
|
#define MBED_DEVICE_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "objects.h"
|
#include "objects.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "cmsis.h"
|
#include "cmsis.h"
|
||||||
|
#include "PinNames.h"
|
||||||
|
|
||||||
void mbed_sdk_init()
|
void mbed_sdk_init()
|
||||||
{
|
{
|
||||||
|
@ -22,12 +23,12 @@ void mbed_sdk_init()
|
||||||
char* debug_time = __TIME__;
|
char* debug_time = __TIME__;
|
||||||
|
|
||||||
// Default RF switch setting, pull p19 to low and p28 to high for turning antenna switch to BLE radiated path
|
// Default RF switch setting, pull p19 to low and p28 to high for turning antenna switch to BLE radiated path
|
||||||
NRF_GPIO->PIN_CNF[19] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
|
NRF_GPIO->PIN_CNF[p19] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
|
||||||
| (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos)
|
| (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos)
|
||||||
| (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos)
|
| (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos)
|
||||||
| (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos)
|
| (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos)
|
||||||
| (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos);
|
| (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos);
|
||||||
NRF_GPIO->PIN_CNF[28] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
|
NRF_GPIO->PIN_CNF[p28] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
|
||||||
| (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos)
|
| (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos)
|
||||||
| (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos)
|
| (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos)
|
||||||
| (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos)
|
| (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos)
|
||||||
|
@ -40,8 +41,8 @@ void mbed_sdk_init()
|
||||||
NRF_CLOCK->XTALFREQ = 0x00;
|
NRF_CLOCK->XTALFREQ = 0x00;
|
||||||
NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
|
NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
|
||||||
NRF_CLOCK->TASKS_HFCLKSTART = 1;
|
NRF_CLOCK->TASKS_HFCLKSTART = 1;
|
||||||
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
|
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0) {
|
||||||
{// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue