You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/01/12 14:33:17 UTC
[mynewt-core] 01/02: kernel/os: Define OS_TICKS_PER_SEC as syscfg
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit d966dbdafccfdd0203e9f613855484fe2a41f82c
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Mon Dec 7 14:54:23 2020 +0100
kernel/os: Define OS_TICKS_PER_SEC as syscfg
OS_TICKS_PER_SEC was previously defined in mcu specific header.
Now preprocessor definition is moved to os_time.h and taken
from syscfg to allow consistent way of changing it.
Severl MCUs already had this configurable in syscfg now
definition is common for all.
---
kernel/os/include/os/os_time.h | 10 ++++++++++
kernel/os/syscfg.yml | 5 +++++
2 files changed, 15 insertions(+)
diff --git a/kernel/os/include/os/os_time.h b/kernel/os/include/os/os_time.h
index ee51b14..8d42523 100644
--- a/kernel/os/include/os/os_time.h
+++ b/kernel/os/include/os/os_time.h
@@ -77,6 +77,16 @@ extern "C" {
#define INT32_MAX 0x7FFFFFFF
#endif
+#ifdef OS_TICKS_PER_SEC
+#warning "OS_TICKS_PER_SEC should be configured in syscfg"
+#else
+#if MYNEWT_VAL(OS_TICKS_PER_SEC)
+#define OS_TICKS_PER_SEC MYNEWT_VAL(OS_TICKS_PER_SEC)
+#else
+#error "Application, BSP or target must specify OS_TICKS_PER_SEC syscfg value"
+#endif
+#endif
+
typedef uint32_t os_time_t;
typedef int32_t os_stime_t;
#define OS_TIME_MAX UINT32_MAX
diff --git a/kernel/os/syscfg.yml b/kernel/os/syscfg.yml
index 7b53c04..8ee620f 100644
--- a/kernel/os/syscfg.yml
+++ b/kernel/os/syscfg.yml
@@ -145,6 +145,11 @@ syscfg.defs:
on error detection. Enabling this setting increases stack usage.
value: 0
+ OS_TICKS_PER_SEC:
+ description: 'Desired ticks frequency in Hz'
+ value:
+ restrictions: $notnull
+
OS_IDLE_TICKLESS_MS_MIN:
description: >
Minimum duration of tickless idle period in miliseconds.