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
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
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
card10
firmware
Commits
1b0df22d
Commit
1b0df22d
authored
5 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
fix(vibra): Don't crash when called while running
Closes #109
parent
15c8971b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#3945
passed
5 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
epicardium/modules/vibra.c
+11
-5
11 additions, 5 deletions
epicardium/modules/vibra.c
with
11 additions
and
5 deletions
epicardium/modules/vibra.c
+
11
−
5
View file @
1b0df22d
...
...
@@ -6,7 +6,7 @@ static const gpio_cfg_t motor_pin = {
PORT_0
,
PIN_8
,
GPIO_FUNC_OUT
,
GPIO_PAD_NONE
};
static
TimerHandle_t
vibra_timer
;
static
TimerHandle_t
vibra_timer
=
NULL
;
void
epic_vibra_set
(
int
status
)
{
...
...
@@ -25,8 +25,14 @@ void vTimerCallback()
void
epic_vibra_vibrate
(
int
millis
)
{
int
ticks
=
millis
*
(
configTICK_RATE_HZ
/
1000
);
epic_vibra_set
(
1
);
vibra_timer
=
xTimerCreate
(
"vibratimer"
,
ticks
,
pdFALSE
,
0
,
vTimerCallback
);
xTimerStart
(
vibra_timer
,
0
);
if
(
vibra_timer
==
NULL
)
{
vibra_timer
=
xTimerCreate
(
"vibratimer"
,
ticks
,
pdFALSE
,
0
,
vTimerCallback
);
}
if
(
vibra_timer
!=
NULL
)
{
epic_vibra_set
(
1
);
xTimerChangePeriod
(
vibra_timer
,
ticks
,
0
);
}
}
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