summaryrefslogtreecommitdiff
path: root/nuttx/sched/clock_initialize.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-07-11 17:24:14 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-07-11 17:24:14 +0000
commitfb117bfced091fd2ee5a32f2ab39b6d7a48e0676 (patch)
tree5ff18dab2d32ec4643b3d664522b3ed018d0f60c /nuttx/sched/clock_initialize.c
parent4a528af5569e0385555ac4f5de09677f6bcef754 (diff)
downloadpx4-nuttx-fb117bfced091fd2ee5a32f2ab39b6d7a48e0676.tar.gz
px4-nuttx-fb117bfced091fd2ee5a32f2ab39b6d7a48e0676.tar.bz2
px4-nuttx-fb117bfced091fd2ee5a32f2ab39b6d7a48e0676.zip
mktime/gmtime_r moved and highly simplified
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1973 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/clock_initialize.c')
-rw-r--r--nuttx/sched/clock_initialize.c60
1 files changed, 32 insertions, 28 deletions
diff --git a/nuttx/sched/clock_initialize.c b/nuttx/sched/clock_initialize.c
index 7b63a6521..8dc8a00e8 100644
--- a/nuttx/sched/clock_initialize.c
+++ b/nuttx/sched/clock_initialize.c
@@ -1,7 +1,7 @@
-/************************************************************
+/****************************************************************************
* clock_initialize.c
*
- * Copyright (C) 2007 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,61 +31,65 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Included Files
- ************************************************************/
+ ****************************************************************************/
+#include <nuttx/config.h>
#include <sys/types.h>
+
#include <time.h>
#include <errno.h>
#include <debug.h>
+#include <nuttx/time.h>
+
#include "clock_internal.h"
-/************************************************************
+/****************************************************************************
* Definitions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Type Declarations
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Function Prototypes
- ************************************************************/
+ ****************************************************************************/
-/**********************************************************
+/**************************************************************************
* Public Constant Data
- **********************************************************/
+ **************************************************************************/
-/************************************************************
+/****************************************************************************
* Public Variables
- ************************************************************/
+ ****************************************************************************/
volatile uint32 g_system_timer = 0;
-struct timespec g_basetime = {0,0};
-uint32 g_tickbias = 0;
+struct timespec g_basetime = {0,0};
+uint32 g_tickbias = 0;
-/**********************************************************
+/**************************************************************************
* Private Variables
- **********************************************************/
+ **************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Public Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Function: clock_initialize
*
* Description:
* Perform one-time initialization of the timing facilities.
*
- ************************************************************/
+ ****************************************************************************/
void clock_initialize(void)
{
@@ -112,7 +116,7 @@ void clock_initialize(void)
g_tickbias = 0;
}
-/************************************************************
+/****************************************************************************
* Function: clock_timer
*
* Description:
@@ -120,7 +124,7 @@ void clock_initialize(void)
* time clock interrupt occurs. The interval of this
* clock interrupt must be MSEC_PER_TICK
*
- ************************************************************/
+ ****************************************************************************/
void clock_timer(void)
{