avr-gcc-list
[Top][All Lists]
Advanced

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

AW: [avr-gcc-list] Interrupt handling


From: Oliver Schulz
Subject: AW: [avr-gcc-list] Interrupt handling
Date: Wed, 26 May 2004 09:28:08 +0200

Hi Kreyl,

Can you try this:
SIGNAL (SIG_OVERFLOW0)
{};

Notice the braces.

Cheers,
Oliver.


> -----Ursprungliche Nachricht-----
> Von: address@hidden
> [mailto:address@hidden Auftrag von Kreyl Laurelindo
> Gesendet: Dienstag, 25. Mai 2004 07:22
> An: address@hidden
> Betreff: [avr-gcc-list] Interrupt handling
> 
> 
> Hi!
> 
>    Writing asm codes, I usually used things like this:
> 
> ============
> ...
> .org 0x09
> reti         ; Timer0 overflow handler
> 
> ...
> 
> ; in main function:
> ...
> _start:
>         sei
>         sleep   ; enter sleep mode
> 
>         ; do smth
> rjmp _start
> 
> ===========
> 
>    E.g.,  I  did  not  need  anything  else from that "Timer0 overflow
> interrupt  handler"  than just awake from sleep mode. Now, I tried use
> the same in c:
> 
> ==========
> ...
> void init (void)
> {
>    ... //setup timers, sleep mode, usart, etc.
> }
> 
> void main (void)
> {
>    init();
>    while(1)
>    {
>       usart_send('1');
>       sei();
>       sleep();
>       usart_send('2');
>       ... // do something
>    }
> }
> 
> SIGNAL (SIG_OVERFLOW0)
>         ;
> 
> ==============
> 
> So,  if  this  would  work  as I want, I would see '1' and then '2' at
> terminal  window.  But I see only '1', as if 'while' loop begins again
> after awake (not next instruction, as in aseembly). So, I decided I do
> not understand something in interrupts realisation.
> 
> I tried 'asm volatile ("nop"::);' instead of just ';', and this had no
> effect, too.
> 
> Maybe, things of such type would be realised in other way? I just want
> to wake after sleep :-) with no need of special interrupt routines.
> 
> 
>                                                 Kreyl
> 
> 
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://www.avr1.org/mailman/listinfo/avr-gcc-list
> 


reply via email to

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