Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] ATmega128, flags, semaphores and interrupts

2007-08-02 by David VanHorn

> >If I could Test (save) and Disable Interrupts with an indivisible
> >instruction, run the process then return the original Global
> >Interrupt state I would feel a bit safer...
>
> No REALLY sure what you are trying to do but here we go....
> There are no INVISIBLE instructions...that I can see...... :-)

And that would be sort of an oxymoron.. :)
He meant "atomic", but he did say "indivisible"

> but you can save the status register (SREG), do testing on bits or
> whatever, and then restore the status register which SHOULD re enable
> interrupts.

something like

in  temp,sreg
cli

(do stuff)

out  sreg,temp ;


This might be a case where doing it a little differently would work better.
Remember too, that if you're IN an isr, that ints are disabled till
you RETI, unless you sei them yourself, which I've never had to do.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.