I'm trying to slim down an ATA-5 compliant driver I wrote for a small embedded system (no OS). I have always ensured that Status[BSY] is clear, Status[DRDY] is set, and if I ever get an error I would immediate clear the error by issuing a EXECUTE DEVICE DIAGNOSTIC command.
Now this takes some time an I'd like to "pipeline" my commands a by simply checking that Status[BSY] is clear and *either* DRDY is set *or* ERR is set. My thinking is that I will always report errors when they occur but I'd prefer to let that state sit there until I issue the next real command.
Does this seem logical? Correct?
Thanks.