Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbsh5/dev Use a more aesthetically pleasing 10% du...



details:   https://anonhg.NetBSD.org/src/rev/de2e2b094a0b
branches:  trunk
changeset: 537738:de2e2b094a0b
user:      scw <scw%NetBSD.org@localhost>
date:      Sat Oct 05 12:18:58 2002 +0000

description:
Use a more aesthetically pleasing 10% duty-cycle for the heartbeat LED.

diffstat:

 sys/arch/evbsh5/dev/sysfpga.c |  19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diffs (41 lines):

diff -r 128dff69b3e6 -r de2e2b094a0b sys/arch/evbsh5/dev/sysfpga.c
--- a/sys/arch/evbsh5/dev/sysfpga.c     Sat Oct 05 11:59:03 2002 +0000
+++ b/sys/arch/evbsh5/dev/sysfpga.c     Sat Oct 05 12:18:58 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysfpga.c,v 1.10 2002/10/05 10:59:10 scw Exp $ */
+/*     $NetBSD: sysfpga.c,v 1.11 2002/10/05 12:18:58 scw Exp $ */
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -106,7 +106,11 @@
 #define        sysfpga_reg_write(s,r,v)        \
            bus_space_write_4((s)->sc_bust, (s)->sc_bush, (r), (v))
 
-
+/*
+ * Flash the Discrete LED twice per second, with 10% duty-cycle for ON
+ */
+#define        TWINKLE_PERIOD  (hz / 2)
+#define        TWINKLE_DUTY    10
 static void sysfpga_twinkle_led(void *);
 
 #if NSUPERIO > 0
@@ -261,16 +265,9 @@
        sysfpga_reg_write(sc, SYSFPGA_REG_LEDCR, ledcr);
        ledcr &= SYSFPGA_LEDCR_SLED_MASK;
 
-       /*
-        * We flash the LED twice per second, with 25% duty-cycle for ON
-        */
-#define        TWINKLE_PERIOD  (hz / 2)
-
        next = (ledcr == SYSFPGA_LEDCR_SLED_ON) ?
-           TWINKLE_PERIOD / 4 :
-           TWINKLE_PERIOD - (TWINKLE_PERIOD / 4);
-
-#undef TWINKLE_PERIOD
+           TWINKLE_PERIOD / (100 / TWINKLE_DUTY) :
+           TWINKLE_PERIOD - (TWINKLE_PERIOD / (100 / TWINKLE_DUTY));
 
        callout_reset(&sc->sc_ledco, next, sysfpga_twinkle_led, sc);
 }



Home | Main Index | Thread Index | Old Index