Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
François Revol
firmware
Commits
b13681e7
Commit
b13681e7
authored
Jul 20, 2020
by
schneider
Browse files
fix(vibra): Deal with durations <= 0
parent
de1e0902
Changes
1
Hide whitespace changes
Inline
Side-by-side
epicardium/modules/vibra.c
View file @
b13681e7
...
...
@@ -27,15 +27,21 @@ void epic_vibra_vibrate(int millis)
{
int
ticks
=
millis
*
(
configTICK_RATE_HZ
/
1000
);
/* Make sure the duration is valid */
if
(
ticks
<
1
)
{
/* Disable a potentially running motor */
epic_vibra_set
(
0
);
return
;
}
if
(
vibra_timer
==
NULL
)
{
vibra_timer
=
xTimerCreateStatic
(
"vibratimer"
,
ticks
,
pdFALSE
,
pdFALSE
,
/* one-shot */
0
,
vTimerCallback
,
&
vibra_timer_data
);
&
vibra_timer_data
);
}
if
(
vibra_timer
!=
NULL
)
{
epic_vibra_set
(
1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment