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/04/08 10:12:02 UTC

[GitHub] [mynewt-core] andrzej-kaczmarek commented on a change in pull request #1748: da1469x: Switch clocks properly

andrzej-kaczmarek commented on a change in pull request #1748: da1469x: Switch clocks properly
URL: https://github.com/apache/mynewt-core/pull/1748#discussion_r272974191
 
 

 ##########
 File path: hw/mcu/dialog/da1469x/src/hal_system.c
 ##########
 @@ -128,3 +107,20 @@ hal_reset_cause(void)
     return g_hal_reset_reason;
 #endif
 }
+
+static void
+da1469x_lpclk_settle_tmr_cb(void *arg)
+{
+    da1469x_clock_lp_xtal32k_switch();
+}
+
+void
+da1469x_lpclk_init(void)
+{
+    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, 8000 * 1000);
 
 Review comment:
   it will not explicitly wait, it will just defer switch (lp_clk will be rc32k during this time)

----------------------------------------------------------------
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