8.9.10 builtin_avr_sleep Built-in Function

Inserts a sleep instruction, which places the device in sleep mode.

Prototype

void __builtin_avr_sleep(void);

Example

void operationMode(unsigned char channel)
{
  unsigned char val, status=GO;

  while(status) {
    val = readData(channel);
    __builtin_avr_wdr();
    status = processData(val);
    if(status == WAIT) {
      __builtin_avr_sleep();
      status = GO;
    }
    __builtin_avr_wdr();
  }
}