You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/09/04 21:26:08 UTC

[GitHub] [mynewt-core] wes3 commented on a change in pull request #1984: da1469x: enable switching to rcx clock source

wes3 commented on a change in pull request #1984: da1469x: enable switching to rcx clock source
URL: https://github.com/apache/mynewt-core/pull/1984#discussion_r320982529
 
 

 ##########
 File path: hw/mcu/dialog/da1469x/src/da1469x_lpclk.c
 ##########
 @@ -57,11 +63,18 @@ da1469x_lpclk_register_cmac_cb(da1469x_lpclk_cb *cb)
 void
 da1469x_lpclk_init(void)
 {
+#if MYNEWT_VAL(MCU_CLOCK_XTAL32K_SWITCH)
     static struct hal_timer lpclk_settle_tmr;
-
     da1469x_clock_lp_xtal32k_enable();
-
     os_cputime_timer_init(&lpclk_settle_tmr, da1469x_lpclk_settle_tmr_cb, NULL);
     os_cputime_timer_relative(&lpclk_settle_tmr,
                               MYNEWT_VAL(MCU_CLOCK_XTAL32K_SETTLE_TIME_MS) * 1000);
+#endif
+#if MYNEWT_VAL(MCU_CLOCK_RCX_SWITCH)
+    static struct hal_timer lpclk_settle_tmr;
+    da1469x_clock_lp_rcx_enable();
+    os_cputime_timer_init(&lpclk_settle_tmr, da1469x_lpclk_settle_tmr_cb, NULL);
+    os_cputime_timer_relative(&lpclk_settle_tmr,
+                              MYNEWT_VAL(MCU_CLOCK_RCX_SETTLE_TIME_MS) * 1000);
+#endif
 
 Review comment:
   I presume that either MCU_CLOCK_RCX_SWITCH or MCU_CLOCK_XTAL32K should be defined. If so, I think there should be some error if both are set to 0. Not sure if there is somewhere but if not it should be added.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services