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/03/22 12:09:46 UTC

[GitHub] [mynewt-core] andrzej-kaczmarek commented on a change in pull request #1715: time/timepersist; allow user to persist device time.

andrzej-kaczmarek commented on a change in pull request #1715: time/timepersist; allow user to persist device time.
URL: https://github.com/apache/mynewt-core/pull/1715#discussion_r268141584
 
 

 ##########
 File path: time/timepersist/syscfg.yml
 ##########
 @@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+syscfg.defs:
+    TIMEPERSIST:
+        description: >
+            Report to other packages that timepersist() is available.
+        value: 1
+    TIMEPERSIST_SYSINIT_STAGE:
+        description: >
+            Sysinit stage for restoring persisted wallclock time.
+        value: 501
+    TIMEPERSIST_FREQ:
+        description: >
+            How frequently should the wallclock be persisted.
+            Unit is in seconds.
+        value: 60
+
+#
+# You can use either nvreg or sys/config for time persistence.
+#
+    TIMEPERSIST_NVREG_INDEX:
+        description: >
+            Index of retained register to use (using hal_nvreg) for storing
+            lower 32 bits of wallclock time.
+        value: -1
+    TIMEPERSIST_SYS_CONFIG:
+        description: >
+            Use sys/config to persist wallclock time.
+        value: 0
 
 Review comment:
   you could use choice for this, i.e.:
   ```
   TIMEPERSIST_STORE:
       description: foo
       value:
       choices:
           - nvreg
           - config
   ```
   then you can check in code which one is selected like this:
   ```
   #if MYNEWT_VAL_CHOICE(TIMEPERSIST_STORE, config)
   #endif
   ```
   and you don't have to worry if both are enabled because it's not possible

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