Interruptions are signals received by the microcontroller which indicate it must stop the task it is doing to handle an event that has just happened. Interruption control frees the microcontroller from having to control sensors all the time. It also makes the sensors warn Waspmote when a determined value (threshold) is reached.
Waspmote is designed to work with 2 types of interruptions: Synchronous and asynchronous:
All interruptions, both synchronous and asynchronous can wake Waspmote up from the Sleep and the Deep Sleep modes. However, only the synchronous interruption by the RTC is able to wake it up from the Hibernate mode.
The Hibernate mode totally disconnects the Waspmote power, leaving only the battery powering the RTC to wake Waspmote up when the time alarm is reached. Because of this disconnection, when the RTC generates the corresponding alarm, the power in Waspmote is reconnected and the code starts again from the setup.
The way of detecting whether a reboot from the Hibernate mode has happened is to check whether the corresponding flag has been activated. The activation of this flag happens when the ifHibernate()
function is called, which must be done at the beginning of the setup part of the code. This way, when Waspmote starts, it tests if it is a normal start or if it is a start from the Hibernate mode.
All information about the programming and operation of interruptions can be found in the Interruptions Programming Guide.