I have an application running on Linux where I want to wake up the system some seconds after it have been suspended-to-RAM.
I have set the RTC to wake up the system in 20 seconds by writing +20
to /sys/class/rtc/rtc0/wakealarm
on my Linux system and this works fine. The code resumes executing at the next line after I did the suspend-to-RAM, as expected.
I want to know if there is some way to figure out what triggered a system wake up, if it was the RTC or a keyboard key press event. Is there some way to figure out the source of the wake event?