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.
Diff: BtnEventM0.h
- Revision:
- 7:d6677cae0add
- Parent:
- 6:cc64c2ff26b0
- Child:
- 8:e2f768aad0a6
diff -r cc64c2ff26b0 -r d6677cae0add BtnEventM0.h
--- a/BtnEventM0.h Wed Jan 14 09:12:57 2015 +0000
+++ b/BtnEventM0.h Thu Jan 29 07:03:32 2015 +0000
@@ -9,6 +9,7 @@
pressed=0;
}
+ // Ist eine steigende Flanke aufgetreten ?
int CheckFlag() {
if( pressed ) {
pressed=0;
@@ -17,9 +18,9 @@
return 0;
}
- void CheckButton() {
- if( _isr.read() )
- pressed = 1;
+ // 1..Button is pressed else 0
+ int CheckButton() {
+ return _isr.read();
}
void Init() {
@@ -87,11 +88,13 @@
};
*/
-class AnalogInHL : public AnalogIn {
- public:
- AnalogInHL(PinName pin) : AnalogIn(pin) { }
- int Read()
- { return read_u16()>>6; }
+class AnalogInHL : public AnalogIn
+{
+public:
+ AnalogInHL(PinName pin) : AnalogIn(pin) { }
+ int Read() {
+ return read_u16()>>6;
+ }
};