diff options
author | cognet <cognet@FreeBSD.org> | 2005-01-16 13:18:52 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2005-01-16 13:18:52 +0000 |
commit | 5dcea2459eb6d81bdeb33495b7cb226baf1fa35b (patch) | |
tree | 25fa8bbbb17956cb38b33e8b653e1052c05ab779 /sys | |
parent | 3f738b3942414ab97dc6362bb307c547bb6057c4 (diff) | |
download | FreeBSD-src-5dcea2459eb6d81bdeb33495b7cb226baf1fa35b.zip FreeBSD-src-5dcea2459eb6d81bdeb33495b7cb226baf1fa35b.tar.gz |
Add a new sysctl, hw.sevenseg.freq, to control the update frequency.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arm/xscale/i80321/iq31244_7seg.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/arm/xscale/i80321/iq31244_7seg.c b/sys/arm/xscale/i80321/iq31244_7seg.c index ca6d1cf..af9cb04 100644 --- a/sys/arm/xscale/i80321/iq31244_7seg.c +++ b/sys/arm/xscale/i80321/iq31244_7seg.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/module.h> #include <sys/bus.h> +#include <sys/sysctl.h> #include <machine/bus.h> @@ -333,6 +334,10 @@ static const uint8_t snakemap[][2] = { { ~SEG_B, ~SEG_F }, }; +SYSCTL_NODE(_hw, OID_AUTO, sevenseg, CTLFLAG_RD, 0, "7 seg"); +static int freq = 100; +SYSCTL_INT(_hw_sevenseg, OID_AUTO, freq, CTLFLAG_RW, &freq, 0, + "7 Seg update frequency"); static void iq31244_7seg_snake(void) { @@ -340,7 +345,7 @@ iq31244_7seg_snake(void) int cur = snakestate; snakefreq++; - if ((snakefreq & (0xff))) + if ((snakefreq % freq)) return; WRITE(IQ80321_7SEG_MSB, snakemap[cur][0]); WRITE(IQ80321_7SEG_LSB, snakemap[cur][1]); |