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
cb1712d5
Commit
cb1712d5
authored
5 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
fix(leds): Consolidate led locking
parent
9c5d8003
No related branches found
No related tags found
1 merge request
!369
Fix LED mutex stuff
Pipeline
#4464
passed
5 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
epicardium/modules/leds.c
+2
-6
2 additions, 6 deletions
epicardium/modules/leds.c
epicardium/modules/personal_state.c
+2
-15
2 additions, 15 deletions
epicardium/modules/personal_state.c
with
4 additions
and
21 deletions
epicardium/modules/leds.c
+
2
−
6
View file @
cb1712d5
...
...
@@ -99,9 +99,7 @@ void epic_leds_dim_top(uint8_t value)
{
leds_set_dim_top
(
value
);
if
(
personal_state_enabled
()
==
0
)
{
hwlock_acquire
(
HWLOCK_I2C
);
leds_update
();
hwlock_release
(
HWLOCK_I2C
);
do_update
();
}
}
...
...
@@ -109,9 +107,7 @@ void epic_leds_dim_bottom(uint8_t value)
{
leds_set_dim_bottom
(
value
);
if
(
personal_state_enabled
()
==
0
)
{
hwlock_acquire
(
HWLOCK_I2C
);
leds_update
();
hwlock_release
(
HWLOCK_I2C
);
do_update
();
}
}
...
...
This diff is collapsed.
Click to expand it.
epicardium/modules/personal_state.c
+
2
−
15
View file @
cb1712d5
...
...
@@ -31,13 +31,8 @@ int epic_personal_state_set(uint8_t state, bool persistent)
personal_state_persistent
=
persistent
;
if
(
was_enabled
&&
!
_personal_state_enabled
)
{
hwlock_acquire
(
HWLOCK_LED
);
leds_prep
(
PERSONAL_STATE_LED
,
0
,
0
,
0
);
leds_update_power
();
leds_update
();
hwlock_release
(
HWLOCK_LED
);
epic_leds_update
();
}
return
0
;
...
...
@@ -58,8 +53,6 @@ void vLedTask(void *pvParameters)
const
int
led_animation_rate
=
1000
/
25
;
/* 25Hz -> 40ms*/
while
(
1
)
{
if
(
_personal_state_enabled
)
{
hwlock_acquire
(
HWLOCK_LED
);
led_animation_ticks
++
;
if
(
personal_state
==
STATE_NO_CONTACT
)
{
leds_prep
(
PERSONAL_STATE_LED
,
255
,
0
,
0
);
...
...
@@ -126,13 +119,7 @@ void vLedTask(void *pvParameters)
led_animation_rate
))));
}
hwlock_acquire
(
HWLOCK_I2C
);
leds_update_power
();
leds_update
();
hwlock_release
(
HWLOCK_I2C
);
hwlock_release
(
HWLOCK_LED
);
epic_leds_update
();
}
vTaskDelay
(
led_animation_rate
/
portTICK_PERIOD_MS
);
...
...
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