Skip to content

Commit 08ab8cc

Browse files
bulislaw0xc0170
authored andcommitted
CMSIS/RTX: Allow overwriting mutex ops for ARMC
1 parent 80f2475 commit 08ab8cc

File tree

1 file changed

+12
-5
lines changed
  • rtos/source/TARGET_CORTEX/rtx5/RTX/Source

1 file changed

+12
-5
lines changed

rtos/source/TARGET_CORTEX/rtx5/RTX/Source/rtx_lib.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -728,11 +728,12 @@ typedef void *mutex;
728728
//lint -e818 "Pointer 'm' could be declared as pointing to const"
729729

730730
// Initialize mutex
731+
#if !defined(__ARMCC_VERSION) || __ARMCC_VERSION < 6010050
731732
__USED
733+
#endif
732734
int _mutex_initialize(mutex *m);
733-
int _mutex_initialize(mutex *m) {
735+
__WEAK int _mutex_initialize(mutex *m) {
734736
int result;
735-
736737
*m = osMutexNew(NULL);
737738
if (*m != NULL) {
738739
result = 1;
@@ -744,26 +745,32 @@ int _mutex_initialize(mutex *m) {
744745
}
745746

746747
// Acquire mutex
748+
#if !defined(__ARMCC_VERSION) || __ARMCC_VERSION < 6010050
747749
__USED
748-
void _mutex_acquire(mutex *m);
750+
#endif
751+
__WEAK void _mutex_acquire(mutex *m);
749752
void _mutex_acquire(mutex *m) {
750753
if (os_kernel_is_active() != 0U) {
751754
(void)osMutexAcquire(*m, osWaitForever);
752755
}
753756
}
754757

755758
// Release mutex
759+
#if !defined(__ARMCC_VERSION) || __ARMCC_VERSION < 6010050
756760
__USED
757-
void _mutex_release(mutex *m);
761+
#endif
762+
__WEAK void _mutex_release(mutex *m);
758763
void _mutex_release(mutex *m) {
759764
if (os_kernel_is_active() != 0U) {
760765
(void)osMutexRelease(*m);
761766
}
762767
}
763768

764769
// Free mutex
770+
#if !defined(__ARMCC_VERSION) || __ARMCC_VERSION < 6010050
765771
__USED
766-
void _mutex_free(mutex *m);
772+
#endif
773+
__WEAK void _mutex_free(mutex *m);
767774
void _mutex_free(mutex *m) {
768775
(void)osMutexDelete(*m);
769776
}

0 commit comments

Comments
 (0)