X-Git-Url: https://git.llucax.com/z.facultad/66.09/etherled.git/blobdiff_plain/5b3a8f73a2eccd20452b8e2d628df024b925b44e..afe814271b1b8c0519595d12d5a9cad8a24a3cc9:/src/dp8390.c diff --git a/src/dp8390.c b/src/dp8390.c index 5c472a5..1b48e9b 100644 --- a/src/dp8390.c +++ b/src/dp8390.c @@ -1,6 +1,7 @@ // vim: set et sw=4 sts=4 : #include "debug.h" +#include "leds.h" #include "eth.h" #include "dp8390.h" @@ -40,6 +41,7 @@ recv_state; static void write_reg(unsigned char reg, unsigned char wr_data) { + leds_lock(); // Select register address. ADDR_PORT &= ~ADDR_PORT_MASK; ADDR_PORT |= reg; @@ -56,11 +58,13 @@ static void write_reg(unsigned char reg, unsigned char wr_data) // Set register data port as input again. DATA_PORT = DATA_PORT_MASK; + leds_unlock(); } static unsigned char read_reg(unsigned char reg) { + leds_lock(); // Select register address. ADDR_PORT &= ~ADDR_PORT_MASK; ADDR_PORT |= reg; @@ -76,6 +80,7 @@ static unsigned char read_reg(unsigned char reg) IOR = 1; NICE = 1; + leds_unlock(); return reg; }