[kernel]auto formatted

This commit is contained in:
Meco Man 2021-03-08 11:25:38 +08:00
parent ce86058201
commit 678306d300
17 changed files with 43 additions and 43 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@ -111,7 +111,7 @@ rt_tick_t rt_tick_from_millisecond(rt_int32_t ms)
tick = RT_TICK_PER_SECOND * (ms / 1000);
tick += (RT_TICK_PER_SECOND * (ms % 1000) + 999) / 1000;
}
/* return the calculated tick */
return tick;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@ -211,7 +211,7 @@ static void rt_thread_idle_entry(void *parameter)
#endif
rt_thread_idle_excute();
#ifdef RT_USING_PM
#ifdef RT_USING_PM
rt_system_power_manager();
#endif
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@ -34,7 +34,7 @@
* 2013-09-14 Grissiom add an option check in rt_event_recv
* 2018-10-02 Bernard add 64bit support for mailbox
* 2019-09-16 tyx add send wait support for message queue
* 2020-07-29 Meco Man fix thread->event_set/event_info when received an
* 2020-07-29 Meco Man fix thread->event_set/event_info when received an
* event without pending
* 2020-10-11 Meco Man add value overflow-check code
* 2021-01-03 Meco Man add rt_mb_urgent()
@ -124,7 +124,7 @@ rt_inline rt_err_t rt_ipc_list_suspend(rt_list_t *list,
break;
default:
break;
break;
}
return RT_EOK;
@ -959,7 +959,7 @@ rt_err_t rt_mutex_release(rt_mutex_t mutex)
rt_hw_interrupt_enable(temp); /* enable interrupt */
return -RT_EFULL; /* value overflowed */
}
/* clear owner */
mutex->owner = RT_NULL;
mutex->original_priority = 0xff;
@ -1280,11 +1280,11 @@ rt_err_t rt_event_recv(rt_event_t event,
/* set received event */
if (recved)
*recved = (event->set & set);
/* fill thread event info */
/* fill thread event info */
thread->event_set = (event->set & set);
thread->event_info = option;
/* received event */
if (option & RT_EVENT_FLAG_CLEAR)
event->set &= ~set;
@ -1649,7 +1649,7 @@ rt_err_t rt_mb_send_wait(rt_mailbox_t mb,
++ mb->in_offset;
if (mb->in_offset >= mb->size)
mb->in_offset = 0;
if(mb->entry < RT_MB_ENTRY_MAX)
{
/* increase message entry */
@ -1660,7 +1660,7 @@ rt_err_t rt_mb_send_wait(rt_mailbox_t mb,
rt_hw_interrupt_enable(temp); /* enable interrupt */
return -RT_EFULL; /* value overflowed */
}
/* resume suspended thread */
if (!rt_list_isempty(&mb->parent.suspend_thread))
{
@ -2409,7 +2409,7 @@ rt_err_t rt_mq_urgent(rt_mq_t mq, const void *buffer, rt_size_t size)
rt_hw_interrupt_enable(temp); /* enable interrupt */
return -RT_EFULL; /* value overflowed */
}
/* resume suspended thread */
if (!rt_list_isempty(&mq->parent.suspend_thread))
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@ -21,7 +21,7 @@ static void (*rt_interrupt_leave_hook)(void);
/**
* @ingroup Hook
* This function set a hook function when the system enter a interrupt
* This function set a hook function when the system enter a interrupt
*
* @note the hook function must be simple and never be blocked or suspend.
*/
@ -31,7 +31,7 @@ void rt_interrupt_enter_sethook(void (*hook)(void))
}
/**
* @ingroup Hook
* This function set a hook function when the system exit a interrupt.
* This function set a hook function when the system exit a interrupt.
*
* @note the hook function must be simple and never be blocked or suspend.
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@ -456,7 +456,7 @@ RTM_EXPORT(rt_strncmp);
rt_int32_t rt_strcmp(const char *cs, const char *ct)
{
while (*cs && *cs == *ct)
{
{
cs++;
ct++;
}
@ -1127,10 +1127,10 @@ rt_device_t rt_console_set_device(const char *name)
/* find new console device */
new_device = rt_device_find(name);
/* check whether it's a same device */
if (new_device == old_device) return RT_NULL;
if (new_device != RT_NULL)
{
if (_console_device != RT_NULL)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@ -489,7 +489,7 @@ void *rt_realloc(void *rmem, rt_size_t newsize)
{
((struct heap_mem *)&heap_ptr[mem2->next])->prev = ptr2;
}
if (mem2 < lfree)
{
/* the splited struct is now the lowest */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -130,7 +130,7 @@ rt_err_t rt_memheap_detach(struct rt_memheap *heap)
RT_ASSERT(heap);
RT_ASSERT(rt_object_get_type(&heap->parent) == RT_Object_Class_MemHeap);
RT_ASSERT(rt_object_is_systemobject(&heap->parent));
rt_sem_detach(&heap->lock);
rt_object_detach(&(heap->parent));
@ -765,7 +765,7 @@ void dump_used_memheap(struct rt_memheap *mh)
rt_kprintf("\nmemory heap address:\n");
rt_kprintf("heap_ptr: 0x%08x\n", mh->start_addr);
rt_kprintf("free : 0x%08x\n", mh->available_size);
rt_kprintf("free : 0x%08x\n", mh->available_size);
rt_kprintf("max_used: 0x%08x\n", mh->max_used_size);
rt_kprintf("size : 0x%08x\n", mh->pool_size);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@ -200,7 +200,7 @@ void rt_object_put_sethook(void (*hook)(struct rt_object *object))
/**
* This function will return the specified type of object information.
*
* @param type the type of object, which can be
* @param type the type of object, which can be
* RT_Object_Class_Thread/Semaphore/Mutex... etc
*
* @return the object type information or RT_NULL
@ -220,7 +220,7 @@ RTM_EXPORT(rt_object_get_information);
/**
* This function will return the length of object list in object container.
*
* @param type the type of object, which can be
* @param type the type of object, which can be
* RT_Object_Class_Thread/Semaphore/Mutex... etc
* @return the length of object list
*/
@ -247,10 +247,10 @@ int rt_object_get_length(enum rt_object_class_type type)
RTM_EXPORT(rt_object_get_length);
/**
* This function will copy the object pointer of the specified type,
* This function will copy the object pointer of the specified type,
* with the maximum size specified by maxlen.
*
* @param type the type of object, which can be
* @param type the type of object, which can be
* RT_Object_Class_Thread/Semaphore/Mutex... etc
* @param pointers the pointers will be saved to
* @param maxlen the maximum number of pointers can be saved

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@ -270,10 +270,10 @@ void rt_system_scheduler_start(void)
#ifdef RT_USING_SMP
/**
* This function will handle IPI interrupt and do a scheduling in system;
*
*
* @param vector, the number of IPI interrupt for system scheduling
* @param param, use RT_NULL
*
*
* NOTE: this function should be invoke or register as ISR in BSP.
*/
void rt_scheduler_ipi_handler(int vector, void *param)
@ -283,7 +283,7 @@ void rt_scheduler_ipi_handler(int vector, void *param)
/**
* This function will perform one scheduling. It will select one thread
* with the highest priority level in global ready queue or local ready queue,
* with the highest priority level in global ready queue or local ready queue,
* then switch to it.
*/
void rt_schedule(void)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*