I found out that if I retain everything in my original code but replace
sleep_cpu() in sleep function with sleep_enable() then it is able to wake up when flow returns. But the problem is that when it goes to sleep the current draw is 8.7 and 3.5 mA which is very high.
I dont know why sleep_cpu will not allow ATtiny to wake up and sleep_enable will?
Any idead.
Thanks