diff options
author | Uros Majstorovic <majstor@majstor.org> | 2022-08-09 21:54:45 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2022-08-09 21:54:45 +0200 |
commit | 810dde21ee65653c15606917b19566cfbaaf165e (patch) | |
tree | 4cd84b109e06660a9c59f2487822905e5672681e /ecp/src/platform/fe310 | |
parent | aee853a208d6abec53ec81dc4ef110b63e13342f (diff) |
ecp server added
Diffstat (limited to 'ecp/src/platform/fe310')
-rw-r--r-- | ecp/src/platform/fe310/time.c | 10 | ||||
-rw-r--r-- | ecp/src/platform/fe310/transport.c | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/ecp/src/platform/fe310/time.c b/ecp/src/platform/fe310/time.c index 5e4bc26..4bf530c 100644 --- a/ecp/src/platform/fe310/time.c +++ b/ecp/src/platform/fe310/time.c @@ -1,7 +1,7 @@ #include <stdlib.h> -#include <core.h> -#include <tr.h> +#include <ecp/core.h> +#include <ecp/tm.h> #include <eos/eos.h> #include <eos/event.h> @@ -23,7 +23,11 @@ int ecp_tm_init(ECPContext *ctx) { return ECP_OK; } -ecp_sts_t ecp_tm_get_tick(void) { +ecp_sts_t ecp_tm_get_s(void) { + return eos_time_get_tick() / EOS_TIMER_RTC_FREQ; +} + +ecp_sts_t ecp_tm_get_ms(void) { return eos_time_get_tick() * 1000 / EOS_TIMER_RTC_FREQ; } diff --git a/ecp/src/platform/fe310/transport.c b/ecp/src/platform/fe310/transport.c index c359bd1..bc758c9 100644 --- a/ecp/src/platform/fe310/transport.c +++ b/ecp/src/platform/fe310/transport.c @@ -2,8 +2,8 @@ #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/dev/net.h> @@ -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; |