summaryrefslogtreecommitdiff
path: root/ecp/src/platform/fe310
diff options
context:
space:
mode:
Diffstat (limited to 'ecp/src/platform/fe310')
-rw-r--r--ecp/src/platform/fe310/time.c18
-rw-r--r--ecp/src/platform/fe310/transport.c8
-rw-r--r--ecp/src/platform/fe310/transport.h2
3 files changed, 16 insertions, 12 deletions
diff --git a/ecp/src/platform/fe310/time.c b/ecp/src/platform/fe310/time.c
index 1e5eb17..4bf530c 100644
--- a/ecp/src/platform/fe310/time.c
+++ b/ecp/src/platform/fe310/time.c
@@ -1,12 +1,12 @@
#include <stdlib.h>
-#include <core.h>
-#include <tr.h>
+#include <ecp/core.h>
+#include <ecp/tm.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,15 @@ 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_s(void) {
+ return eos_time_get_tick() / EOS_TIMER_RTC_FREQ;
}
-void ecp_tm_sleep_ms(ecp_sts_t msec) {
+ecp_sts_t ecp_tm_get_ms(void) {
+ return eos_time_get_tick() * 1000 / EOS_TIMER_RTC_FREQ;
+}
+
+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..bc758c9 100644
--- a/ecp/src/platform/fe310/transport.c
+++ b/ecp/src/platform/fe310/transport.c
@@ -2,11 +2,11 @@
#include <string.h>
#include <stdio.h>
-#include <core.h>
-#include <tr.h>
+#include <ecp/core.h>
+#include <ecp/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];
@@ -65,7 +65,7 @@ int ecp_tr_addr_set(ecp_tr_addr_t *addr, void *addr_s) {
return ECP_ERR;
}
-int ecp_tr_open(ECPSocket *sock, void *addr_s) {
+int ecp_tr_open(ECPSocket *sock, ecp_tr_addr_t *addr) {
sock->sock = eos_sock_open_udp(packet_handler, NULL);
if (sock->sock < 0) {
sock->sock = 0;
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;