diff --git a/timer.c b/timer.c index d5c1c99..f185e81 100644 --- a/timer.c +++ b/timer.c @@ -2,11 +2,12 @@ #include #include -void timer(unsigned long* temps_ecoule, unsigned long temps_microsec){ +unsigned long timer(unsigned long temps_ecoule, unsigned long temps_microsec){ unsigned long temps_actuel = Microsecondes(); if (temps_actuel > temps_microsec + 1000000){ temps_microsec = temps_actuel; - *temps_ecoule++; - printf("%d",*temps_ecoule); + temps_ecoule += 1; + printf("%d",temps_ecoule); } + return temps_ecoule; } diff --git a/timer.h b/timer.h index 73c1c2b..64a6467 100644 --- a/timer.h +++ b/timer.h @@ -3,6 +3,6 @@ #define TIMER_H -void timer(unsigned long* temps_ecoule, unsigned long temps_microsec); +unsigned long timer(unsigned long temps_ecoule, unsigned long temps_microsec); #endif /* TIMER_H */