summaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2019-08-22 09:01:05 -0400
committerDan Halbert <halbert@halwitz.org>2019-08-22 09:01:05 -0400
commit0b7291d76726616ade481bb802994bcd81dbb98f (patch)
tree233aef7d53e407f82774dccece67b155e0c7fca8 /ports
parentacc6df49590bf9982a616a703393aba7ff5e07ba (diff)
fix default crystal value; fix include order
Diffstat (limited to 'ports')
-rw-r--r--ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h2
-rw-r--r--ports/nrf/common-hal/bleio/Adapter.c4
-rw-r--r--ports/nrf/mpconfigport.h10
-rw-r--r--ports/nrf/peripherals/nrf/clocks.c2
4 files changed, 8 insertions, 10 deletions
diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h
index c422dbd55..1e55cd026 100644
--- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h
+++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h
@@ -61,8 +61,6 @@
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
-#define BOARD_HAS_CRYSTAL 1
-
#define DEFAULT_I2C_BUS_SCL (&pin_P0_04)
#define DEFAULT_I2C_BUS_SDA (&pin_P0_05)
diff --git a/ports/nrf/common-hal/bleio/Adapter.c b/ports/nrf/common-hal/bleio/Adapter.c
index 463e5d25b..15ae8840b 100644
--- a/ports/nrf/common-hal/bleio/Adapter.c
+++ b/ports/nrf/common-hal/bleio/Adapter.c
@@ -51,12 +51,12 @@ STATIC uint32_t ble_stack_enable(void) {
.source = NRF_CLOCK_LF_SRC_XTAL,
.rc_ctiv = 0,
.rc_temp_ctiv = 0,
- .accuracy = NRF_CLOCK_LF_ACCURACY_20_PPM
+ .accuracy = NRF_CLOCK_LF_ACCURACY_20_PPM,
#else
.source = NRF_CLOCK_LF_SRC_RC,
.rc_ctiv = 16,
.rc_temp_ctiv = 2,
- .accuracy = NRF_CLOCK_LF_ACCURACY_250_PPM
+ .accuracy = NRF_CLOCK_LF_ACCURACY_250_PPM,
#endif
};
diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h
index 3f939b492..0b755a156 100644
--- a/ports/nrf/mpconfigport.h
+++ b/ports/nrf/mpconfigport.h
@@ -38,11 +38,6 @@
#define MICROPY_PY_UBINASCII (1)
#define MICROPY_PY_UJSON (1)
-#ifndef BOARD_HAS_32KHZ_XTAL
-// Assume crystal is present, which is the most common case.
-#define BOARD_HAS_32KHZ_XTAL (0)
-#endif
-
// TODO this is old BLE stuff
#if BLUETOOTH_SD
#define MICROPY_PY_BLEIO (1)
@@ -58,6 +53,11 @@
#include "py/circuitpy_mpconfig.h"
+#ifndef BOARD_HAS_32KHZ_XTAL
+// Assume crystal is present, which is the most common case.
+#define BOARD_HAS_32KHZ_XTAL (1)
+#endif
+
#define MICROPY_PORT_ROOT_POINTERS \
CIRCUITPY_COMMON_ROOT_POINTERS \
ble_drv_evt_handler_entry_t* ble_drv_evt_handler_entries; \
diff --git a/ports/nrf/peripherals/nrf/clocks.c b/ports/nrf/peripherals/nrf/clocks.c
index 67c748488..269365cc9 100644
--- a/ports/nrf/peripherals/nrf/clocks.c
+++ b/ports/nrf/peripherals/nrf/clocks.c
@@ -26,7 +26,7 @@
*/
#include "nrfx.h"
-#include "mpconfigboard.h"
+#include "mpconfigport.h"
void nrf_peripherals_clocks_init(void) {