diff options
| author | hathach <[email protected]> | 2013-02-01 12:00:34 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-02-01 12:25:02 +0700 |
| commit | aab92b40d2e904e8ad85386e4a4f3b59e84eb844 (patch) | |
| tree | f8099f4075a1e7612b6522d1c8902d56aa13b3f7 /tinyusb/osal/osal_none.c | |
| parent | 9e3785e7e1bd5bac3c8e24477edbde12cc09dd4b (diff) | |
change osal_timeout_t to uint32_t
implement osal_tick_get & osal_tick_tock for osal_none
implement timeout for osal_semaphore_wait
Diffstat (limited to 'tinyusb/osal/osal_none.c')
| -rw-r--r-- | tinyusb/osal/osal_none.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tinyusb/osal/osal_none.c b/tinyusb/osal/osal_none.c index d32b00225..4a66f0dc3 100644 --- a/tinyusb/osal/osal_none.c +++ b/tinyusb/osal/osal_none.c @@ -35,10 +35,33 @@ * This file is part of the tiny usb stack. */ -#include "osal_none.h" +#include "tusb_option.h" #if TUSB_CFG_OS == TUSB_OS_NONE +#define _TINY_USB_SOURCE_FILE_ + +//--------------------------------------------------------------------+ +// INCLUDE +//--------------------------------------------------------------------+ +#include "osal_none.h" + +//--------------------------------------------------------------------+ +// INTERNAL OBJECT & FUNCTION DECLARATION +//--------------------------------------------------------------------+ +static volatile uint32_t osal_tick_current = 0; + +//--------------------------------------------------------------------+ +// IMPLEMENTATION +//--------------------------------------------------------------------+ +volatile uint32_t osal_tick_get(void) +{ + return osal_tick_current; +} +void osal_tick_tock(void) +{ + osal_tick_current++; +} #endif |
