~ruther/qmk_firmware

ref: 837cae95ba8ae9b7d92d4e96ce91dfdf0a5f6374 qmk_firmware/platforms/chibios/synchronization_util.c -rw-r--r-- 727 bytes
837cae95 — ID64F boardsource/unicorne - Fixed OLED layers being all set to zero (#22389) 1 year, 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2022 Stefan Kerkmann
// SPDX-License-Identifier: GPL-2.0-or-later

#include "synchronization_util.h"
#include "ch.h"

#if defined(SPLIT_KEYBOARD)
static MUTEX_DECL(SPLIT_SHARED_MEMORY_MUTEX);

/**
 * @brief Acquire exclusive access to the split keyboard shared memory, by
 * locking the mutex guarding it. If the mutex is already held, the calling
 * thread will be suspended until the mutex currently owning thread releases the
 * mutex again.
 */
void split_shared_memory_lock(void) {
    chMtxLock(&SPLIT_SHARED_MEMORY_MUTEX);
}

/**
 * @brief Release the split shared memory mutex that has been acquired before.
 */
void split_shared_memory_unlock(void) {
    chMtxUnlock(&SPLIT_SHARED_MEMORY_MUTEX);
}
#endif
Do not follow this link