From ebfb5baa53c72ada270a6f6ad4bf03edd98ff7eb Mon Sep 17 00:00:00 2001 From: Mike Baker Date: Sat, 4 Nov 2006 04:02:20 +0000 Subject: [PATCH] sb_gpioout() doesn't honor mask correctly SVN-Revision: 5440 --- openwrt/target/linux/package/diag/src/diag.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openwrt/target/linux/package/diag/src/diag.c b/openwrt/target/linux/package/diag/src/diag.c index d975137f87..5f0e07acda 100644 --- a/openwrt/target/linux/package/diag/src/diag.c +++ b/openwrt/target/linux/package/diag/src/diag.c @@ -591,8 +591,8 @@ static void button_handler(int irq, void *dev_id, struct pt_regs *regs) static void register_leds(struct led_t *l) { struct proc_dir_entry *p; - u32 mask; - u32 val; + u32 mask = 0; + u32 val = 0; leds = proc_mkdir("led", diag); if (!leds) @@ -661,6 +661,8 @@ static void led_flash(unsigned long dummy) { if (mask) { u32 val = ~sb_gpioin(sbh); + val &= mask; + sb_gpioouten(sbh, mask, mask); sb_gpiocontrol(sbh, mask, 0); sb_gpioout(sbh, mask, val); -- 2.30.2