Share this page to your:
Mastodon

Hardware Class

One of the core classes in the Vortex Manipulator is Hardware.cpp which acts as an interface to almost all the hardware. Almost because the graphics library is called directly and SD file operations are too.

But because of the possibility that the underlying hardware might change it seemed prudent to have this class hold all the rest of the hardware related calls. So what's in here?

It is worth saying a little more about sleep and wake functions because there are two kinds of sleep.

sleep() is a soft sleep. The graphics are turned off, including the backlight, and the compass is shut down. This is triggered when you put your wrist down so the screen isn't glowing when you aren't looking at it. The opposite function: wake() is triggered when you lift your wrist up to look at the screen. Naturally in light sleep the device is still listening for gestures and touch.

shutdown() is a deeper sleep. This is triggered by the Sleep app and it shuts down everything, including the processor. So there is no gesture handling or heart rate monitored. You wake it by pressing the button. It is interesting that when the button is pressed the shutdown() method continues from where it went to sleep, but some things need to be reinitialised.