We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c38fa41 commit 83c2615Copy full SHA for 83c2615
src/optiga/pal/pal_os_lock.c
@@ -37,6 +37,8 @@
37
38
#include "pal_os_lock.h"
39
40
+#include <hal_atomic.h>
41
+
42
void pal_os_lock_create(pal_os_lock_t* p_lock, uint8_t lock_type)
43
{
44
p_lock->type = lock_type;
@@ -73,14 +75,16 @@ void pal_os_lock_release(pal_os_lock_t* p_lock)
73
75
}
74
76
77
78
+static volatile hal_atomic_t _atomic;
79
80
void pal_os_lock_enter_critical_section(void)
81
- // For safety critical systems it is recommended to implement a critical section entry
82
+ atomic_enter_critical(&_atomic);
83
84
85
void pal_os_lock_exit_critical_section(void)
86
- // For safety critical systems it is recommended to implement a critical section exit
87
+ atomic_leave_critical(&_atomic);
88
89
90
/**
0 commit comments