Skip to content
Snippets Groups Projects
Commit 0702114c authored by rahix's avatar rahix Committed by schneider
Browse files

chore(personal-state): Convert to new hwlock API


Signed-off-by: default avatarRahix <rahix@rahix.de>
parent e489b211
No related branches found
No related tags found
1 merge request!369Fix LED mutex stuff
......@@ -31,9 +31,7 @@ int epic_personal_state_set(uint8_t state, bool persistent)
personal_state_persistent = persistent;
if (was_enabled && !_personal_state_enabled) {
while (hwlock_acquire_timeout(HWLOCK_LED, portMAX_DELAY) < 0) {
vTaskDelay(pdMS_TO_TICKS(1));
}
hwlock_acquire(HWLOCK_LED);
leds_prep(PERSONAL_STATE_LED, 0, 0, 0);
leds_update_power();
......@@ -60,10 +58,7 @@ void vLedTask(void *pvParameters)
const int led_animation_rate = 1000 / 25; /* 25Hz -> 40ms*/
while (1) {
if (_personal_state_enabled) {
while (hwlock_acquire_timeout(
HWLOCK_LED, portMAX_DELAY) < 0) {
vTaskDelay(pdMS_TO_TICKS(1));
}
hwlock_acquire(HWLOCK_LED);
led_animation_ticks++;
if (personal_state == STATE_NO_CONTACT) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment