Subject: Re: Dallas semiconductor "one-wire" and envsys(4)
To: None <current-users@NetBSD.org>
From: Ken Hornstein <kenh@cmf.nrl.navy.mil>
List: current-users
Date: 02/27/2006 18:40:41
>Though I haven't tried it and don't know that I'd want to, it seems
>like the same approaches could be used to reduce the impact of
>spinning with interrupts masked. Could leave more interrupts unmasked
>for the benefit of the rest of the system, and if one happens to
>interrupt you at a critical moment, well, you got a bad read, and you
>delay() a little for good citizenship's sake, and try, try again.
The problem is, as I understand it, the actual bit-level operations require
timing down to the tens of microseconds (you bit-bang a pulse, put the pin
into high-impedance state, and if you see a one within a certain time
window, that's a one ... otherwise it's a zero). I would think that would
be tough to do without masking interrupts. When I did it it was on an
embedded board and I counted instructions to make sure the timing worked
out. I think it would be tricky to make that work inside of the kernel,
but hey, if he got it working, more power to him! It seems that most people
use some kind of adapter when they're working with general-purpose OS's.
--Ken