spark/core-firmware — pull request #265 by satishgn (2014-08-13 12:20:32+00:00)
Title: Implemented Wakeup from sleep with interrupt #95

Can use the following method for wakeup from sleep:
Spark.sleep(uint16_t wakeUpPin, uint16_t edgeTriggerMode);

Example:
Here calling this function will immediately stop the Core and then if a High voltage/Logic 1 is applied on D2 pin, Core will wakeup from sleep.
Spark.sleep(D2, RISING);

SImilarly if the edge triggered mode is set to "FALLING" applying Low voltage/Logic 0 will wakeup from sleep
Spark.sleep(D2, FALLING);