dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
timeutils.c File Reference

Time conversion functions. More...

#include "timeutils.h"

Go to the source code of this file.

Macros

#define __isleap(year)   ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
 
#define SECS_PER_HOUR   (60 * 60)
 
#define SECS_PER_DAY   (SECS_PER_HOUR * 24)
 
#define DIV(a, b)   ((a) / (b) - ((a) % (b) < 0))
 
#define LEAPS_THRU_END_OF(y)   (DIV (y, 4) - DIV (y, 100) + DIV (y, 400))
 

Functions

void date_from_timestamp (uint32_t timestamp, DateTimeT *date_time)
 

Variables

static const uint16_t __mon_yday [2][13]
 

Detailed Description

Time conversion functions.

Author
Tau Labs, http://taulabs.org, Copyright (C) 2015 Free Software Foundation, Inc. (C) 1991-2015
See Also
The GNU Public License (GPL) Version 3

Definition in file timeutils.c.

Macro Definition Documentation

#define DIV (   a,
 
)    ((a) / (b) - ((a) % (b) < 0))
#define LEAPS_THRU_END_OF (   y)    (DIV (y, 4) - DIV (y, 100) + DIV (y, 400))