New resistors for R1/R2 aren’t there yet, bit I couldn’t resist changing the code. Just adding the two lines about ADC brought the sleep mode current down from 0.254mA to 0.89mA 0.089mA at 4V. It’s even down to 0.068mA at a more relevant 3V.
That’s so simple and effective, when you know what to do. Again thanks TomE for the hint.
void sleep_until_switch_press() {
WDT_off();
ADC_off(); // <++++++++++++++
press_duration = 0;
while (is_pressed()) {
_delay_ms(16);
}
PCINT_on();
sleep_mode();
PCINT_off();
ADC_on(); // <++++++++++++++
WDT_on();
}
.
EDIT Oct 16: The above values were with 33k/8k2 as R1/R2. In the meantime I changed to 330k/82k and that brought the current when off down to 11µA (0.011mA) with a cell that is 3.3V resting. LVP still working as before. Now that’s really good.