summaryrefslogtreecommitdiff
path: root/sys/arch/zaurus/dev
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-03-27 23:23:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-03-27 23:23:23 +0000
commita485462e6fac1d321ded7e6dab26d7cd116b56ff (patch)
tree41e4deb45c49d0c3a8be6d3fe5db4783cff00542 /sys/arch/zaurus/dev
parentc642d8b02757dbe7ceb58617053b3788417f834c (diff)
only actually change the drive LED state if there was a real state change;
tested by robert and myself
Diffstat (limited to 'sys/arch/zaurus/dev')
-rw-r--r--sys/arch/zaurus/dev/zaurus_scoop.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/arch/zaurus/dev/zaurus_scoop.c b/sys/arch/zaurus/dev/zaurus_scoop.c
index f88d5a8169b..795a36d53ce 100644
--- a/sys/arch/zaurus/dev/zaurus_scoop.c
+++ b/sys/arch/zaurus/dev/zaurus_scoop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_scoop.c,v 1.14 2007/03/26 20:18:09 deraadt Exp $ */
+/* $OpenBSD: zaurus_scoop.c,v 1.15 2007/03/27 23:23:22 deraadt Exp $ */
/*
* Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de>
@@ -408,6 +408,7 @@ scoop_timeout(void *v)
{
extern struct disklist_head disklist;
static struct disk *dk;
+ static int state = 0;
if (dk == NULL) {
for (dk = TAILQ_FIRST(&disklist); dk;
@@ -417,7 +418,13 @@ scoop_timeout(void *v)
break;
}
- if (dk)
- scoop_led_set(SCOOP_LED_GREEN, dk->dk_busy ? 1 : 0);
+ if (dk) {
+ int newstate = (dk->dk_busy ? 1 : 0);
+
+ if (newstate != state) {
+ state = newstate;
+ scoop_led_set(SCOOP_LED_GREEN, newstate);
+ }
+ }
timeout_add(&scoop_checkdisk, hz/25);
}