Skip to content
Snippets Groups Projects
Commit 69777ed0 authored by Christian Werner's avatar Christian Werner
Browse files

update ProcessEventButton

parent 231f56f9
Branches
No related tags found
No related merge requests found
/* mbed Microcontroller Library
* Copyright (c) 2019 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*/
// benchmarking unit test DO NOT EDIT:
#include "ButtonEvent.hpp"
......@@ -19,13 +13,9 @@ Timer t;
void ProcessButtonEvent(const ButtonEvent& e ) {
if(e.GetType() == ButtonEvent::shortPress) {
led = !led; // toggle LED1
}
if(e.GetType() == ButtonEvent::longPress) {
} else if(e.GetType() == ButtonEvent::longPress) {
led = 0;
}
if(e.GetType() == ButtonEvent::veryLongPress) {
} else if(e.GetType() == ButtonEvent::veryLongPress) {
led = 1;
}
}
......@@ -40,4 +30,4 @@ int main()
bed.Dispatch(ButtonEvent(ButtonEvent::veryLongPress, ButtonEvent::button2));
}
printf("Iterations: %u\r\n", iterations);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment