You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by we...@apache.org on 2016/10/25 03:23:28 UTC

incubator-mynewt-core git commit: MYNEWT-459: Fix hal_timer_get_resolution for stm32f4.

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop b5f49e425 -> 74d828cb7


MYNEWT-459: Fix hal_timer_get_resolution for stm32f4.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/74d828cb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/74d828cb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/74d828cb

Branch: refs/heads/develop
Commit: 74d828cb795cc37312b4d5b7ab03d68fe4493ad1
Parents: b5f49e4
Author: William San Filippo <wi...@runtime.io>
Authored: Mon Oct 24 20:22:48 2016 -0700
Committer: William San Filippo <wi...@runtime.io>
Committed: Mon Oct 24 20:23:23 2016 -0700

----------------------------------------------------------------------
 hw/mcu/stm/stm32f4xx/src/hal_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/74d828cb/hw/mcu/stm/stm32f4xx/src/hal_timer.c
----------------------------------------------------------------------
diff --git a/hw/mcu/stm/stm32f4xx/src/hal_timer.c b/hw/mcu/stm/stm32f4xx/src/hal_timer.c
index 86d196c..6c912f1 100644
--- a/hw/mcu/stm/stm32f4xx/src/hal_timer.c
+++ b/hw/mcu/stm/stm32f4xx/src/hal_timer.c
@@ -388,7 +388,7 @@ hal_timer_get_resolution(int num)
     if (num >= STM32F4_HAL_TIMER_MAX || !(tmr = stm32f4_tmr_devs[num])) {
         return -1;
     }
-    return SystemCoreClock / tmr->sht_regs->PSC;
+    return (1000000000 / (SystemCoreClock / tmr->sht_regs->PSC));
 }
 
 static uint32_t