the idea to add an additional transistor has made me test the following schema:
(BTW, I've added an optocoupler rather than a transistor because I was afraid to fry pin2)
and it works!!!
Pressing the pushbutton, LED starts blinking: I then release the pushbutton and led flashes 10 times, than power goes down!Thanks michael_x
for your testing... I'm going to test the schema you have proposed.
Does anybody see any disadvantage in mine?
Thanks daatse for the reference to sleep code, but my goal is to switch completely the board off