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
card10
firmware
Commits
4df65b58
Commit
4df65b58
authored
Sep 14, 2019
by
schneider
Browse files
Merge branch 'rahix/fix-locks' into 'master'
Add a few missing instances of locking See merge request
!312
parents
03825955
de0e4539
Pipeline
#3936
passed with stages
in 51 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
epicardium/modules/leds.c
View file @
4df65b58
...
...
@@ -95,21 +95,41 @@ void epic_leds_set_all_hsv(float *pattern_ptr, uint8_t len)
void
epic_leds_dim_top
(
uint8_t
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
();
hwlock_release
(
HWLOCK_I2C
);
}
}
void
epic_leds_dim_bottom
(
uint8_t
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
();
hwlock_release
(
HWLOCK_I2C
);
}
}
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
;
pmic_set_led
(
led
,
value
);
hwlock_release
(
HWLOCK_I2C
);
}
int
epic_leds_get_rocket
(
int
led
)
...
...
@@ -126,7 +146,13 @@ int epic_leds_get_rocket(int led)
void
epic_set_flashlight
(
bool
power
)
{
while
(
hwlock_acquire
(
HWLOCK_I2C
,
pdMS_TO_TICKS
(
1
))
<
0
)
{
vTaskDelay
(
pdMS_TO_TICKS
(
1
));
}
leds_flashlight
(
power
);
hwlock_release
(
HWLOCK_I2C
);
}
void
epic_leds_update
(
void
)
...
...
@@ -136,7 +162,13 @@ void epic_leds_update(void)
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
);
hwlock_release
(
HWLOCK_I2C
);
}
void
epic_leds_set_gamma_table
(
uint8_t
rgb_channel
,
uint8_t
gamma_table
[
256
])
...
...
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