mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-28 16:20:26 +00:00
make osal_tick_get, osal_tick_tock static inline
This commit is contained in:
parent
0c397c6b8d
commit
594fc6771c
@ -49,19 +49,11 @@
|
|||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// INTERNAL OBJECT & FUNCTION DECLARATION
|
// INTERNAL OBJECT & FUNCTION DECLARATION
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
static volatile uint32_t osal_tick_current = 0;
|
volatile uint32_t osal_tick_current = 0;
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// IMPLEMENTATION
|
// IMPLEMENTATION
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
uint32_t osal_tick_get(void)
|
|
||||||
{
|
|
||||||
return osal_tick_current;
|
|
||||||
}
|
|
||||||
|
|
||||||
void osal_tick_tock(void)
|
|
||||||
{
|
|
||||||
osal_tick_current++;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -60,8 +60,18 @@
|
|||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// TICK API
|
// TICK API
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
void osal_tick_tock(void);
|
extern volatile uint32_t osal_tick_current;
|
||||||
uint32_t osal_tick_get(void);
|
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
|
// TASK API
|
||||||
|
Loading…
x
Reference in New Issue
Block a user