--- embedtools/src/pceng_run.c 2011/07/23 23:41:00 1.1.2.3 +++ embedtools/src/pceng_run.c 2011/07/25 09:13:34 1.1.2.4 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: pceng_run.c,v 1.1.2.3 2011/07/23 23:41:00 misho Exp $ + * $Id: pceng_run.c,v 1.1.2.4 2011/07/25 09:13:34 misho Exp $ * ************************************************************************* The ELWIX and AITNET software is distributed under the following @@ -116,12 +116,20 @@ LED(u_char ledno, u_char state) switch (type) { case wrap: n = inl(led_base[type - 1][ledno]); + if (state == (u_char) -1) + return (n &= (1 << led_bit[type - 1][ledno])); + if (state) n |= (1 << led_bit[type - 1][ledno]); else n &= ~(1 << led_bit[type - 1][ledno]); break; case alix: + if (state == (u_char) -1) { + n = inl(led_base[type - 1][ledno]); + return !(n &= (1 << led_bit[type - 1][ledno])); + } + if (state) n = (1 << (led_bit[type - 1][ledno] + gpio_off[type - 1])); else