From 8c6c68e92d6b4c8aa5e2fcc784ed52da40845acc Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sun, 13 Oct 2019 02:05:03 +0200 Subject: net refactor; rename cmd -> type --- code/fe310/eos/ecp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'code/fe310/eos/ecp.c') diff --git a/code/fe310/eos/ecp.c b/code/fe310/eos/ecp.c index 9297ccd..44d9a47 100644 --- a/code/fe310/eos/ecp.c +++ b/code/fe310/eos/ecp.c @@ -13,7 +13,7 @@ static ECPSocket *_sock = NULL; -static void timer_handler(unsigned char cmd, unsigned char *buffer, uint16_t len) { +static void timer_handler(unsigned char type, unsigned char *buffer, uint16_t len) { ecp_cts_t next = ecp_timer_exe(_sock); if (next) { uint32_t tick = next * (uint64_t)RTC_FREQ / 1000; @@ -21,7 +21,7 @@ static void timer_handler(unsigned char cmd, unsigned char *buffer, uint16_t len } } -static void packet_handler(unsigned char cmd, unsigned char *buffer, uint16_t len) { +static void packet_handler(unsigned char type, unsigned char *buffer, uint16_t len) { ECPNetAddr addr; size_t addr_len = sizeof(addr.host) + sizeof(addr.port); @@ -59,8 +59,9 @@ int ecp_init(ECPContext *ctx) { rv = ecp_ctx_create_vconn(ctx); if (rv) return rv; + /* XXX */ eos_evtq_set_handler(EOS_EVT_TIMER, timer_handler, EOS_EVT_FLAG_NET_BUF_ACQ); - eos_net_set_handler(EOS_NET_CMD_PKT, packet_handler, 0); + // eos_net_set_handler(EOS_NET_DATA_PKT, packet_handler, 0); return ECP_OK; } -- cgit v1.2.3