Revision f38aba21

View differences:

core/inc/aos_time.h
33 33
/* CONSTANTS                                                                  */
34 34
/******************************************************************************/
35 35

  
36
#define MICROSECONDS_PER_MICROSECOND  ((uint8_t)  (1))
37
#define MILLISECONDS_PER_MILLISECOND  ((uint8_t)  (1))
38
#define SECONDS_PER_SECOND            ((uint8_t)  (1))
39
#define MINUTES_PER_MINUTE            ((uint8_t)  (1))
40
#define HOURS_PER_HOUR                ((uint8_t)  (1))
41
#define DAYS_PER_DAY                  ((uint8_t)  (1))
42
#define WEEKS_PER_WEEK                ((uint8_t)  (1))
43
#define MONTHS_PER_MONTH              ((uint8_t)  (1))
44
#define YEARS_PER_YEAR                ((uint8_t)  (1))
45
#define DECADES_PER_DECADE            ((uint8_t)  (1))
46
#define CENTURIES_PER_CENTURY         ((uint8_t)  (1))
47
#define MILLENIUMS_PER_MILLENIUM      ((uint8_t)  (1))
48

  
49
#define MICROSECONDS_PER_MILLISECOND  ((uint16_t) (1000))
50
#define MILLISECONDS_PER_SECOND       ((uint16_t) (1000))
51
#define SECONDS_PER_MINUTE            ((uint8_t)  (60))
52
#define MINUTES_PER_HOUR              ((uint8_t)  (60))
53
#define HOURS_PER_DAY                 ((uint8_t)  (24))
54
#define DAYS_PER_WEEK                 ((uint8_t)  (7))
55
#define DAYS_PER_YEAR                 ((float)    (365.25f))
56
#define MONTHS_PER_YEAR               ((uint8_t)  (12))
57
#define YEARS_PER_DECADE              ((uint8_t)  (10))
58
#define DECADES_PER_CENTURY           ((uint8_t)  (10))
59
#define CENTURIES_PER_MILLENIUM       ((uint8_t)  (10))
60

  
61
#define MICROSECONDS_PER_SECOND       ((uint32_t) ((uint32_t)MICROSECONDS_PER_MILLISECOND * (uint32_t)MILLISECONDS_PER_SECOND))
62
#define MILLISECONDS_PER_MINUTE       ((uint16_t) ((uint16_t)MILLISECONDS_PER_SECOND * (uint16_t)SECONDS_PER_MINUTE))
63
#define SECONDS_PER_HOUR              ((uint16_t) ((uint16_t)SECONDS_PER_MINUTE * (uint16_t)MINUTES_PER_HOUR))
64
#define MINUTES_PER_DAY               ((uint16_t) ((uint16_t)MINUTES_PER_HOUR * (uint16_t)HOURS_PER_DAY))
65
#define HOURS_PER_WEEK                ((uint8_t)  (HOURS_PER_DAY * DAYS_PER_WEEK))
66
#define HOURS_PER_YEAR                ((uint16_t) ((float)HOURS_PER_DAY * DAYS_PER_YEAR))
67
#define DAYS_PER_MONTH                ((float)    (DAYS_PER_YEAR / (float)MONTHS_PER_YEAR))
68
#define DAYS_PER_DECADE               ((float)    (DAYS_PER_YEAR * (float)YEARS_PER_DECADE))
69
#define WEEKS_PER_YEAR                ((float)    (DAYS_PER_YEAR / (float)DAYS_PER_WEEK))
70
#define MONTHS_PER_DECADE             ((uint8_t)  (MONTHS_PER_YEAR * YEARS_PER_DECADE))
71
#define YEARS_PER_CENTURY             ((uint8_t)  (YEARS_PER_DECADE * DECADES_PER_CENTURY))
72
#define DECADES_PER_MILLENIUM         ((uint8_t)  (DECADES_PER_CENTURY * CENTURIES_PER_MILLENIUM))
73

  
74
#define MICROSECONDS_PER_MINUTE       ((uint32_t) ((uint32_t)MICROSECONDS_PER_MILLISECOND * (uint32_t)MILLISECONDS_PER_MINUTE))
75
#define MILLISECONDS_PER_HOUR         ((uint32_t) ((uint32_t)MILLISECONDS_PER_SECOND * (uint32_t)SECONDS_PER_HOUR))
76
#define SECONDS_PER_DAY               ((uint32_t) ((uint32_t)SECONDS_PER_MINUTE * (uint32_t)MINUTES_PER_DAY))
77
#define MINUTES_PER_WEEK              ((uint16_t) ((uint16_t)MINUTES_PER_HOUR * (uint16_t)HOURS_PER_WEEK))
78
#define HOURS_PER_MONTH               ((float)    ((float)HOURS_PER_DAY * DAYS_PER_MONTH))
79
#define HOURS_PER_DECADE              ((uint32_t) ((float)HOURS_PER_DAY * DAYS_PER_DECADE))
80
#define MINUTES_PER_YEAR              ((uint32_t) ((uint32_t)MINUTES_PER_HOUR * (uint32_t)HOURS_PER_YEAR))
81
#define DAYS_PER_CENTURY              ((uint16_t) (DAYS_PER_YEAR * (float)YEARS_PER_CENTURY))
82
#define WEEKS_PER_MONTH               ((float)    (DAYS_PER_MONTH / (float)DAYS_PER_WEEK))
83
#define WEEKS_PER_DECADE              ((float)    (DAYS_PER_DECADE / (float)DAYS_PER_WEEK))
84
#define MONTHS_PER_CENTURY            ((uint16_t) ((uint16_t)MONTHS_PER_YEAR * (uint16_t)YEARS_PER_CENTURY))
85
#define YEARS_PER_MILLENIUM           ((uint16_t) ((uint16_t)YEARS_PER_DECADE * (uint16_t)DECADES_PER_MILLENIUM))
86

  
87
#define MICROSECONDS_PER_HOUR         ((uint32_t) ((uint32_t)MICROSECONDS_PER_MILLISECOND * MILLISECONDS_PER_HOUR))
88
#define MILLISECONDS_PER_DAY          ((uint32_t) ((uint32_t)MILLISECONDS_PER_SECOND * SECONDS_PER_DAY))
89
#define SECONDS_PER_WEEK              ((uint32_t) (SECONDS_PER_MINUTE * (uint32_t)MINUTES_PER_WEEK))
90
#define SECONDS_PER_YEAR              ((uint32_t) (SECONDS_PER_MINUTE * MINUTES_PER_YEAR))
91
#define MINUTES_PER_MONTH             ((uint16_t) ((float)MINUTES_PER_HOUR * HOURS_PER_MONTH))
92
#define MINUTES_PER_DECADE            ((uint32_t) ((uint32_t)MINUTES_PER_HOUR * HOURS_PER_DECADE))
93
#define HOURS_PER_CENTURY             ((uint32_t) ((uint32_t)HOURS_PER_DAY * (uint32_t)DAYS_PER_CENTURY))
94
#define DAYS_PER_MILLENIUM            ((uint32_t) (DAYS_PER_YEAR * (float)YEARS_PER_MILLENIUM))
95
#define WEEKS_PER_CENTURY             ((float)    ((float)DAYS_PER_CENTURY / (float)DAYS_PER_WEEK))
96
#define MONTHS_PER_MILLENIUM          ((uint16_t) ((uint16_t)MONTHS_PER_YEAR * YEARS_PER_MILLENIUM))
97

  
98
#define MICROSECONDS_PER_DAY          ((uint64_t) ((uint64_t)MICROSECONDS_PER_MILLISECOND * (uint64_t)MILLISECONDS_PER_DAY))
99
#define MILLISECONDS_PER_WEEK         ((uint32_t) ((uint32_t)MILLISECONDS_PER_SECOND * SECONDS_PER_WEEK))
100
#define MILLISECONDS_PER_YEAR         ((uint64_t) ((uint64_t)MILLISECONDS_PER_SECOND * (uint64_t)SECONDS_PER_YEAR))
101
#define SECONDS_PER_MONTH             ((uint32_t) ((uint32_t)SECONDS_PER_MINUTE * (uint32_t)MINUTES_PER_MONTH))
102
#define SECONDS_PER_DECADE            ((uint32_t) ((uint32_t)SECONDS_PER_MINUTE * MINUTES_PER_DECADE))
103
#define MINUTES_PER_CENTURY           ((uint32_t) ((uint32_t)MINUTES_PER_HOUR * HOURS_PER_CENTURY))
104
#define HOURS_PER_MILLENIUM           ((uint32_t) ((uint32_t)HOURS_PER_DAY * DAYS_PER_MILLENIUM))
105
#define WEEKS_PER_MILLENIUM           ((float)    ((float)DAYS_PER_MILLENIUM / (float)DAYS_PER_WEEK))
106

  
107
#define MICROSECONDS_PER_WEEK         ((uint64_t) ((uint64_t)MICROSECONDS_PER_MILLISECOND * (uint64_t)MILLISECONDS_PER_WEEK))
108
#define MICROSECONDS_PER_YEAR         ((uint64_t) ((uint64_t)MICROSECONDS_PER_MILLISECOND * MILLISECONDS_PER_YEAR))
109
#define MILLISECONDS_PER_MONTH        ((uint32_t) ((uint32_t)MILLISECONDS_PER_SECOND * SECONDS_PER_MONTH))
110
#define MILLISECONDS_PER_DECADE       ((uint64_t) ((uint64_t)MILLISECONDS_PER_SECOND * (uint64_t)SECONDS_PER_DECADE))
111
#define SECONDS_PER_CENTURY           ((uint32_t) (SECONDS_PER_MINUTE * MINUTES_PER_CENTURY))
112
#define MINUTES_PER_MILLENIUM         ((uint32_t) ((uint32_t)MINUTES_PER_HOUR * HOURS_PER_MILLENIUM))
113

  
114
#define MICROSECONDS_PER_MONTH        ((uint64_t) ((uint64_t)MICROSECONDS_PER_MILLISECOND * (uint64_t)MILLISECONDS_PER_MONTH))
115
#define MICROSECONDS_PER_DECADE       ((uint64_t) ((uint64_t)MICROSECONDS_PER_MILLISECOND * MILLISECONDS_PER_DECADE))
116
#define MILLISECONDS_PER_CENTURY      ((uint64_t) ((uint64_t)MILLISECONDS_PER_SECOND * (uint64_t)SECONDS_PER_CENTURY))
117
#define SECONDS_PER_MILLENIUM         ((uint64_t) ((uint64_t)SECONDS_PER_MINUTE * (uint64_t)MINUTES_PER_MILLENIUM))
118

  
119
#define MICROSECONDS_PER_CENTURY      ((uint64_t) ((uint64_t)MICROSECONDS_PER_MILLISECOND * MILLISECONDS_PER_CENTURY))
120
#define MILLISECONDS_PER_MILLENIUM    ((uint64_t) ((uint64_t)MILLISECONDS_PER_SECOND * SECONDS_PER_MILLENIUM))
121

  
122
#define MICROSECONDS_PER_MILLENIUM    ((uint64_t) ((uint64_t)MICROSECONDS_PER_MILLISECOND * MILLISECONDS_PER_MILLENIUM))
123

  
124
#define MILLISECONDS_PER_MICROSECOND  ((float)MILLISECONDS_PER_MILLISECOND / (float)MICROSECONDS_PER_MILLISECOND)
125

  
126
#define SECONDS_PER_MICROSECOND       ((float)SECONDS_PER_SECOND / (float)MICROSECONDS_PER_SECOND)
127
#define SECONDS_PER_MILLISECOND       ((float)SECONDS_PER_SECOND / (float)MILLISECONDS_PER_SECOND)
128

  
129
#define MINUTES_PER_MICROSECOND       ((float)MINUTES_PER_MINUTE / (float)MICROSECONDS_PER_MINUTE)
130
#define MINUTES_PER_MILLISECOND       ((float)MINUTES_PER_MINUTE / (float)MILLISECONDS_PER_MINUTE)
131
#define MINUTES_PER_SECOND            ((float)MINUTES_PER_MINUTE / (float)SECONDS_PER_MINUTE)
132

  
133
#define HOURS_PER_MICROSECOND         ((float)HOURS_PER_HOUR / (float)MICROSECONDS_PER_HOUR)
134
#define HOURS_PER_MILLISECOND         ((float)HOURS_PER_HOUR / (float)MILLISECONDS_PER_HOUR)
135
#define HOURS_PER_SECOND              ((float)HOURS_PER_HOUR / (float)SECONDS_PER_HOUR)
136
#define HOURS_PER_MINUTE              ((float)HOURS_PER_HOUR / (float)MINUTES_PER_HOUR)
137

  
138
#define DAYS_PER_MICROSECOND          ((float)DAYS_PER_DAY / (float)MICROSECONDS_PER_DAY)
139
#define DAYS_PER_MILLISECOND          ((float)DAYS_PER_DAY / (float)MILLISECONDS_PER_DAY)
140
#define DAYS_PER_SECOND               ((float)DAYS_PER_DAY / (float)SECONDS_PER_DAY)
141
#define DAYS_PER_MINUTE               ((float)DAYS_PER_DAY / (float)MINUTES_PER_DAY)
142
#define DAYS_PER_HOUR                 ((float)DAYS_PER_DAY / (float)HOURS_PER_DAY)
143

  
144
#define WEEKS_PER_MICROSECOND         ((float)WEEKS_PER_WEEK / (float)MICROSECONDS_PER_WEEK)
145
#define WEEKS_PER_MILLISECOND         ((float)WEEKS_PER_WEEK / (float)MILLISECONDS_PER_WEEK)
146
#define WEEKS_PER_SECOND              ((float)WEEKS_PER_WEEK / (float)SECONDS_PER_WEEK)
147
#define WEEKS_PER_MINUTE              ((float)WEEKS_PER_WEEK / (float)MINUTES_PER_WEEK)
148
#define WEEKS_PER_HOUR                ((float)WEEKS_PER_WEEK / (float)HOURS_PER_WEEK)
149
#define WEEKS_PER_DAY                 ((float)WEEKS_PER_WEEK / (float)DAYS_PER_WEEK)
150

  
151
#define MONTHS_PER_MICROSECOND        ((float)MONTHS_PER_MONTH / (float)MICROSECONDS_PER_MONTH)
152
#define MONTHS_PER_MILLISECOND        ((float)MONTHS_PER_MONTH / (float)MILLISECONDS_PER_MONTH)
153
#define MONTHS_PER_SECOND             ((float)MONTHS_PER_MONTH / (float)SECONDS_PER_MONTH)
154
#define MONTHS_PER_MINUTE             ((float)MONTHS_PER_MONTH / (float)MINUTES_PER_MONTH)
155
#define MONTHS_PER_HOUR               ((float)MONTHS_PER_MONTH / (float)HOURS_PER_MONTH)
156
#define MONTHS_PER_DAY                ((float)MONTHS_PER_MONTH / (float)DAYS_PER_MONTH)
157
#define MONTHS_PER_WEEK               ((float)MONTHS_PER_MONTH / (float)WEEKS_PER_MONTH)
158

  
159
#define YEARS_PER_MICROSECOND         ((float)YEARS_PER_YEAR / (float)MICROSECONDS_PER_YEAR)
160
#define YEARS_PER_MILLISECOND         ((float)YEARS_PER_YEAR / (float)MILLISECONDS_PER_YEAR)
161
#define YEARS_PER_SECOND              ((float)YEARS_PER_YEAR / (float)SECONDS_PER_YEAR)
162
#define YEARS_PER_MINUTE              ((float)YEARS_PER_YEAR / (float)MINUTES_PER_YEAR)
163
#define YEARS_PER_HOUR                ((float)YEARS_PER_YEAR / (float)HOURS_PER_YEAR)
164
#define YEARS_PER_DAY                 ((float)YEARS_PER_YEAR / (float)DAYS_PER_YEAR)
165
#define YEARS_PER_WEEK                ((float)YEARS_PER_YEAR / (float)WEEKS_PER_YEAR)
166
#define YEARS_PER_MONTH               ((float)YEARS_PER_YEAR / (float)MONTHS_PER_YEAR)
167

  
168
#define DECADES_PER_MICROSECOND       ((float)DECADES_PER_DECADE / (float)MICROSECONDS_PER_DECADE)
169
#define DECADES_PER_MILLISECOND       ((float)DECADES_PER_DECADE / (float)MILLISECONDS_PER_DECADE)
170
#define DECADES_PER_SECOND            ((float)DECADES_PER_DECADE / (float)SECONDS_PER_DECADE)
171
#define DECADES_PER_MINUTE            ((float)DECADES_PER_DECADE / (float)MINUTES_PER_DECADE)
172
#define DECADES_PER_HOUR              ((float)DECADES_PER_DECADE / (float)HOURS_PER_DECADE)
173
#define DECADES_PER_DAY               ((float)DECADES_PER_DECADE / (float)DAYS_PER_DECADE)
174
#define DECADES_PER_WEEK              ((float)DECADES_PER_DECADE / (float)WEEKS_PER_DECADE)
175
#define DECADES_PER_MONTH             ((float)DECADES_PER_DECADE / (float)MONTHS_PER_DECADE)
176
#define DECADES_PER_YEAR              ((float)DECADES_PER_DECADE / (float)YEARS_PER_DECADE)
177

  
178
#define CENTURIES_PER_MICROSECOND     ((float)CENTURIES_PER_CENTURY / (float)MICROSECONDS_PER_CENTURY)
179
#define CENTURIES_PER_MILLISECOND     ((float)CENTURIES_PER_CENTURY / (float)MILLISECONDS_PER_CENTURY)
180
#define CENTURIES_PER_SECOND          ((float)CENTURIES_PER_CENTURY / (float)SECONDS_PER_CENTURY)
181
#define CENTURIES_PER_MINUTE          ((float)CENTURIES_PER_CENTURY / (float)MINUTES_PER_CENTURY)
182
#define CENTURIES_PER_HOUR            ((float)CENTURIES_PER_CENTURY / (float)HOURS_PER_CENTURY)
183
#define CENTURIES_PER_DAY             ((float)CENTURIES_PER_CENTURY / (float)DAYS_PER_CENTURY)
184
#define CENTURIES_PER_WEEK            ((float)CENTURIES_PER_CENTURY / (float)WEEKS_PER_CENTURY)
185
#define CENTURIES_PER_MONTH           ((float)CENTURIES_PER_CENTURY / (float)MONTHS_PER_CENTURY)
186
#define CENTURIES_PER_YEAR            ((float)CENTURIES_PER_CENTURY / (float)YEARS_PER_CENTURY)
187
#define CENTURIES_PER_DECADE          ((float)CENTURIES_PER_CENTURY / (float)DECADES_PER_CENTURY)
188

  
189
#define MILLENIUMS_PER_MICROSECOND    ((float)MILLENIUMS_PER_MILLENIUM / (float)MICROSECONDS_PER_MILLENIUM)
190
#define MILLENIUMS_PER_MILLISECOND    ((float)MILLENIUMS_PER_MILLENIUM / (float)MILLISECONDS_PER_MILLENIUM)
191
#define MILLENIUMS_PER_SECOND         ((float)MILLENIUMS_PER_MILLENIUM / (float)SECONDS_PER_MILLENIUM)
192
#define MILLENIUMS_PER_MINUTE         ((float)MILLENIUMS_PER_MILLENIUM / (float)MINUTES_PER_MILLENIUM)
193
#define MILLENIUMS_PER_HOUR           ((float)MILLENIUMS_PER_MILLENIUM / (float)HOURS_PER_MILLENIUM)
194
#define MILLENIUMS_PER_DAY            ((float)MILLENIUMS_PER_MILLENIUM / (float)DAYS_PER_MILLENIUM)
195
#define MILLENIUMS_PER_WEEK           ((float)MILLENIUMS_PER_MILLENIUM / (float)WEEKS_PER_MILLENIUM)
196
#define MILLENIUMS_PER_MONTH          ((float)MILLENIUMS_PER_MILLENIUM / (float)MONTHS_PER_MILLENIUM)
197
#define MILLENIUMS_PER_YEAR           ((float)MILLENIUMS_PER_MILLENIUM / (float)YEARS_PER_MILLENIUM)
198
#define MILLENIUMS_PER_DECADE         ((float)MILLENIUMS_PER_MILLENIUM / (float)DECADES_PER_MILLENIUM)
199
#define MILLENIUMS_PER_CENTURY        ((float)MILLENIUMS_PER_MILLENIUM / (float)CENTURIES_PER_MILLENIUM)
36
#define MICROSECONDS_PER_MICROSECOND  ((uint8_t)  (1))  /**< Number of microseconds per microsecond. */
37
#define MILLISECONDS_PER_MILLISECOND  ((uint8_t)  (1))  /**< Number of milliseconds per millisecond. */
38
#define SECONDS_PER_SECOND            ((uint8_t)  (1))  /**< Number of seconds per second. */
39
#define MINUTES_PER_MINUTE            ((uint8_t)  (1))  /**< Number of minutes per minute. */
40
#define HOURS_PER_HOUR                ((uint8_t)  (1))  /**< Number of hours per hour. */
41
#define DAYS_PER_DAY                  ((uint8_t)  (1))  /**< Number of days per day. */
42
#define WEEKS_PER_WEEK                ((uint8_t)  (1))  /**< Number of weeks per week. */
43
#define MONTHS_PER_MONTH              ((uint8_t)  (1))  /**< Number of months per month. */
44
#define YEARS_PER_YEAR                ((uint8_t)  (1))  /**< Number of years per year. */
45
#define DECADES_PER_DECADE            ((uint8_t)  (1))  /**< Number of decades per decade. */
46
#define CENTURIES_PER_CENTURY         ((uint8_t)  (1))  /**< Number of centuries per century. */
47
#define MILLENIA_PER_MILLENIUM        ((uint8_t)  (1))  /**< Number of millenia per millenium. */
48

  
49
#define MICROSECONDS_PER_MILLISECOND  ((uint16_t) (1000))     /**< Number of microseconds per millisecond. */
50
#define MILLISECONDS_PER_SECOND       ((uint16_t) (1000))     /**< Number of milliseconds per second. */
51
#define SECONDS_PER_MINUTE            ((uint8_t)  (60))       /**< Number of seconds per minute. */
52
#define MINUTES_PER_HOUR              ((uint8_t)  (60))       /**< Number of minutes per hour. */
53
#define HOURS_PER_DAY                 ((uint8_t)  (24))       /**< Number of hours per day. */
54
#define DAYS_PER_WEEK                 ((uint8_t)  (7))        /**< Number of days per week. */
55
#define DAYS_PER_YEAR                 ((float)    (365.25f))  /**< Number of days per year. */
56
#define MONTHS_PER_YEAR               ((uint8_t)  (12))       /**< Number of months per year. */
57
#define YEARS_PER_DECADE              ((uint8_t)  (10))       /**< Number of years per decade. */
58
#define DECADES_PER_CENTURY           ((uint8_t)  (10))       /**< Number of decades per century. */
59
#define CENTURIES_PER_MILLENIUM       ((uint8_t)  (10))       /**< Number of centuries per millenium. */
60

  
61
#define MICROSECONDS_PER_SECOND       ((uint32_t) ((uint32_t)MICROSECONDS_PER_MILLISECOND * (uint32_t)MILLISECONDS_PER_SECOND)) /**< Number of microseconds per second. */
62
#define MILLISECONDS_PER_MINUTE       ((uint16_t) ((uint16_t)MILLISECONDS_PER_SECOND * (uint16_t)SECONDS_PER_MINUTE))           /**< Number of milliseconds per minute. */
63
#define SECONDS_PER_HOUR              ((uint16_t) ((uint16_t)SECONDS_PER_MINUTE * (uint16_t)MINUTES_PER_HOUR))                  /**< Number of seconds per hour. */
64
#define MINUTES_PER_DAY               ((uint16_t) ((uint16_t)MINUTES_PER_HOUR * (uint16_t)HOURS_PER_DAY))                       /**< Number of minutes per day. */
65
#define HOURS_PER_WEEK                ((uint8_t)  (HOURS_PER_DAY * DAYS_PER_WEEK))                                              /**< Number of hours per week. */
66
#define HOURS_PER_YEAR                ((uint16_t) ((float)HOURS_PER_DAY * DAYS_PER_YEAR))                                       /**< Number of hours per year. */
67
#define DAYS_PER_MONTH                ((float)    (DAYS_PER_YEAR / (float)MONTHS_PER_YEAR))                                     /**< Number of days per month. */
68
#define DAYS_PER_DECADE               ((float)    (DAYS_PER_YEAR * (float)YEARS_PER_DECADE))                                    /**< Number of days per decade. */
69
#define WEEKS_PER_YEAR                ((float)    (DAYS_PER_YEAR / (float)DAYS_PER_WEEK))                                       /**< Number of weeks per year. */
70
#define MONTHS_PER_DECADE             ((uint8_t)  (MONTHS_PER_YEAR * YEARS_PER_DECADE))                                         /**< Number of months per decade. */
71
#define YEARS_PER_CENTURY             ((uint8_t)  (YEARS_PER_DECADE * DECADES_PER_CENTURY))                                     /**< Number of years per century. */
72
#define DECADES_PER_MILLENIUM         ((uint8_t)  (DECADES_PER_CENTURY * CENTURIES_PER_MILLENIUM))                              /**< Number of decades per millenium. */
73

  
74
#define MICROSECONDS_PER_MINUTE       ((uint32_t) ((uint32_t)MICROSECONDS_PER_MILLISECOND * (uint32_t)MILLISECONDS_PER_MINUTE)) /**< Number of microseconds per minute. */
75
#define MILLISECONDS_PER_HOUR         ((uint32_t) ((uint32_t)MILLISECONDS_PER_SECOND * (uint32_t)SECONDS_PER_HOUR))             /**< Number of milliseconds per hour. */
76
#define SECONDS_PER_DAY               ((uint32_t) ((uint32_t)SECONDS_PER_MINUTE * (uint32_t)MINUTES_PER_DAY))                   /**< Number of seconds per day. */
77
#define MINUTES_PER_WEEK              ((uint16_t) ((uint16_t)MINUTES_PER_HOUR * (uint16_t)HOURS_PER_WEEK))                      /**< Number of minutes per week. */
78
#define HOURS_PER_MONTH               ((float)    ((float)HOURS_PER_DAY * DAYS_PER_MONTH))                                      /**< Number of hours per month. */
79
#define HOURS_PER_DECADE              ((uint32_t) ((float)HOURS_PER_DAY * DAYS_PER_DECADE))                                     /**< Number of hours per decade. */
80
#define MINUTES_PER_YEAR              ((uint32_t) ((uint32_t)MINUTES_PER_HOUR * (uint32_t)HOURS_PER_YEAR))                      /**< Number of minutes per year. */
81
#define DAYS_PER_CENTURY              ((uint16_t) (DAYS_PER_YEAR * (float)YEARS_PER_CENTURY))                                   /**< Number of days per century. */
82
#define WEEKS_PER_MONTH               ((float)    (DAYS_PER_MONTH / (float)DAYS_PER_WEEK))                                      /**< Number of weeks per month. */
83
#define WEEKS_PER_DECADE              ((float)    (DAYS_PER_DECADE / (float)DAYS_PER_WEEK))                                     /**< Number of weeks per decade. */
84
#define MONTHS_PER_CENTURY            ((uint16_t) ((uint16_t)MONTHS_PER_YEAR * (uint16_t)YEARS_PER_CENTURY))                    /**< Number of months per century. */
85
#define YEARS_PER_MILLENIUM           ((uint16_t) ((uint16_t)YEARS_PER_DECADE * (uint16_t)DECADES_PER_MILLENIUM))               /**< Number of years per millenium. */
86

  
87
#define MICROSECONDS_PER_HOUR         ((uint32_t) ((uint32_t)MICROSECONDS_PER_MILLISECOND * MILLISECONDS_PER_HOUR)) /**< Number of microseconds per hour. */
88
#define MILLISECONDS_PER_DAY          ((uint32_t) ((uint32_t)MILLISECONDS_PER_SECOND * SECONDS_PER_DAY))            /**< Number of milliseconds per day. */
89
#define SECONDS_PER_WEEK              ((uint32_t) (SECONDS_PER_MINUTE * (uint32_t)MINUTES_PER_WEEK))                /**< Number of seconds per week. */
90
#define SECONDS_PER_YEAR              ((uint32_t) (SECONDS_PER_MINUTE * MINUTES_PER_YEAR))                          /**< Number of seconds per year. */
91
#define MINUTES_PER_MONTH             ((uint16_t) ((float)MINUTES_PER_HOUR * HOURS_PER_MONTH))                      /**< Number of minutes per month. */
92
#define MINUTES_PER_DECADE            ((uint32_t) ((uint32_t)MINUTES_PER_HOUR * HOURS_PER_DECADE))                  /**< Number of minutes per decade. */
93
#define HOURS_PER_CENTURY             ((uint32_t) ((uint32_t)HOURS_PER_DAY * (uint32_t)DAYS_PER_CENTURY))           /**< Number of hours per century. */
94
#define DAYS_PER_MILLENIUM            ((uint32_t) (DAYS_PER_YEAR * (float)YEARS_PER_MILLENIUM))                     /**< Number of days per millenium. */
95
#define WEEKS_PER_CENTURY             ((float)    ((float)DAYS_PER_CENTURY / (float)DAYS_PER_WEEK))                 /**< Number of weeks per century. */
96
#define MONTHS_PER_MILLENIUM          ((uint16_t) ((uint16_t)MONTHS_PER_YEAR * YEARS_PER_MILLENIUM))                /**< Number of months per millenium. */
97

  
98
#define MICROSECONDS_PER_DAY          ((uint64_t) ((uint64_t)MICROSECONDS_PER_MILLISECOND * (uint64_t)MILLISECONDS_PER_DAY))  /**< Number of microseconds per day. */
99
#define MILLISECONDS_PER_WEEK         ((uint32_t) ((uint32_t)MILLISECONDS_PER_SECOND * SECONDS_PER_WEEK))                     /**< Number of milliseconds per week. */
100
#define MILLISECONDS_PER_YEAR         ((uint64_t) ((uint64_t)MILLISECONDS_PER_SECOND * (uint64_t)SECONDS_PER_YEAR))           /**< Number of milliseconds per year. */
101
#define SECONDS_PER_MONTH             ((uint32_t) ((uint32_t)SECONDS_PER_MINUTE * (uint32_t)MINUTES_PER_MONTH))               /**< Number of seconds per month. */
102
#define SECONDS_PER_DECADE            ((uint32_t) ((uint32_t)SECONDS_PER_MINUTE * MINUTES_PER_DECADE))                        /**< Number of seconds per decade. */
103
#define MINUTES_PER_CENTURY           ((uint32_t) ((uint32_t)MINUTES_PER_HOUR * HOURS_PER_CENTURY))                           /**< Number of minutes per century. */
104
#define HOURS_PER_MILLENIUM           ((uint32_t) ((uint32_t)HOURS_PER_DAY * DAYS_PER_MILLENIUM))                             /**< Number of hours per millenium. */
105
#define WEEKS_PER_MILLENIUM           ((float)    ((float)DAYS_PER_MILLENIUM / (float)DAYS_PER_WEEK))                         /**< Number of weeks per millenium. */
106

  
107
#define MICROSECONDS_PER_WEEK         ((uint64_t) ((uint64_t)MICROSECONDS_PER_MILLISECOND * (uint64_t)MILLISECONDS_PER_WEEK)) /**< Number of microseconds per week. */
108
#define MICROSECONDS_PER_YEAR         ((uint64_t) ((uint64_t)MICROSECONDS_PER_MILLISECOND * MILLISECONDS_PER_YEAR))           /**< Number of microseconds per year. */
109
#define MILLISECONDS_PER_MONTH        ((uint32_t) ((uint32_t)MILLISECONDS_PER_SECOND * SECONDS_PER_MONTH))                    /**< Number of milliseconds per month. */
110
#define MILLISECONDS_PER_DECADE       ((uint64_t) ((uint64_t)MILLISECONDS_PER_SECOND * (uint64_t)SECONDS_PER_DECADE))         /**< Number of milliseconds per decade. */
111
#define SECONDS_PER_CENTURY           ((uint32_t) (SECONDS_PER_MINUTE * MINUTES_PER_CENTURY))                                 /**< Number of seconds per century. */
112
#define MINUTES_PER_MILLENIUM         ((uint32_t) ((uint32_t)MINUTES_PER_HOUR * HOURS_PER_MILLENIUM))                         /**< Number of minutes per millenium. */
113

  
114
#define MICROSECONDS_PER_MONTH        ((uint64_t) ((uint64_t)MICROSECONDS_PER_MILLISECOND * (uint64_t)MILLISECONDS_PER_MONTH))  /**< Number of microseconds per month. */
115
#define MICROSECONDS_PER_DECADE       ((uint64_t) ((uint64_t)MICROSECONDS_PER_MILLISECOND * MILLISECONDS_PER_DECADE))           /**< Number of microseconds per decade. */
116
#define MILLISECONDS_PER_CENTURY      ((uint64_t) ((uint64_t)MILLISECONDS_PER_SECOND * (uint64_t)SECONDS_PER_CENTURY))          /**< Number of milliseconds per century. */
117
#define SECONDS_PER_MILLENIUM         ((uint64_t) ((uint64_t)SECONDS_PER_MINUTE * (uint64_t)MINUTES_PER_MILLENIUM))             /**< Number of seconds per millenium. */
118

  
119
#define MICROSECONDS_PER_CENTURY      ((uint64_t) ((uint64_t)MICROSECONDS_PER_MILLISECOND * MILLISECONDS_PER_CENTURY))  /**< Number of microseconds per century. */
120
#define MILLISECONDS_PER_MILLENIUM    ((uint64_t) ((uint64_t)MILLISECONDS_PER_SECOND * SECONDS_PER_MILLENIUM))          /**< Number of milliseconds per millenium. */
121

  
122
#define MICROSECONDS_PER_MILLENIUM    ((uint64_t) ((uint64_t)MICROSECONDS_PER_MILLISECOND * MILLISECONDS_PER_MILLENIUM))  /**< Number of microseconds per millenium. */
123

  
124
#define MILLISECONDS_PER_MICROSECOND  ((float)MILLISECONDS_PER_MILLISECOND / (float)MICROSECONDS_PER_MILLISECOND) /**< Fraction of a millisecond per microsecond. */
125

  
126
#define SECONDS_PER_MICROSECOND       ((float)SECONDS_PER_SECOND / (float)MICROSECONDS_PER_SECOND)  /**< Fraction of a second per microsecond. */
127
#define SECONDS_PER_MILLISECOND       ((float)SECONDS_PER_SECOND / (float)MILLISECONDS_PER_SECOND)  /**< Fraction of a second per millisecond. */
128

  
129
#define MINUTES_PER_MICROSECOND       ((float)MINUTES_PER_MINUTE / (float)MICROSECONDS_PER_MINUTE)  /**< Fraction of a minute per microsecond. */
130
#define MINUTES_PER_MILLISECOND       ((float)MINUTES_PER_MINUTE / (float)MILLISECONDS_PER_MINUTE)  /**< Fraction of a minute per millisecond. */
131
#define MINUTES_PER_SECOND            ((float)MINUTES_PER_MINUTE / (float)SECONDS_PER_MINUTE)       /**< Fraction of a minute per second. */
132

  
133
#define HOURS_PER_MICROSECOND         ((float)HOURS_PER_HOUR / (float)MICROSECONDS_PER_HOUR)  /**< Fraction of an hour per microsecond. */
134
#define HOURS_PER_MILLISECOND         ((float)HOURS_PER_HOUR / (float)MILLISECONDS_PER_HOUR)  /**< Fraction of an hour per millisecond. */
135
#define HOURS_PER_SECOND              ((float)HOURS_PER_HOUR / (float)SECONDS_PER_HOUR)       /**< Fraction of an hour per second. */
136
#define HOURS_PER_MINUTE              ((float)HOURS_PER_HOUR / (float)MINUTES_PER_HOUR)       /**< Fraction of an hour per minute. */
137

  
138
#define DAYS_PER_MICROSECOND          ((float)DAYS_PER_DAY / (float)MICROSECONDS_PER_DAY) /**< Fraction of a day per microsecond. */
139
#define DAYS_PER_MILLISECOND          ((float)DAYS_PER_DAY / (float)MILLISECONDS_PER_DAY) /**< Fraction of a day per millisecond. */
140
#define DAYS_PER_SECOND               ((float)DAYS_PER_DAY / (float)SECONDS_PER_DAY)      /**< Fraction of a day per second. */
141
#define DAYS_PER_MINUTE               ((float)DAYS_PER_DAY / (float)MINUTES_PER_DAY)      /**< Fraction of a day per minute. */
142
#define DAYS_PER_HOUR                 ((float)DAYS_PER_DAY / (float)HOURS_PER_DAY)        /**< Fraction of a day per hour. */
143

  
144
#define WEEKS_PER_MICROSECOND         ((float)WEEKS_PER_WEEK / (float)MICROSECONDS_PER_WEEK)  /**< Fraction of a week per microsecond. */
145
#define WEEKS_PER_MILLISECOND         ((float)WEEKS_PER_WEEK / (float)MILLISECONDS_PER_WEEK)  /**< Fraction of a week per millisecond. */
146
#define WEEKS_PER_SECOND              ((float)WEEKS_PER_WEEK / (float)SECONDS_PER_WEEK)       /**< Fraction of a week per second. */
147
#define WEEKS_PER_MINUTE              ((float)WEEKS_PER_WEEK / (float)MINUTES_PER_WEEK)       /**< Fraction of a week per minute. */
148
#define WEEKS_PER_HOUR                ((float)WEEKS_PER_WEEK / (float)HOURS_PER_WEEK)         /**< Fraction of a week per hour. */
149
#define WEEKS_PER_DAY                 ((float)WEEKS_PER_WEEK / (float)DAYS_PER_WEEK)          /**< Fraction of a week per day. */
150

  
151
#define MONTHS_PER_MICROSECOND        ((float)MONTHS_PER_MONTH / (float)MICROSECONDS_PER_MONTH) /**< Fraction of a month per microsecond. */
152
#define MONTHS_PER_MILLISECOND        ((float)MONTHS_PER_MONTH / (float)MILLISECONDS_PER_MONTH) /**< Fraction of a month per millisecond. */
153
#define MONTHS_PER_SECOND             ((float)MONTHS_PER_MONTH / (float)SECONDS_PER_MONTH)      /**< Fraction of a month per second. */
154
#define MONTHS_PER_MINUTE             ((float)MONTHS_PER_MONTH / (float)MINUTES_PER_MONTH)      /**< Fraction of a month per minute. */
155
#define MONTHS_PER_HOUR               ((float)MONTHS_PER_MONTH / (float)HOURS_PER_MONTH)        /**< Fraction of a month per hour. */
156
#define MONTHS_PER_DAY                ((float)MONTHS_PER_MONTH / (float)DAYS_PER_MONTH)         /**< Fraction of a month per day. */
157
#define MONTHS_PER_WEEK               ((float)MONTHS_PER_MONTH / (float)WEEKS_PER_MONTH)        /**< Fraction of a month per week. */
158

  
159
#define YEARS_PER_MICROSECOND         ((float)YEARS_PER_YEAR / (float)MICROSECONDS_PER_YEAR)  /**< Fraction of a year per microsecond. */
160
#define YEARS_PER_MILLISECOND         ((float)YEARS_PER_YEAR / (float)MILLISECONDS_PER_YEAR)  /**< Fraction of a year per millisecond. */
161
#define YEARS_PER_SECOND              ((float)YEARS_PER_YEAR / (float)SECONDS_PER_YEAR)       /**< Fraction of a year per second. */
162
#define YEARS_PER_MINUTE              ((float)YEARS_PER_YEAR / (float)MINUTES_PER_YEAR)       /**< Fraction of a year per minute. */
163
#define YEARS_PER_HOUR                ((float)YEARS_PER_YEAR / (float)HOURS_PER_YEAR)         /**< Fraction of a year per hour. */
164
#define YEARS_PER_DAY                 ((float)YEARS_PER_YEAR / (float)DAYS_PER_YEAR)          /**< Fraction of a year per day. */
165
#define YEARS_PER_WEEK                ((float)YEARS_PER_YEAR / (float)WEEKS_PER_YEAR)         /**< Fraction of a year per week. */
166
#define YEARS_PER_MONTH               ((float)YEARS_PER_YEAR / (float)MONTHS_PER_YEAR)        /**< Fraction of a year per month. */
167

  
168
#define DECADES_PER_MICROSECOND       ((float)DECADES_PER_DECADE / (float)MICROSECONDS_PER_DECADE)  /**< Fraction of a decade per microsecond. */
169
#define DECADES_PER_MILLISECOND       ((float)DECADES_PER_DECADE / (float)MILLISECONDS_PER_DECADE)  /**< Fraction of a decade per millisecond. */
170
#define DECADES_PER_SECOND            ((float)DECADES_PER_DECADE / (float)SECONDS_PER_DECADE)       /**< Fraction of a decade per second. */
171
#define DECADES_PER_MINUTE            ((float)DECADES_PER_DECADE / (float)MINUTES_PER_DECADE)       /**< Fraction of a decade per minute. */
172
#define DECADES_PER_HOUR              ((float)DECADES_PER_DECADE / (float)HOURS_PER_DECADE)         /**< Fraction of a decade per hour. */
173
#define DECADES_PER_DAY               ((float)DECADES_PER_DECADE / (float)DAYS_PER_DECADE)          /**< Fraction of a decade per day. */
174
#define DECADES_PER_WEEK              ((float)DECADES_PER_DECADE / (float)WEEKS_PER_DECADE)         /**< Fraction of a decade per week. */
175
#define DECADES_PER_MONTH             ((float)DECADES_PER_DECADE / (float)MONTHS_PER_DECADE)        /**< Fraction of a decade per month. */
176
#define DECADES_PER_YEAR              ((float)DECADES_PER_DECADE / (float)YEARS_PER_DECADE)         /**< Fraction of a decade per year. */
177

  
178
#define CENTURIES_PER_MICROSECOND     ((float)CENTURIES_PER_CENTURY / (float)MICROSECONDS_PER_CENTURY)  /**< Fraction of a century per microsecond. */
179
#define CENTURIES_PER_MILLISECOND     ((float)CENTURIES_PER_CENTURY / (float)MILLISECONDS_PER_CENTURY)  /**< Fraction of a century per millisecond. */
180
#define CENTURIES_PER_SECOND          ((float)CENTURIES_PER_CENTURY / (float)SECONDS_PER_CENTURY)       /**< Fraction of a century per second. */
181
#define CENTURIES_PER_MINUTE          ((float)CENTURIES_PER_CENTURY / (float)MINUTES_PER_CENTURY)       /**< Fraction of a century per minute. */
182
#define CENTURIES_PER_HOUR            ((float)CENTURIES_PER_CENTURY / (float)HOURS_PER_CENTURY)         /**< Fraction of a century per hour. */
183
#define CENTURIES_PER_DAY             ((float)CENTURIES_PER_CENTURY / (float)DAYS_PER_CENTURY)          /**< Fraction of a century per day. */
184
#define CENTURIES_PER_WEEK            ((float)CENTURIES_PER_CENTURY / (float)WEEKS_PER_CENTURY)         /**< Fraction of a century per week. */
185
#define CENTURIES_PER_MONTH           ((float)CENTURIES_PER_CENTURY / (float)MONTHS_PER_CENTURY)        /**< Fraction of a century per month. */
186
#define CENTURIES_PER_YEAR            ((float)CENTURIES_PER_CENTURY / (float)YEARS_PER_CENTURY)         /**< Fraction of a century per year. */
187
#define CENTURIES_PER_DECADE          ((float)CENTURIES_PER_CENTURY / (float)DECADES_PER_CENTURY)       /**< Fraction of a century per decade. */
188

  
189
#define MILLENIA_PER_MICROSECOND      ((float)MILLENIA_PER_MILLENIUM / (float)MICROSECONDS_PER_MILLENIUM) /**< Fraction of a millenium per microsecond. */
190
#define MILLENIA_PER_MILLISECOND      ((float)MILLENIA_PER_MILLENIUM / (float)MILLISECONDS_PER_MILLENIUM) /**< Fraction of a millenium per millisecond. */
191
#define MILLENIA_PER_SECOND           ((float)MILLENIA_PER_MILLENIUM / (float)SECONDS_PER_MILLENIUM)      /**< Fraction of a millenium per second. */
192
#define MILLENIA_PER_MINUTE           ((float)MILLENIA_PER_MILLENIUM / (float)MINUTES_PER_MILLENIUM)      /**< Fraction of a millenium per minute. */
193
#define MILLENIA_PER_HOUR             ((float)MILLENIA_PER_MILLENIUM / (float)HOURS_PER_MILLENIUM)        /**< Fraction of a millenium per hour. */
194
#define MILLENIA_PER_DAY              ((float)MILLENIA_PER_MILLENIUM / (float)DAYS_PER_MILLENIUM)         /**< Fraction of a millenium per day. */
195
#define MILLENIA_PER_WEEK             ((float)MILLENIA_PER_MILLENIUM / (float)WEEKS_PER_MILLENIUM)        /**< Fraction of a millenium per week. */
196
#define MILLENIA_PER_MONTH            ((float)MILLENIA_PER_MILLENIUM / (float)MONTHS_PER_MILLENIUM)       /**< Fraction of a millenium per month. */
197
#define MILLENIA_PER_YEAR             ((float)MILLENIA_PER_MILLENIUM / (float)YEARS_PER_MILLENIUM)        /**< Fraction of a millenium per year. */
198
#define MILLENIA_PER_DECADE           ((float)MILLENIA_PER_MILLENIUM / (float)DECADES_PER_MILLENIUM)      /**< Fraction of a millenium per decade. */
199
#define MILLENIA_PER_CENTURY          ((float)MILLENIA_PER_MILLENIUM / (float)CENTURIES_PER_MILLENIUM)    /**< Fraction of a millenium per century. */
200 200

  
201 201
/******************************************************************************/
202 202
/* SETTINGS                                                                   */
test/periphery-lld/PKxxxExxx_v1/aos_test_PKxxxExxx.c
78 78
  return result;
79 79
}
80 80

  
81
#endif /* AMIROOS_CFG_TESTS_ENABLE == true) */
81
#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */

Also available in: Unified diff