1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

40 Commits

Author SHA1 Message Date
fd1f257ee8 sys: factor out US_PER_SEC etc from timex.h into time_units.h 2021-12-15 14:33:20 +01:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Martine Lenders
02c0581ab9
timex: introduce MS_PER_CS 2021-07-21 16:27:53 +02:00
Marian Buschsieweke
d59607ddb7
sys/timex: change type of NS_PER_SEC
Having NS_PER_SEC defined as `1000000000U` is quite a foot gun, as
multiplication even with small numbers in 32 bit quickly overflows. Using the
`1000000000LLU` instead forces 64 bit math.
2020-12-02 17:53:00 +01:00
Marian Buschsieweke
654b558343
sys/timex: Fix integer width issue
The macros US_PER_MS and friends are assumed to be 32 bit unsigned integers
by users. However, e.g. on AVR a `1000U` is only 16 bit long. Thus, e.g.
`xtimer_usleep(100 * US_PER_MS)` will wrap around and only sleep for ~34ms.

This commit declares them as unsigned long, which is on all currently supported
platforms 32 bit wide.
2020-04-23 21:16:04 +02:00
Christian Friedrich Coors
c0615ad726 sys/timex: Add NS_PER_SEC definition 2020-03-25 17:20:01 +01:00
Martine Lenders
441ca528da timex: add US_PER_CS converter
DHCPv6 operates on centiseconds (hundredth of a second) for some time
values, so for interaction with `xtimer` I require this converter.
2020-01-02 11:56:25 +01:00
Hauke Petersen
e9334e6d2d sys/timex: make NS_PER_US unsigned 2017-12-12 07:51:39 +01:00
Lucas Jenss
6998ffbb14 cppcheck: Provide consistent reason formatting for all cppcheck-suppresses 2017-10-10 10:25:20 -07:00
Oleg Hahm
4f4214235b timex: unambiguous time conversion macros 2017-01-19 13:18:08 +01:00
Martine Lenders
ad2a9573af timex: more conversion macros 2016-12-14 16:21:56 +01:00
Laurent Navet
5fe337bc6c sys: fix include headers guards 2016-10-26 21:53:58 +02:00
Martine Lenders
cffdb1c8e2 timex: introduce USEC_IN_NS constant 2015-10-21 19:45:58 +02:00
02bc3ffb79 sys: timex: add "U" specifiers to constant definitions 2015-08-25 13:18:16 +02:00
Martine Lenders
ea48b48dd3 timex: make timex_to_str more efficient 2015-08-11 01:33:21 +02:00
Cenk Gündoğan
355e60c5ff timex: use doxygen todo 2015-08-03 11:00:21 +02:00
Fabian Nack
2143d572d0 sys/timex: Defines for time calculations 2015-02-24 11:50:42 +01:00
Lucas Jenss
8e758d7463 sys: Misc errors that occur w/ ENABLE_DEBUG fixed
I enabled debug output in all files to poke around
and there were some errors (seemingly) due to code
changes that were not tested with debug enabled. This
commits tries to fix these issues.
2015-01-30 01:36:28 +01:00
Ludwig Ortmann
8676a1972d sys/timex: suppress passedByValue warnings 2015-01-14 11:57:01 +01:00
Oleg Hahm
6c762d683b doc: added missing documentation for PRIu32 2014-12-05 20:33:10 +01:00
BytesGalore
de3c3cebd0 c++: sys: add extern C to header files 2014-11-08 20:09:55 +01:00
Oleg Hahm
af13f190e6 doc: compliment and fix timex documentation 2014-10-28 17:50:11 +01:00
Oleg Hahm
20dc7b0b00 timex: remove redundant struct timex_t declaration
timex_t is available as a typedef, declaring it as `struct timex_t` in
addition is not necessary.
2014-10-28 14:25:34 +01:00
Oleg Hahm
4b3fa4925a timex: update copyrights 2014-10-28 14:25:34 +01:00
Oleg Hahm
67f82fcee0 timex: replace print by a to_str function
Instead of printing the timestamp, it's more flexible to convert it into
a string.
2014-10-28 14:25:34 +01:00
Oleg Hahm
8c4a874161 timex: make functions static inline
This commit makes all one- or two-liners in timex a static inline
function, defined in the header file.
2014-10-28 14:25:34 +01:00
Ludwig Ortmann
289c4c0ee4 doc: add license headers to some .h files 2014-09-18 17:45:11 +02:00
Philipp Rosenkranz
0bf6ce22f3 added conv function from uint64 to timex_t and one minor bug fix 2014-06-19 12:40:24 +02:00
Christian Mehlis
93ddf37d81 added timex_isnormalized 2014-01-09 16:36:40 +01:00
Christian Mehlis
5a6e16cfc3 added timex_uint64 function 2014-01-09 16:36:40 +01:00
Hauke Petersen
edcabf7cb6 Fixed a lot of comments by removing tabs and correcting format. 2013-12-16 14:00:33 +01:00
Hauke Petersen
3785fe956b Fixed doxygen comments, focused on file headers and group definitions 2013-12-16 14:00:24 +01:00
Kévin Roussel
d2535f3841 Added missing definition of 'PRIu32' in some RIOT include files
to avoid a bug in mspgcc's standard library
2013-10-09 15:10:22 +02:00
Oliver Hahm
5c52e1ce2e coding conventions for most of system libraries 2013-06-22 05:11:53 +02:00
Christian Mehlis
8faf6b77b6 add a print function for timex and vtimer 2013-06-14 20:38:27 +02:00
Oliver Hahm
59a46e0e88 Merge branch 'sixlowpan'
Conflicts:
	cpu/arm_common/hwtimer_cpu.c
	sys/include/vtimer.h
	sys/vtimer.c
2012-01-11 17:02:43 +01:00
Oliver Hahm
e00e4160d7 [sys timex/vtimer]
* fixed #17
2011-12-01 13:01:36 +01:00
6a950320ae * vtimer: new virtual timer implementation 2010-12-06 16:02:40 +01:00
0de6300af0 * added some time functions 2010-12-01 17:23:28 +01:00
2cc6d44e52 * initial checkin of timex lib 2010-12-01 17:13:37 +01:00