diff --git a/litex/soc/software/include/base/time.h b/litex/soc/software/include/base/time.h deleted file mode 100644 index 34083902c..000000000 --- a/litex/soc/software/include/base/time.h +++ /dev/null @@ -1,15 +0,0 @@ -#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/litex/soc/software/libbase/Makefile b/litex/soc/software/libbase/Makefile index fd8c2b29a..95e97ce0b 100755 --- a/litex/soc/software/libbase/Makefile +++ b/litex/soc/software/libbase/Makefile @@ -7,7 +7,6 @@ OBJECTS = exception.o \ system.o \ id.o \ uart.o \ - time.o \ spiflash.o \ i2c.o \ progress.o \ diff --git a/litex/soc/software/libbase/time.c b/litex/soc/software/libbase/time.c deleted file mode 100644 index 4e84652b4..000000000 --- a/litex/soc/software/libbase/time.c +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include - -void time_init(void) -{ - int t; - - timer0_en_write(0); - t = 2*CONFIG_CLOCK_FREQUENCY; - timer0_reload_write(t); - timer0_load_write(t); - timer0_en_write(1); -} - -int elapsed(int *last_event, int period) -{ - int t, dt; - - timer0_update_value_write(1); - t = timer0_reload_read() - timer0_value_read(); - if(period < 0) { - *last_event = t; - return 1; - } - dt = t - *last_event; - if(dt < 0) - dt += timer0_reload_read(); - if((dt > period) || (dt < 0)) { - *last_event = t; - return 1; - } else - return 0; -}