summaryrefslogtreecommitdiff
path: root/ecp/src/platform
diff options
context:
space:
mode:
Diffstat (limited to 'ecp/src/platform')
-rw-r--r--ecp/src/platform/fe310/time.c10
-rw-r--r--ecp/src/platform/fe310/transport.c2
-rw-r--r--ecp/src/platform/fe310/transport.h2
-rw-r--r--ecp/src/platform/posix/time.c8
4 files changed, 11 insertions, 11 deletions
diff --git a/ecp/src/platform/fe310/time.c b/ecp/src/platform/fe310/time.c
index 1e5eb17..5e4bc26 100644
--- a/ecp/src/platform/fe310/time.c
+++ b/ecp/src/platform/fe310/time.c
@@ -4,9 +4,9 @@
#include <tr.h>
#include <eos/eos.h>
-#include <eos/net.h>
#include <eos/event.h>
-#include <eos/timer.h>
+#include <eos/soc/timer.h>
+#include <eos/dev/net.h>
extern ECPSocket *_ecp_tr_sock;
@@ -23,11 +23,11 @@ int ecp_tm_init(ECPContext *ctx) {
return ECP_OK;
}
-ecp_sts_t ecp_tm_abstime_ms(ecp_sts_t msec) {
- return eos_time_get_tick() * 1000 / EOS_TIMER_RTC_FREQ + msec;
+ecp_sts_t ecp_tm_get_tick(void) {
+ return eos_time_get_tick() * 1000 / EOS_TIMER_RTC_FREQ;
}
-void ecp_tm_sleep_ms(ecp_sts_t msec) {
+void ecp_tm_sleep(ecp_sts_t msec) {
eos_time_sleep(msec);
}
diff --git a/ecp/src/platform/fe310/transport.c b/ecp/src/platform/fe310/transport.c
index 2640ecf..c359bd1 100644
--- a/ecp/src/platform/fe310/transport.c
+++ b/ecp/src/platform/fe310/transport.c
@@ -6,7 +6,7 @@
#include <tr.h>
#include <eos/eos.h>
-#include <eos/net.h>
+#include <eos/dev/net.h>
ECPSocket *_ecp_tr_sock = NULL;
unsigned char pld_buf[ECP_MAX_PLD];
diff --git a/ecp/src/platform/fe310/transport.h b/ecp/src/platform/fe310/transport.h
index 1e0c526..52ece15 100644
--- a/ecp/src/platform/fe310/transport.h
+++ b/ecp/src/platform/fe310/transport.h
@@ -1,4 +1,4 @@
-#include <eos/sock.h>
+#include <eos/net/sock.h>
typedef struct EOSNetAddr ecp_tr_addr_t;
typedef int ecp_tr_sock_t;
diff --git a/ecp/src/platform/posix/time.c b/ecp/src/platform/posix/time.c
index efee4f8..7030bf3 100644
--- a/ecp/src/platform/posix/time.c
+++ b/ecp/src/platform/posix/time.c
@@ -9,17 +9,17 @@ int ecp_tm_init(ECPContext *ctx) {
return ECP_OK;
}
-ecp_sts_t ecp_tm_abstime_ms(ecp_sts_t msec) {
+ecp_sts_t ecp_tm_get_tick(void) {
struct timeval tv;
ecp_sts_t ms_now;
gettimeofday(&tv, NULL);
ms_now = tv.tv_sec * 1000 + tv.tv_usec / 1000;
- return ms_now + msec;
+ return ms_now;
}
-void ecp_tm_sleep_ms(ecp_sts_t msec) {
- usleep(msec*1000);
+void ecp_tm_sleep(ecp_sts_t msec) {
+ usleep(msec * 1000);
}
void ecp_tm_timer_set(ecp_sts_t next) {}