diff options
| author | Bernard Xiong <[email protected]> | 2019-05-20 20:33:07 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-05-20 20:33:07 +0800 |
| commit | b2ae7d72f923e1638f72d8eba5c2131389b741b0 (patch) | |
| tree | ab526e2e216f5f656b9c6a53221382d07c7bac2e /include | |
| parent | d778c9df25cbbd8e202a0133453e4c8b8e179eff (diff) | |
| parent | 35eff9a85dd1e922f98d36deed84bdfb3c8319f7 (diff) | |
Merge pull request #2703 from armink/lts-v3.1.x
Lts v3.1.x
Diffstat (limited to 'include')
| -rw-r--r-- | include/libc/libc_errno.h | 2 | ||||
| -rw-r--r-- | include/rtdbg.h | 20 | ||||
| -rw-r--r-- | include/rtdef.h | 5 | ||||
| -rw-r--r-- | include/rthw.h | 6 | ||||
| -rw-r--r-- | include/rtthread.h | 8 |
5 files changed, 32 insertions, 9 deletions
diff --git a/include/libc/libc_errno.h b/include/libc/libc_errno.h index bb9a4dea2a..0f3bc7635a 100644 --- a/include/libc/libc_errno.h +++ b/include/libc/libc_errno.h @@ -13,7 +13,7 @@ #include <rtconfig.h> -#if defined(RT_USING_NEWLIB) || defined(_WIN32) || defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__) +#if defined(RT_USING_NEWLIB) || defined(_WIN32) /* use errno.h file in toolchains */ #include <errno.h> #endif diff --git a/include/rtdbg.h b/include/rtdbg.h index 77382c656b..a2dfbd9697 100644 --- a/include/rtdbg.h +++ b/include/rtdbg.h @@ -18,9 +18,9 @@ * In your C/C++ file, enable/disable DEBUG_ENABLE macro, and then include this * header file. * - * #define DBG_SECTION_NAME "MOD" - * #define DBG_LEVEL DBG_INFO - * #include <rtdbg.h> // must after of DBG_LEVEL, DBG_SECTION_NAME or other options + * #define DBG_TAG "MOD_TAG" + * #define DBG_LVL DBG_INFO + * #include <rtdbg.h> // must after of DBG_LVL, DBG_TAG or other options * * Then in your C/C++ file, you can use LOG_X macro to print out logs: * LOG_D("this is a debug log!"); @@ -53,15 +53,29 @@ #define DBG_INFO 2 #define DBG_LOG 3 +#ifdef DBG_TAG +#ifndef DBG_SECTION_NAME +#define DBG_SECTION_NAME DBG_TAG +#endif +#else +/* compatible with old version */ #ifndef DBG_SECTION_NAME #define DBG_SECTION_NAME "DBG" #endif +#endif /* DBG_TAG */ #ifdef DBG_ENABLE +#ifdef DBG_LVL +#ifndef DBG_LEVEL +#define DBG_LEVEL DBG_LVL +#endif +#else +/* compatible with old version */ #ifndef DBG_LEVEL #define DBG_LEVEL DBG_WARNING #endif +#endif /* DBG_LVL */ /* * The color for terminal (foreground) diff --git a/include/rtdef.h b/include/rtdef.h index 6346a77c6d..f928ffb407 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -359,7 +359,8 @@ typedef struct rt_object *rt_object_t; /**< Type for kernel obj */ enum rt_object_class_type { - RT_Object_Class_Thread = 0, /**< The object is a thread. */ + RT_Object_Class_Null = 0, /**< The object is not used. */ + RT_Object_Class_Thread, /**< The object is a thread. */ RT_Object_Class_Semaphore, /**< The object is a semaphore. */ RT_Object_Class_Mutex, /**< The object is a mutex. */ RT_Object_Class_Event, /**< The object is a event. */ @@ -601,6 +602,7 @@ struct rt_semaphore struct rt_ipc_object parent; /**< inherit from ipc_object */ rt_uint16_t value; /**< value of semaphore. */ + rt_uint16_t reserved; /**< reserved field */ }; typedef struct rt_semaphore *rt_sem_t; #endif @@ -965,6 +967,7 @@ enum RTGRAPHIC_PIXEL_FORMAT_ABGR888, RTGRAPHIC_PIXEL_FORMAT_ARGB565, RTGRAPHIC_PIXEL_FORMAT_ALPHA, + RTGRAPHIC_PIXEL_FORMAT_COLOR, }; /** diff --git a/include/rthw.h b/include/rthw.h index f4ede56924..3e74df0f22 100644 --- a/include/rthw.h +++ b/include/rthw.h @@ -117,6 +117,12 @@ void rt_hw_exception_install(rt_err_t (*exception_handle)(void *context)); */ void rt_hw_us_delay(rt_uint32_t us); +#define RT_DEFINE_SPINLOCK(x) +#define RT_DECLARE_SPINLOCK(x) rt_ubase_t x + +#define rt_hw_spin_lock(lock) *(lock) = rt_hw_interrupt_disable() +#define rt_hw_spin_unlock(lock) rt_hw_interrupt_enable(*(lock)) + #ifdef __cplusplus } #endif diff --git a/include/rtthread.h b/include/rtthread.h index 5d3fd3def6..bfe41a3e32 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -74,7 +74,7 @@ void rt_system_tick_init(void); rt_tick_t rt_tick_get(void); void rt_tick_set(rt_tick_t tick); void rt_tick_increase(void); -int rt_tick_from_millisecond(rt_int32_t ms); +rt_tick_t rt_tick_from_millisecond(rt_int32_t ms); void rt_system_timer_init(void); void rt_system_timer_thread_init(void); @@ -257,7 +257,7 @@ void rt_page_free(void *addr, rt_size_t npages); #endif #ifdef RT_USING_HOOK -void rt_malloc_sethook(void (*hook)(void *ptr, rt_uint32_t size)); +void rt_malloc_sethook(void (*hook)(void *ptr, rt_size_t size)); void rt_free_sethook(void (*hook)(void *ptr)); #endif @@ -270,9 +270,9 @@ void rt_free_sethook(void (*hook)(void *ptr)); rt_err_t rt_memheap_init(struct rt_memheap *memheap, const char *name, void *start_addr, - rt_uint32_t size); + rt_size_t size); rt_err_t rt_memheap_detach(struct rt_memheap *heap); -void *rt_memheap_alloc(struct rt_memheap *heap, rt_uint32_t size); +void *rt_memheap_alloc(struct rt_memheap *heap, rt_size_t size); void *rt_memheap_realloc(struct rt_memheap *heap, void *ptr, rt_size_t newsize); void rt_memheap_free(void *ptr); #endif |
