From 594fc6771c4106b84c4bbaa03a8f3b81c5d82b0a Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 27 Feb 2013 20:13:49 +0700 Subject: [PATCH] make osal_tick_get, osal_tick_tock static inline --- tinyusb/osal/osal_none.c | 10 +--------- tinyusb/osal/osal_none.h | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/tinyusb/osal/osal_none.c b/tinyusb/osal/osal_none.c index b30f7ecda..4c8eb7aca 100644 --- a/tinyusb/osal/osal_none.c +++ b/tinyusb/osal/osal_none.c @@ -49,19 +49,11 @@ //--------------------------------------------------------------------+ // INTERNAL OBJECT & FUNCTION DECLARATION //--------------------------------------------------------------------+ -static volatile uint32_t osal_tick_current = 0; +volatile uint32_t osal_tick_current = 0; //--------------------------------------------------------------------+ // IMPLEMENTATION //--------------------------------------------------------------------+ -uint32_t osal_tick_get(void) -{ - return osal_tick_current; -} -void osal_tick_tock(void) -{ - osal_tick_current++; -} #endif diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index 7d59d5257..da42a969a 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -60,8 +60,18 @@ //--------------------------------------------------------------------+ // TICK API //--------------------------------------------------------------------+ -void osal_tick_tock(void); -uint32_t osal_tick_get(void); +extern volatile uint32_t osal_tick_current; +static inline void osal_tick_tock(void) ATTR_ALWAYS_INLINE; +static inline void osal_tick_tock(void) +{ + osal_tick_current++; +} + +static inline uint32_t osal_tick_get(void) ATTR_ALWAYS_INLINE; +static inline uint32_t osal_tick_get(void) +{ + return osal_tick_current; +} //--------------------------------------------------------------------+ // TASK API