Skip to content

Commit a7f8694

Browse files
authored
Merge pull request #144 from jeremypoulter/lfrc_support
Added support for using the Low Frequency RC oscillator
2 parents 5a6f760 + a6fa818 commit a7f8694

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

libraries/Bluefruit52Lib/src/bluefruit.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,21 @@ err_t AdafruitBluefruit::begin(uint8_t prph_count, uint8_t central_count)
250250
.rc_temp_ctiv = 0,
251251
.accuracy = NRF_CLOCK_LF_ACCURACY_20_PPM
252252
};
253+
#elif defined( USE_LFRC )
254+
nrf_clock_lf_cfg_t clock_cfg =
255+
{
256+
// LXRC
257+
.source = NRF_CLOCK_LF_SRC_RC,
258+
.rc_ctiv = 16,
259+
.rc_temp_ctiv = 2,
260+
#if SD_VER < 500
261+
.xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM
262+
#else
263+
.accuracy = NRF_CLOCK_LF_ACCURACY_250_PPM
264+
#endif
265+
};
266+
#else
267+
#error Clock Source is not configured, define USE_LFXO or USE_LFRC according to your board
253268
#endif
254269

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

0 commit comments

Comments
 (0)