summaryrefslogtreecommitdiff
path: root/wpan/stm32_hsem.h
diff options
context:
space:
mode:
Diffstat (limited to 'wpan/stm32_hsem.h')
-rw-r--r--wpan/stm32_hsem.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/wpan/stm32_hsem.h b/wpan/stm32_hsem.h
index f8d9dd3..7cac70c 100644
--- a/wpan/stm32_hsem.h
+++ b/wpan/stm32_hsem.h
@@ -23,4 +23,12 @@ template <typename T>
class STM32_HSEM_t : public mmio_ptr<T> {
public:
using mmio_ptr<T>::ptr;
+
+ bool get_lock_1step(uint32_t sem) const {
+ return ptr()->RLR[sem] == (uint32_t)((1<<31) | (4<<8)); // cpu1 coreid
+ }
+
+ void release(uint32_t sem, uint32_t process) const {
+ ptr()->R[sem] = (4<<8) | process; // cpu1 coreid
+ }
}; \ No newline at end of file