From 6997eb096892845d7c7608767e731cfc2dc0f146 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 14 Nov 2005 02:06:57 +0000 Subject: [PATCH] Arregla net.h y agrega net.c que faltaba. --- src/c/net.c | 14 ++++++++++++++ src/c/net.h | 30 +++++++++++++++++------------- 2 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 src/c/net.c diff --git a/src/c/net.c b/src/c/net.c new file mode 100644 index 0000000..599e26d --- /dev/null +++ b/src/c/net.c @@ -0,0 +1,14 @@ +#include "net.h" + +uint16 net_getw() +{ + byte b = net_getb() << 8; + return b + net_getb(); +} + +void net_putw(uint16 w) +{ + net_putb(HIGH(w)); + net_putb(LOW(w)); +} + diff --git a/src/c/net.h b/src/c/net.h index 15bed4f..678513a 100644 --- a/src/c/net.h +++ b/src/c/net.h @@ -1,14 +1,18 @@ -#include "net.h" - -uint16 net_getw() -{ - byte b = net_getb(); - return (b << 8) + net_getb(); -} - -void net_putw(uint16 w) -{ - net_putb(w >> 8); /* parte alta */; - net_putb(w); /* parte baja */; -} +#ifndef _NET_H_ +#define _NET_H_ +#include "types.h" + +/** lee un byte de la placa de red */ +byte net_getb(); + +/** escribe un byte a la placa de red */ +void net_putb(byte); + +/** lee un word de la placa de red */ +uint16 net_getw(); + +/** escribe un word a la placa de red */ +void net_putw(uint16); + +#endif /* _NET_H_ */ -- 2.43.0