Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
PowerControl.cpp
- Committer:
- kwasymodo
- Date:
- 2017-05-10
- Revision:
- 1:1bae9ab7241e
- Parent:
- 0:f7568c04c1c3
- Child:
- 2:1e3291e8294d
File content as of revision 1:1bae9ab7241e:
#include "PowerControl.h"
extern RawSerial pc;
PowerControl::PowerControl(PinName greenButton, PinName redButton):
_greenButton(greenButton), _redButton(redButton)
{
_greenButton.mode(PullUp);
_greenButton.fall(this, &PowerControl::goSleep);
_redButton.mode(PullUp);
_redButton.fall(this, &PowerControl::goSleep);
}
void PowerControl::goSleep(void)
{
pc.printf("going to sleep\r\n");
sleep();
}