You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ut...@apache.org on 2021/08/26 18:55:25 UTC
[mynewt-core] 03/03: hw: bsp: frdm-k82f: add TIMER_0/1
initialization
This is an automated email from the ASF dual-hosted git repository.
utzig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit 53befa6f414fb4944d5d38ae11e21c9a8e9f65b2
Author: Fabio Utzig <ut...@apache.org>
AuthorDate: Fri Aug 20 19:01:48 2021 -0300
hw: bsp: frdm-k82f: add TIMER_0/1 initialization
Signed-off-by: Fabio Utzig <ut...@apache.org>
---
hw/bsp/frdm-k82f/src/hal_bsp.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/bsp/frdm-k82f/src/hal_bsp.c b/hw/bsp/frdm-k82f/src/hal_bsp.c
index 5c75840..973d5ba 100644
--- a/hw/bsp/frdm-k82f/src/hal_bsp.c
+++ b/hw/bsp/frdm-k82f/src/hal_bsp.c
@@ -28,6 +28,9 @@
#include "hal/hal_flash_int.h"
#include "flash_map/flash_map.h"
#include "hal/hal_flash.h"
+#if MYNEWT_VAL(TIMER_0) || MYNEWT_VAL(TIMER_1)
+#include "hal/hal_timer.h"
+#endif
#if MYNEWT_VAL(ENC_FLASH_DEV)
#include <ef_crypto/ef_crypto.h>
#endif
@@ -247,6 +250,15 @@ hal_bsp_init(void)
init_hardware();
BOARD_BootClockRUN();
+#if MYNEWT_VAL(TIMER_0)
+ rc = hal_timer_init(0, NULL);
+ assert(rc == 0);
+#endif
+#if MYNEWT_VAL(TIMER_1)
+ rc = hal_timer_init(1, NULL);
+ assert(rc == 0);
+#endif
+
#if MYNEWT_VAL(HASH)
rc = os_dev_create(&os_bsp_hash.dev, "hash", OS_DEV_INIT_KERNEL,
OS_DEV_INIT_PRIO_DEFAULT, kinetis_hash_dev_init, NULL);