1
0
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:
Christian Mehlis 2013-06-14 20:38:27 +02:00
parent d4ea8664ee
commit 8faf6b77b6
4 changed files with 18 additions and 5 deletions

View File

@ -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 */

View File

@ -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 */

View File

@ -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);
}

View File

@ -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