mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-22 03:09:16 +08:00
[Kernel] Add signal implementation.
1. Add signal implementation; 2. Change the 'rt_uint8_t' of cmd to 'int';
This commit is contained in:
+12
-2
@@ -108,13 +108,23 @@ void rt_tick_increase(void)
|
||||
* This function will calculate the tick from millisecond.
|
||||
*
|
||||
* @param ms the specified millisecond
|
||||
* - Negative Number wait forever
|
||||
* - Zero not wait
|
||||
* - Max 0x7fffffff
|
||||
*
|
||||
* @return the calculated tick
|
||||
*/
|
||||
rt_tick_t rt_tick_from_millisecond(rt_uint32_t ms)
|
||||
int rt_tick_from_millisecond(rt_int32_t ms)
|
||||
{
|
||||
int tick;
|
||||
|
||||
if (ms < 0)
|
||||
tick = RT_WAITING_FOREVER;
|
||||
else
|
||||
tick = (RT_TICK_PER_SECOND * ms + 999) / 1000;
|
||||
|
||||
/* return the calculated tick */
|
||||
return (RT_TICK_PER_SECOND * ms + 999) / 1000;
|
||||
return tick;
|
||||
}
|
||||
RTM_EXPORT(rt_tick_from_millisecond);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user