summaryrefslogtreecommitdiff
path: root/third_party/TouchSense/stmCriticalSection.h
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2023-03-05 20:20:45 +0300
committerOxore <oxore@protonmail.com>2023-03-05 20:20:45 +0300
commitea807de65b0485ac58b6eae576209c64d4d5c4e9 (patch)
treeb4264d20e1d700cfd9e0ece9d847a825dd1dfc03 /third_party/TouchSense/stmCriticalSection.h
parentdd01e7ed22cea652061f0d12cecf929e04b285e9 (diff)
Split app code and third party libraries
Diffstat (limited to 'third_party/TouchSense/stmCriticalSection.h')
-rw-r--r--third_party/TouchSense/stmCriticalSection.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/third_party/TouchSense/stmCriticalSection.h b/third_party/TouchSense/stmCriticalSection.h
new file mode 100644
index 0000000..dc864f7
--- /dev/null
+++ b/third_party/TouchSense/stmCriticalSection.h
@@ -0,0 +1,32 @@
+/******************** (C) COPYRIGHT 2014 STMicroelectronics ********************
+* File Name : stmCriticalSection.h
+* Author : MCD Tools Development
+* Version : V1.0
+* Date : 21/02/2013
+* Description : This file provides a mechanism for STMStudio host/target
+* synchronization. Based on a critical section, using few
+* target resources (in term of code and RAM), but
+* potentially impacting the application runtime (possible
+* waiting loop when enterring the critical section).
+********************************************************************************
+* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
+* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
+* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
+* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
+* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+*******************************************************************************/
+
+#ifndef STM_CRITICAL_SECTION_H
+#define STM_CRITICAL_SECTION_H
+
+/* To call before modifying any critical data. In case the host is inside or
+asked for enterring the critical section, this routine will wait for the host to
+leave the critical section. */
+void enterLock(void);
+
+/* Leave the critical section. If the host is waiting, access will be granted
+to him. Otherwise the first next one asking will own the turn. */
+void exitLock(void);
+
+#endif /* STM_CRITICAL_SECTION_H */