add RT_PRINTF_PRECISION in kservice.c; fix re-schedule issue in IPC control function.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2003 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong@gmail.com 2012-03-22 05:57:54 +00:00
parent 3b805a8137
commit b6c1ebf423
2 changed files with 14 additions and 4 deletions

View File

@ -469,6 +469,8 @@ rt_err_t rt_sem_control(rt_sem_t sem, rt_uint8_t cmd, void *arg)
/* enable interrupt */ /* enable interrupt */
rt_hw_interrupt_enable(level); rt_hw_interrupt_enable(level);
rt_schedule();
return RT_EOK; return RT_EOK;
} }
@ -1153,6 +1155,8 @@ rt_err_t rt_event_control(rt_event_t event, rt_uint8_t cmd, void *arg)
/* enable interrupt */ /* enable interrupt */
rt_hw_interrupt_enable(level); rt_hw_interrupt_enable(level);
rt_schedule();
return RT_EOK; return RT_EOK;
} }
@ -1597,7 +1601,6 @@ rt_err_t rt_mb_control(rt_mailbox_t mb, rt_uint8_t cmd, void *arg)
/* resume all waiting thread */ /* resume all waiting thread */
rt_ipc_list_resume_all(&(mb->parent.suspend_thread)); rt_ipc_list_resume_all(&(mb->parent.suspend_thread));
/* also resume all mailbox private suspended thread */ /* also resume all mailbox private suspended thread */
rt_ipc_list_resume_all(&(mb->suspend_sender_thread)); rt_ipc_list_resume_all(&(mb->suspend_sender_thread));
@ -1609,6 +1612,8 @@ rt_err_t rt_mb_control(rt_mailbox_t mb, rt_uint8_t cmd, void *arg)
/* enable interrupt */ /* enable interrupt */
rt_hw_interrupt_enable(level); rt_hw_interrupt_enable(level);
rt_schedule();
return RT_EOK; return RT_EOK;
} }
@ -2144,6 +2149,8 @@ rt_err_t rt_mq_control(rt_mq_t mq, rt_uint8_t cmd, void *arg)
/* enable interrupt */ /* enable interrupt */
rt_hw_interrupt_enable(level); rt_hw_interrupt_enable(level);
rt_schedule();
return RT_EOK; return RT_EOK;
} }

View File

@ -20,6 +20,9 @@
#include <rtthread.h> #include <rtthread.h>
#include <rthw.h> #include <rthw.h>
/* use precision */
#define RT_PRINTF_PRECISION
/** /**
* @addtogroup KernelService * @addtogroup KernelService
*/ */
@ -754,11 +757,11 @@ static rt_int32_t vsnprintf(char *buf, rt_size_t size, const char *fmt, va_list
#endif #endif
/* get the conversion qualifier */ /* get the conversion qualifier */
qualifier = 0; qualifier = 0;
if (*fmt == 'h' || *fmt == 'l'
#ifdef RT_PRINTF_LONGLONG #ifdef RT_PRINTF_LONGLONG
|| *fmt == 'L' if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L')
#else
if (*fmt == 'h' || *fmt == 'l')
#endif #endif
)
{ {
qualifier = *fmt; qualifier = *fmt;
++ fmt; ++ fmt;