From e6de8e5ff55cf680122a0a60bae2718432c493f6 Mon Sep 17 00:00:00 2001
From: Martin/Geno <geno+dev@fireorbit.de>
Date: Mon, 26 Aug 2019 16:57:24 +0200
Subject: [PATCH] ble: card10 svc - lcd display does not need locking anymore

---
 Documentation/bluetooth/card10.rst |  1 -
 epicardium/ble/card10.c            | 11 -----------
 2 files changed, 12 deletions(-)

diff --git a/Documentation/bluetooth/card10.rst b/Documentation/bluetooth/card10.rst
index 3326d6d0..f27de918 100644
--- a/Documentation/bluetooth/card10.rst
+++ b/Documentation/bluetooth/card10.rst
@@ -183,7 +183,6 @@ By defining 11x rgb from left to right. You need also to set exchange a bigger M
 LCD brightness characteristic
 ---------------------------------
 This charatieristic set the brightness of the lcd backlight 0-100 in ``uint16``.
-It works only, if no application (pycardium app) blocks the screen.
 
 - set to 100 % ``0x6400``
 - set to 20 % ``0x1400`` (default value)
diff --git a/epicardium/ble/card10.c b/epicardium/ble/card10.c
index 9551f789..73af944d 100644
--- a/epicardium/ble/card10.c
+++ b/epicardium/ble/card10.c
@@ -736,14 +736,6 @@ static uint8_t writeCard10CB(
 		}
 		return ATT_SUCCESS;
 	case CARD10_LCD_BRIGHTNESS_VAL_HDL:
-		intVar = epic_disp_open();
-		if (intVar < 0) {
-			APP_TRACE_INFO1(
-				"ble-card10: lock display to set brightness failed: %d",
-				intVar
-			);
-			return ATT_ERR_RANGE;
-		}
 		BYTES_TO_UINT16(ui16, pValue);
 		intVar = epic_disp_backlight(ui16);
 		APP_TRACE_INFO2(
@@ -751,9 +743,6 @@ static uint8_t writeCard10CB(
 			ui16,
 			intVar
 		);
-		epic_disp_close();
-		if (intVar < 0)
-			return ATT_ERR_RANGE;
 		return ATT_SUCCESS;
 	default:
 		APP_TRACE_INFO1(
-- 
GitLab