Skip to content

Commit 14482bc

Browse files
committed
Added support for using the Low Frequency RC oscillator
1 parent a07fbec commit 14482bc

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
@@ -230,6 +230,21 @@ err_t AdafruitBluefruit::begin(uint8_t prph_count, uint8_t central_count)
230230
.accuracy = NRF_CLOCK_LF_ACCURACY_20_PPM
231231
#endif
232232
};
233+
#elif defined( USE_LFRC )
234+
nrf_clock_lf_cfg_t clock_cfg =
235+
{
236+
// LXRC
237+
.source = NRF_CLOCK_LF_SRC_RC,
238+
.rc_ctiv = 8, //16
239+
.rc_temp_ctiv = 2,
240+
#if SD_VER < 500
241+
.xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM
242+
#else
243+
.accuracy = NRF_CLOCK_LF_ACCURACY_20_PPM
244+
#endif
245+
};
246+
#else
247+
#error Clock Source is not configured, define USE_LFXO or USE_LFRC according to your board
233248
#endif
234249

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

0 commit comments

Comments
 (0)