As Weddington, Eric wrote: > So the timing is split into 2 steps. > - Set BODS | BODSE > - Within 4 cycles, set BODS and clear BODSE > - Withing 3 cycles, sleep. > > So I believe the timing constraints could still be matched.
Seems so. What I like about your piece of code is that it would automagically move from IN/OUT to LDS/STS when needed. What I don't like about it is that the actual action is made ``behind the scene'' so it's pretty unobvious how it works, and nobody can really tell you whether that semi abuse will do all the time. It somewhat reminds me my old Z80 days when it was pretty standard to have "self-modifying code" (e.g. instead of branching on a condition variable, the code modified a JMP opcode in another place into a JNZ opcode or such -- you saved the space for the condition variable that way): looked pretty cool once you grasped it, but was so completely unobvious that anyone not acquainted with the technique would not get the slightest idea about how it actually worked. -- cheers, J"org .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/ NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-) _______________________________________________ AVR-libc-dev mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/avr-libc-dev
