noInterrupts();
MCUCR |= _BV(BODS) | _BV(BODSE);
MCUCR = (MCUCR | _BV(BODS) ) & ~(_BV(BODSE));
interrupts();
sleep_mode();
vs
noInterrupts();
MCUCR = bit(BODS) | bit(BODSE); // turn on brown-out enable select
MCUCR = bit(BODS);
interrupts(); // this must be done within 4 clock cycles of above
sleep_mode();
The first works properly
The second keeps waking or resetting the MCU
What is the operational difference?
Does the "bit" macro uses more clock cycles?
BV is also a macro.