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

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

[avr-gcc-list] Sleep mode


From: 451707
Subject: [avr-gcc-list] Sleep mode
Date: Mon, 23 Aug 2004 16:11:01 +0200
User-agent: Internet Messaging Program (IMP) 3.1


Hello, I want to stop the execution of my program with a sleep mode. Is this
correct??

set_sleep_mode(SLEEP_MODE_IDLE);
         while(1){
              while(!bit) { 
                  sleep_mode()
                 }
                bit=false;

where bit is a flag modify by an interrupt handler

SIGNAL(SIG_OVERFLOW0){  
static int i=0;
        int a=h*7.2; 

        i++;
        if (i==a){
                bit=true;
                i=0;
        }
}

The interrupt handler counts interrupts and when the number is correct sets the
bit to resume the execution.






reply via email to

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