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 2020/12/16 22:36:09 UTC

[GitHub] [mynewt-core] ncasaril commented on a change in pull request #2441: hw/mcu/nordic/nrf52xxx: Using hfxo_request and release. Addresses #2393.

ncasaril commented on a change in pull request #2441:
URL: https://github.com/apache/mynewt-core/pull/2441#discussion_r544672780



##########
File path: hw/mcu/nordic/nrf52xxx/src/hal_timer.c
##########
@@ -652,18 +653,7 @@ hal_timer_config(int timer_num, uint32_t freq_hz)
 
 #if MYNEWT_VAL_CHOICE(MCU_HFCLK_SOURCE, HFXO)
     /* Make sure HFXO is started */
-    if ((NRF_CLOCK->HFCLKSTAT &
-         (CLOCK_HFCLKSTAT_SRC_Msk | CLOCK_HFCLKSTAT_STATE_Msk)) !=
-        (CLOCK_HFCLKSTAT_SRC_Msk | CLOCK_HFCLKSTAT_STATE_Msk)) {
-        NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
-        NRF_CLOCK->TASKS_HFCLKSTART = 1;
-        while (1) {
-            if ((NRF_CLOCK->EVENTS_HFCLKSTARTED) != 0) {
-                break;
-            }
-        }
-    }
-#endif

Review comment:
       Thanks @kasjer. 
   
   In the hal_timer_deinit I've added the same ifdef around the release and also checking that it's not timer 5 to match hal_timer_config. 
   
   In the deinit, I realise that the if-statement checks for tmr_rtc which is only enabled for timer_num=5 and so the release could go into the else section there. However using the timer_num as in hal_timer_config may be easier to understand? 




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