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
de0e4539
Verified
Commit
de0e4539
authored
5 years ago
by
rahix
Browse files
Options
Downloads
Patches
Plain Diff
fix(leds): Add a few missing instances of locking
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
03825955
Branches
Branches containing commit
Tags
v1.10
Tags containing commit
1 merge request
!312
Add a few missing instances of locking
Pipeline
#3935
passed
5 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
epicardium/modules/leds.c
+34
-2
34 additions, 2 deletions
epicardium/modules/leds.c
with
34 additions
and
2 deletions
epicardium/modules/leds.c
+
34
−
2
View file @
de0e4539
...
@@ -95,21 +95,41 @@ void epic_leds_set_all_hsv(float *pattern_ptr, uint8_t len)
...
@@ -95,21 +95,41 @@ void epic_leds_set_all_hsv(float *pattern_ptr, uint8_t len)
void
epic_leds_dim_top
(
uint8_t
value
)
void
epic_leds_dim_top
(
uint8_t
value
)
{
{
leds_set_dim_top
(
value
);
leds_set_dim_top
(
value
);
if
(
personal_state_enabled
()
==
0
)
if
(
personal_state_enabled
()
==
0
)
{
while
(
hwlock_acquire
(
HWLOCK_I2C
,
pdMS_TO_TICKS
(
1
))
<
0
)
{
vTaskDelay
(
pdMS_TO_TICKS
(
1
));
}
leds_update
();
leds_update
();
hwlock_release
(
HWLOCK_I2C
);
}
}
}
void
epic_leds_dim_bottom
(
uint8_t
value
)
void
epic_leds_dim_bottom
(
uint8_t
value
)
{
{
leds_set_dim_bottom
(
value
);
leds_set_dim_bottom
(
value
);
if
(
personal_state_enabled
()
==
0
)
if
(
personal_state_enabled
()
==
0
)
{
while
(
hwlock_acquire
(
HWLOCK_I2C
,
pdMS_TO_TICKS
(
1
))
<
0
)
{
vTaskDelay
(
pdMS_TO_TICKS
(
1
));
}
leds_update
();
leds_update
();
hwlock_release
(
HWLOCK_I2C
);
}
}
}
void
epic_leds_set_rocket
(
int
led
,
uint8_t
value
)
void
epic_leds_set_rocket
(
int
led
,
uint8_t
value
)
{
{
while
(
hwlock_acquire
(
HWLOCK_I2C
,
pdMS_TO_TICKS
(
1
))
<
0
)
{
vTaskDelay
(
pdMS_TO_TICKS
(
1
));
}
value
=
value
>
31
?
31
:
value
;
value
=
value
>
31
?
31
:
value
;
pmic_set_led
(
led
,
value
);
pmic_set_led
(
led
,
value
);
hwlock_release
(
HWLOCK_I2C
);
}
}
int
epic_leds_get_rocket
(
int
led
)
int
epic_leds_get_rocket
(
int
led
)
...
@@ -126,7 +146,13 @@ int epic_leds_get_rocket(int led)
...
@@ -126,7 +146,13 @@ int epic_leds_get_rocket(int led)
void
epic_set_flashlight
(
bool
power
)
void
epic_set_flashlight
(
bool
power
)
{
{
while
(
hwlock_acquire
(
HWLOCK_I2C
,
pdMS_TO_TICKS
(
1
))
<
0
)
{
vTaskDelay
(
pdMS_TO_TICKS
(
1
));
}
leds_flashlight
(
power
);
leds_flashlight
(
power
);
hwlock_release
(
HWLOCK_I2C
);
}
}
void
epic_leds_update
(
void
)
void
epic_leds_update
(
void
)
...
@@ -136,7 +162,13 @@ void epic_leds_update(void)
...
@@ -136,7 +162,13 @@ void epic_leds_update(void)
void
epic_leds_set_powersave
(
bool
eco
)
void
epic_leds_set_powersave
(
bool
eco
)
{
{
while
(
hwlock_acquire
(
HWLOCK_I2C
,
pdMS_TO_TICKS
(
1
))
<
0
)
{
vTaskDelay
(
pdMS_TO_TICKS
(
1
));
}
leds_powersave
(
eco
);
leds_powersave
(
eco
);
hwlock_release
(
HWLOCK_I2C
);
}
}
void
epic_leds_set_gamma_table
(
uint8_t
rgb_channel
,
uint8_t
gamma_table
[
256
])
void
epic_leds_set_gamma_table
(
uint8_t
rgb_channel
,
uint8_t
gamma_table
[
256
])
...
...
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