Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
firmware
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zenox
firmware
Commits
cb1712d5
Commit
cb1712d5
authored
Jan 24, 2020
by
schneider
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(leds): Consolidate led locking
parent
9c5d8003
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
21 deletions
+4
-21
epicardium/modules/leds.c
epicardium/modules/leds.c
+2
-6
epicardium/modules/personal_state.c
epicardium/modules/personal_state.c
+2
-15
No files found.
epicardium/modules/leds.c
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
();
}
}
...
...
epicardium/modules/personal_state.c
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
);
...
...
Write
Preview
Markdown
is supported
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