My bad. LDI takes 1 cycle, and it's not even here. The reason is that OUT
instruction enables interrupts here, and interrupt can occure before the
second STS instruction.

2012/11/19 Anton Voloshin <zombi...@gmail.com>

> The code was compiled on windows with -Os optimization for Atmega
> 1284P. The "ldi" instruction takes 2 cycles, according to disassembly
> listing.
>
> wdt_enable() didn't work for me until I made this correction.
>
>
> 2012/11/19 Joerg Wunsch <invalid.nore...@gnu.org>
>
>> Follow-up Comment #1, bug #37772 (project avr-libc):
>>
>> Well, this inline assembly statement has been written that
>> way for years now, and was proven to work.  How did you
>> verify it doesn't work, and for which controller type?
>>
>> The OUT instruction takes one CPU cycle, and the STS
>> instruction two cycles, that's why the four-cycle requirement
>> is still maintained.
>>
>>     _______________________________________________________
>>
>> Reply to this item at:
>>
>>   <http://savannah.nongnu.org/bugs/?37772>
>>
>> _______________________________________________
>>   Message sent via/by Savannah
>>   http://savannah.nongnu.org/
>>
>>
>
>
> --
> Anton Voloshin
> Jabber: zombi...@bitcheese.net
>



-- 
Anton Voloshin
Jabber: zombi...@bitcheese.net
_______________________________________________
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to