Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Removed redundant RTC->CR define code + added RTC compensation code to allow calibration of the RTC.
Tom Russell found the RTC->CR settings in the rtc_api.c file overrode the OSC0->CR setting in system_MKL05Z4.c.
Effectively removing the internal loading capacitors for the external 32KHz crystal when the RTC is initialised.
If the external crystal 32Khz clock source is selected (default on the KL05), it is not necessary to call the RTC->CR functions. All other FRDM KLxx platforms RTC clock source is derived from the interface MCU.
Added RTC compensation function to allow calibration of the RTC.
This needs to be set in the rtc_init area, according to the manual, once the locks are enabled they can only be disabled with a POR or software reset making it difficult, probably impossible to place it in the user program code.