[riot-notifications] [RIOT-OS/RIOT] cc26x2_cc13x2: add oscillator switching functions (#13991)

benpicco notifications at github.com
Sat May 2 19:46:07 CEST 2020


@benpicco commented on this pull request.



> +           DDI_0_OSC_STAT0_SCLK_HF_SRC_s;
+}
+
+static inline void _hf_source_set(uint32_t osc)
+{
+    uint32_t mask = DDI_0_OSC_CTL0_SCLK_HF_SRC_SEL_m;
+    uint32_t ctl = osc << DDI_0_OSC_CTL0_SCLK_HF_SRC_SEL_s;
+
+    /* Use a 16-bit masked write, target bits are on the lower 16-bit
+     * half */
+    DDI_0_OSC_M16->CTL0.LOW = (mask << 16) | ctl;
+}
+
+void osc_hf_source_switch(uint32_t osc)
+{
+    if (_hf_source_get() == osc) {

Shouldn't this just return if the current clock already matches the requested clock?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/13991#pullrequestreview-404547059
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200502/460782b7/attachment-0001.htm>


More information about the notifications mailing list