A couple of clarifications on the last message:

> Thus, when you see it printed as 0, somewhere between the test and the 
> printf the controller has updated the flag and indicated it's busy. 

That should of course be "not busy".

> I'd be guessing that the current loop (100k iterations) is probably 
> completing far sooner than 1s.  You could confirm this by grabbing a 
> timestamp at the beginning of amr_start and then checking again at the 
> point where it bails out.  If that's the case, try cutting the initial 
> value of i down to 10,000 and insert a DELAY(100) in the "did not get 
> mailbox" case.

I didn't use DELAY() initially because I wasn't sure it would work 
correctly if called before interrupts are enabled.  That was probably a 
stupid mistake; I would try the above suggestion first as I suspect it'll 
get you going.

Not that I consider this particuarly optimal; busy-waiting for the 
controller is a terrible waste of the host CPU.  A better solution would 
probably defer the command and try again a short time later, but let's 
see if this works first.

-- 
\\ Give a man a fish, and you feed him for a day. \\  Mike Smith
\\ Tell him he should learn how to fish himself,  \\  [EMAIL PROTECTED]
\\ and he'll hate you for a lifetime.             \\  [EMAIL PROTECTED]




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to