rtos: fix coding style in the boot files

pull/8591/head
Martin Kojtal 2018-10-31 12:16:56 +00:00
parent 9238bf223f
commit 87265f7744
4 changed files with 34 additions and 28 deletions

View File

@ -113,7 +113,8 @@ static osThreadId_t os_libspace_id[OS_THREAD_LIBSPACE_NUM] \
__attribute__((section(".bss.os.libspace")));
// Check if Kernel has been started
static uint32_t os_kernel_is_active (void) {
static uint32_t os_kernel_is_active(void)
{
static uint8_t os_kernel_active = 0U;
if (os_kernel_active == 0U) {
@ -125,7 +126,8 @@ static uint32_t os_kernel_is_active (void) {
}
// Provide libspace for current thread
void *__user_perthread_libspace (void) {
void *__user_perthread_libspace(void)
{
osThreadId_t id;
uint32_t n;
@ -218,21 +220,24 @@ __USED int _mutex_initialize(mutex *m)
}
/* Acquire mutex */
__USED void _mutex_acquire(mutex *m) {
__USED void _mutex_acquire(mutex *m)
{
if (os_kernel_is_active() != 0U) {
(void)osMutexAcquire(*m, osWaitForever);
}
}
/* Release mutex */
__USED void _mutex_release(mutex *m) {
__USED void _mutex_release(mutex *m)
{
if (os_kernel_is_active() != 0U) {
(void)osMutexRelease(*m);
}
}
/* Free mutex */
__USED void _mutex_free(mutex *m) {
__USED void _mutex_free(mutex *m)
{
mutex *slot = NULL;
core_util_critical_section_enter();
for (int i = 0; i < OS_MUTEX_STATIC_NUM; i++) {

View File

@ -86,7 +86,8 @@ void mbed_toolchain_init()
}
extern int __real_main(void);
int __wrap_main(void) {
int __wrap_main(void)
{
/* For backwards compatibility */
return __real_main();
}