mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
add a print function for timex and vtimer
This commit is contained in:
parent
d4ea8664ee
commit
8faf6b77b6
@ -28,4 +28,9 @@ int timex_cmp(const timex_t a, const timex_t b);
|
||||
*/
|
||||
void timex_normalize(timex_t *time);
|
||||
|
||||
/**
|
||||
* @brief Prints a timex_t
|
||||
*/
|
||||
void timex_print(const timex_t t);
|
||||
|
||||
#endif /* __TIMEX_H */
|
||||
|
@ -91,4 +91,9 @@ int vtimer_set_wakeup(vtimer_t *t, timex_t interval, int pid);
|
||||
*/
|
||||
int vtimer_remove(vtimer_t *t);
|
||||
|
||||
/**
|
||||
* @brief Prints a vtimer_t
|
||||
*/
|
||||
void vtimer_print(vtimer_t* t);
|
||||
|
||||
#endif /* __VTIMER_H */
|
||||
|
@ -1,4 +1,6 @@
|
||||
#include <timex.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "timex.h"
|
||||
|
||||
timex_t timex_add(const timex_t a, const timex_t b) {
|
||||
timex_t result;
|
||||
@ -47,3 +49,6 @@ int timex_cmp(const timex_t a, const timex_t b) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void timex_print(const timex_t t) {
|
||||
printf("Seconds: %u - Microseconds: %u\n", t.seconds, t.microseconds);
|
||||
}
|
||||
|
@ -254,9 +254,8 @@ int vtimer_set_msg(vtimer_t *t, timex_t interval, unsigned int pid, void *ptr){
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DEBUG
|
||||
static void vtimer_print(vtimer_t* t) {
|
||||
printf("Seconds: %lu - Microseconds: %lu\n \
|
||||
void vtimer_print(vtimer_t* t) {
|
||||
printf("Seconds: %u - Microseconds: %u\n \
|
||||
action: %p\n \
|
||||
action: %p\n \
|
||||
pid: %u\n",
|
||||
@ -265,4 +264,3 @@ static void vtimer_print(vtimer_t* t) {
|
||||
t->arg,
|
||||
t->pid);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user