mirror of https://github.com/ARMmbed/mbed-os.git
CMSIS/RTX: Allow overwriting mutex ops for ARMC
parent
80f2475a89
commit
08ab8cc47d
|
@ -728,11 +728,12 @@ typedef void *mutex;
|
||||||
//lint -e818 "Pointer 'm' could be declared as pointing to const"
|
//lint -e818 "Pointer 'm' could be declared as pointing to const"
|
||||||
|
|
||||||
// Initialize mutex
|
// Initialize mutex
|
||||||
|
#if !defined(__ARMCC_VERSION) || __ARMCC_VERSION < 6010050
|
||||||
__USED
|
__USED
|
||||||
|
#endif
|
||||||
int _mutex_initialize(mutex *m);
|
int _mutex_initialize(mutex *m);
|
||||||
int _mutex_initialize(mutex *m) {
|
__WEAK int _mutex_initialize(mutex *m) {
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
*m = osMutexNew(NULL);
|
*m = osMutexNew(NULL);
|
||||||
if (*m != NULL) {
|
if (*m != NULL) {
|
||||||
result = 1;
|
result = 1;
|
||||||
|
@ -744,8 +745,10 @@ int _mutex_initialize(mutex *m) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Acquire mutex
|
// Acquire mutex
|
||||||
|
#if !defined(__ARMCC_VERSION) || __ARMCC_VERSION < 6010050
|
||||||
__USED
|
__USED
|
||||||
void _mutex_acquire(mutex *m);
|
#endif
|
||||||
|
__WEAK void _mutex_acquire(mutex *m);
|
||||||
void _mutex_acquire(mutex *m) {
|
void _mutex_acquire(mutex *m) {
|
||||||
if (os_kernel_is_active() != 0U) {
|
if (os_kernel_is_active() != 0U) {
|
||||||
(void)osMutexAcquire(*m, osWaitForever);
|
(void)osMutexAcquire(*m, osWaitForever);
|
||||||
|
@ -753,8 +756,10 @@ void _mutex_acquire(mutex *m) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Release mutex
|
// Release mutex
|
||||||
|
#if !defined(__ARMCC_VERSION) || __ARMCC_VERSION < 6010050
|
||||||
__USED
|
__USED
|
||||||
void _mutex_release(mutex *m);
|
#endif
|
||||||
|
__WEAK void _mutex_release(mutex *m);
|
||||||
void _mutex_release(mutex *m) {
|
void _mutex_release(mutex *m) {
|
||||||
if (os_kernel_is_active() != 0U) {
|
if (os_kernel_is_active() != 0U) {
|
||||||
(void)osMutexRelease(*m);
|
(void)osMutexRelease(*m);
|
||||||
|
@ -762,8 +767,10 @@ void _mutex_release(mutex *m) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free mutex
|
// Free mutex
|
||||||
|
#if !defined(__ARMCC_VERSION) || __ARMCC_VERSION < 6010050
|
||||||
__USED
|
__USED
|
||||||
void _mutex_free(mutex *m);
|
#endif
|
||||||
|
__WEAK void _mutex_free(mutex *m);
|
||||||
void _mutex_free(mutex *m) {
|
void _mutex_free(mutex *m) {
|
||||||
(void)osMutexDelete(*m);
|
(void)osMutexDelete(*m);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue