Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
fleur
firmware
Commits
58acc803
Commit
58acc803
authored
5 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
change(vibra): Use a static timer
Closes #50
parent
1b0df22d
No related branches found
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
epicardium/modules/vibra.c
+8
-2
8 additions, 2 deletions
epicardium/modules/vibra.c
with
8 additions
and
2 deletions
epicardium/modules/vibra.c
+
8
−
2
View file @
58acc803
...
...
@@ -6,6 +6,7 @@ static const gpio_cfg_t motor_pin = {
PORT_0
,
PIN_8
,
GPIO_FUNC_OUT
,
GPIO_PAD_NONE
};
static
StaticTimer_t
vibra_timer_data
;
static
TimerHandle_t
vibra_timer
=
NULL
;
void
epic_vibra_set
(
int
status
)
...
...
@@ -27,8 +28,13 @@ void epic_vibra_vibrate(int millis)
int
ticks
=
millis
*
(
configTICK_RATE_HZ
/
1000
);
if
(
vibra_timer
==
NULL
)
{
vibra_timer
=
xTimerCreate
(
"vibratimer"
,
ticks
,
pdFALSE
,
0
,
vTimerCallback
vibra_timer
=
xTimerCreateStatic
(
"vibratimer"
,
ticks
,
pdFALSE
,
0
,
vTimerCallback
,
&
vibra_timer_data
);
}
if
(
vibra_timer
!=
NULL
)
{
...
...
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