From e42a42ce401217669561f47832014e3d9163e293 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 11 Jul 2013 19:00:48 +0200 Subject: [PATCH] software: move time.c to libbase --- software/{videomixer => include/base}/time.h | 8 ++++++++ software/libbase/Makefile | 2 +- software/{videomixer => libbase}/time.c | 3 +-- software/videomixer/Makefile | 2 +- software/videomixer/dvisamplerX.c | 2 +- software/videomixer/main.c | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) rename software/{videomixer => include/base}/time.h (63%) rename software/{videomixer => libbase}/time.c (96%) diff --git a/software/videomixer/time.h b/software/include/base/time.h similarity index 63% rename from software/videomixer/time.h rename to software/include/base/time.h index a8ebe23fd..34083902c 100644 --- a/software/videomixer/time.h +++ b/software/include/base/time.h @@ -1,7 +1,15 @@ #ifndef __TIME_H #define __TIME_H +#ifdef __cplusplus +extern "C" { +#endif + void time_init(void); int elapsed(int *last_event, int period); +#ifdef __cplusplus +} +#endif + #endif /* __TIME_H */ diff --git a/software/libbase/Makefile b/software/libbase/Makefile index e58da5ceb..b9b9a7ab2 100644 --- a/software/libbase/Makefile +++ b/software/libbase/Makefile @@ -1,7 +1,7 @@ M2DIR=../.. include $(M2DIR)/software/common.mak -OBJECTS=setjmp.o libc.o errno.o crc16.o crc32.o console.o system.o id.o uart.o qsort.o strtod.o +OBJECTS=setjmp.o libc.o errno.o crc16.o crc32.o console.o system.o id.o uart.o time.o qsort.o strtod.o all: crt0.o libbase.a libbase-nofloat.a diff --git a/software/videomixer/time.c b/software/libbase/time.c similarity index 96% rename from software/videomixer/time.c rename to software/libbase/time.c index 1f2c3aa96..c1c2ea8b8 100644 --- a/software/videomixer/time.c +++ b/software/libbase/time.c @@ -1,6 +1,5 @@ #include - -#include "time.h" +#include void time_init(void) { diff --git a/software/videomixer/Makefile b/software/videomixer/Makefile index 347dccc7e..9742ac9d7 100644 --- a/software/videomixer/Makefile +++ b/software/videomixer/Makefile @@ -1,7 +1,7 @@ M2DIR=../.. include $(M2DIR)/software/common.mak -OBJECTS=isr.o time.o fb.o dvisampler0.o dvisampler1.o main.o +OBJECTS=isr.o fb.o dvisampler0.o dvisampler1.o main.o all: videomixer.bin videomixer.fbi diff --git a/software/videomixer/dvisamplerX.c b/software/videomixer/dvisamplerX.c index fbb0b688f..e089ed195 100644 --- a/software/videomixer/dvisamplerX.c +++ b/software/videomixer/dvisamplerX.c @@ -3,10 +3,10 @@ #include #include +#include #include #include -#include "time.h" #include "fb.h" #include "dvisamplerX.h" diff --git a/software/videomixer/main.c b/software/videomixer/main.c index 4407d64aa..5d6128a4e 100644 --- a/software/videomixer/main.c +++ b/software/videomixer/main.c @@ -3,11 +3,11 @@ #include #include +#include #include #include #include -#include "time.h" #include "fb.h" #include "dvisampler0.h" #include "dvisampler1.h"