// vim: set et sw=4 sts=4 :
+#include "types.h"
#include "etherdev.h"
void sleep(unsigned char);
-static xdata leds1 _at_ 0x0080;
-static xdata leds2 _at_ 0x00c0;
+#ifdef SDCC
+static xdata at 0x0080 byte leds1;
+static xdata at 0x00c0 byte leds2;
+#else
+static byte xdata leds1 _at_ 0x0080;
+static byte xdata leds2 _at_ 0x00c0;
+#endif
unsigned char uip_buf[80] =
{
IOW = 1;
NICE = 1;
- // Set register data port as input again.
- ETH_DATA_PORT = ETH_DATA_PORT_MASK;
-
return;
}
ETH_ADDR_PORT &= ~ETH_ADDR_PORT_MASK;
ETH_ADDR_PORT |= reg;
+ // Set register data port as input.
+ ETH_DATA_PORT = ETH_DATA_PORT_MASK;
+
// Enable register data output from RTL8019AS.
NICE = 0;
IOR = 0;
Refer to National Semiconductor DP8390 App Note 874, July 1993.
*/
-bit etherdev_init(void)
+bool etherdev_init(void)
{
// Set IOR & IOW as they're active low.
IOR = 1;
// Mask all interrupts in mask register.
etherdev_reg_write(IMR, 0x00);
-
+
// Obtengo MAC de la placa
etherdev_reg_write(RBCR0, 0x0c); // Vamos a leer 12 bytes (2 x 6)
etherdev_reg_write(RBCR1, 0x00);