Skip to content

Commit 2b229f4

Browse files
committed
move USE_LFXO/USE_LFRC to variant.h
1 parent a7f8694 commit 2b229f4

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

libraries/Bluefruit52Lib/src/bluefruit.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,10 @@ err_t AdafruitBluefruit::begin(uint8_t prph_count, uint8_t central_count)
257257
.source = NRF_CLOCK_LF_SRC_RC,
258258
.rc_ctiv = 16,
259259
.rc_temp_ctiv = 2,
260-
#if SD_VER < 500
261-
.xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM
262-
#else
263260
.accuracy = NRF_CLOCK_LF_ACCURACY_250_PPM
264-
#endif
265261
};
266262
#else
267-
#error Clock Source is not configured, define USE_LFXO or USE_LFRC according to your board
263+
#error Clock Source is not configured, define USE_LFXO or USE_LFRC according to your board in variant.h
268264
#endif
269265

270266
VERIFY_STATUS( sd_softdevice_enable(&clock_cfg, nrf_error_cb) );

platform.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ nordic.path={build.core.path}/nordic
6060
# ARDUINO_FEATHER52 is defined for backward compatiable with other lib only
6161
# should be replaced by ARDUINO_NRF52_ADAFRUIT in the future
6262

63-
compiler.nrf.flags= -DARDUINO_FEATHER52 -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DUSE_LFXO {build.sd_flags} {build.debug_flags} "-I{build.core.path}/cmsis/include" "-I{nordic.path}" "-I{nordic.path}/nrfx" "-I{nordic.path}/nrfx/hal" "-I{nordic.path}/nrfx/mdk" "-I{nordic.path}/nrfx/soc" "-I{nordic.path}/nrfx/drivers/include" "-I{nordic.path}/softdevice/{build.sd_name}_nrf52_{build.sd_version}_API/include" "-I{rtos.path}/Source/include" "-I{rtos.path}/config" "-I{rtos.path}/portable/GCC/nrf52" "-I{rtos.path}/portable/CMSIS/nrf52" "-I{build.core.path}/sysview/SEGGER" "-I{build.core.path}/sysview/Config" "-I{build.core.path}/usb" "-I{build.core.path}/usb/tinyusb/src"
63+
compiler.nrf.flags= -DARDUINO_FEATHER52 -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES {build.sd_flags} {build.debug_flags} "-I{build.core.path}/cmsis/include" "-I{nordic.path}" "-I{nordic.path}/nrfx" "-I{nordic.path}/nrfx/hal" "-I{nordic.path}/nrfx/mdk" "-I{nordic.path}/nrfx/soc" "-I{nordic.path}/nrfx/drivers/include" "-I{nordic.path}/softdevice/{build.sd_name}_nrf52_{build.sd_version}_API/include" "-I{rtos.path}/Source/include" "-I{rtos.path}/config" "-I{rtos.path}/portable/GCC/nrf52" "-I{rtos.path}/portable/CMSIS/nrf52" "-I{build.core.path}/sysview/SEGGER" "-I{build.core.path}/sysview/Config" "-I{build.core.path}/usb" "-I{build.core.path}/usb/tinyusb/src"
6464

6565
# These can be overridden in platform.local.txt
6666
compiler.c.extra_flags=

variants/feather_nrf52832/variant.h

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
/** Master clock frequency */
2323
#define VARIANT_MCK (64000000ul)
2424

25+
#define USE_LFXO // Board uses 32khz crystal for LF
26+
// define USE_LFRC // Board uses RC for LF
27+
2528
/*----------------------------------------------------------------------------
2629
* Headers
2730
*----------------------------------------------------------------------------*/

variants/feather_nrf52840_express/variant.h

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
/** Master clock frequency */
2323
#define VARIANT_MCK (64000000ul)
2424

25+
#define USE_LFXO // Board uses 32khz crystal for LF
26+
// define USE_LFRC // Board uses RC for LF
27+
2528
/*----------------------------------------------------------------------------
2629
* Headers
2730
*----------------------------------------------------------------------------*/

variants/pca10056/variant.h

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
/** Master clock frequency */
2323
#define VARIANT_MCK (64000000ul)
2424

25+
#define USE_LFXO // Board uses 32khz crystal for LF
26+
// define USE_LFRC // Board uses RC for LF
27+
2528
/*----------------------------------------------------------------------------
2629
* Headers
2730
*----------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)