Commit 0702114c authored by Rahix's avatar Rahix Committed by schneider

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

Signed-off-by: Rahix's avatarRahix <rahix@rahix.de>
parent e489b211
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment