From 0702114c8ef5faa729918776f9985bc9f60dc05b Mon Sep 17 00:00:00 2001
From: Rahix <rahix@rahix.de>
Date: Fri, 17 Jan 2020 19:54:36 +0100
Subject: [PATCH] chore(personal-state): Convert to new hwlock API

Signed-off-by: Rahix <rahix@rahix.de>
---
 epicardium/modules/personal_state.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/epicardium/modules/personal_state.c b/epicardium/modules/personal_state.c
index 08028b58..3aa5138a 100644
--- a/epicardium/modules/personal_state.c
+++ b/epicardium/modules/personal_state.c
@@ -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) {
-- 
GitLab