[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] [RFC] Sleeping BOD API

From: Joerg Wunsch
Subject: Re: [avr-libc-dev] [RFC] Sleeping BOD API
Date: Fri, 6 Feb 2009 23:55:24 +0100
User-agent: Mutt/1.5.11

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. ;-)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]