X-Git-Url: https://git.llucax.com/z.facultad/66.09/etherled.git/blobdiff_plain/5b3a8f73a2eccd20452b8e2d628df024b925b44e..d6c5f7cf0e7f53c9251477b092e8b208a313e928:/src/dp8390.c?ds=sidebyside diff --git a/src/dp8390.c b/src/dp8390.c index 5c472a5..76d0c6d 100644 --- a/src/dp8390.c +++ b/src/dp8390.c @@ -40,6 +40,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 +57,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 +79,7 @@ static unsigned char read_reg(unsigned char reg) IOR = 1; NICE = 1; + leds_unlock(); return reg; }