Skip to content

Commit 355aea5

Browse files
authored
Increase frequency tolerance in rtc_run_from_external_source
1 parent 2f3f420 commit 355aea5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • src/rp2_common/hardware_rtc

src/rp2_common/hardware_rtc/rtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ bool rtc_run_from_external_source(uint32_t src_hz, uint gpio_pin) {
194194
if (success) {
195195
// Ensure external source is actually running
196196
uint32_t rtc_freq = frequency_count_khz(CLOCKS_FC0_SRC_VALUE_CLK_RTC);
197-
if (rtc_freq < ((RTC_CLOCK_FREQ_HZ / KHZ) - 1) || rtc_freq > ((RTC_CLOCK_FREQ_HZ / KHZ) + 1)) {
197+
if (rtc_freq < ((RTC_CLOCK_FREQ_HZ / KHZ) - 5) || rtc_freq > ((RTC_CLOCK_FREQ_HZ / KHZ) + 5)) {
198198
// Frequency is not within 1kHz of the expected frequency
199199
success = false;
200200
// reconfigure the clock to the default configuration

0 commit comments

Comments
 (0)