Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
optimization-size-ost-solution
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cpp-course-day-3
optimization-size-ost-solution
Commits
69777ed0
Commit
69777ed0
authored
1 year ago
by
Christian Werner
Browse files
Options
Downloads
Patches
Plain Diff
update ProcessEventButton
parent
231f56f9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.cpp
+3
-13
3 additions, 13 deletions
main.cpp
with
3 additions
and
13 deletions
main.cpp
+
3
−
13
View file @
69777ed0
/* 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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment