From 18f97fef7e35937c017f2b2ad2300a920256f66b Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 12 Apr 2018 12:55:53 +0700 Subject: rename TUSB_OS_NONE, TUSB_OS_FREERTOS to OPT_OS_NONE, OPT_OS_FREERTOS --- tinyusb/common/tusb_fifo.h | 2 +- tinyusb/osal/osal.c | 2 +- tinyusb/osal/osal.h | 11 ++--------- tinyusb/tusb.c | 2 +- tinyusb/tusb.h | 4 ++-- tinyusb/tusb_option.h | 18 +++++++++++++----- 6 files changed, 20 insertions(+), 19 deletions(-) (limited to 'tinyusb') diff --git a/tinyusb/common/tusb_fifo.h b/tinyusb/common/tusb_fifo.h index 217781c9c..452b1f35f 100644 --- a/tinyusb/common/tusb_fifo.h +++ b/tinyusb/common/tusb_fifo.h @@ -57,7 +57,7 @@ #include "osal/osal.h" -#if CFG_TUSB_OS == TUSB_OS_NONE +#if CFG_TUSB_OS == OPT_OS_NONE // Since all fifo read/write is done in thread mode, there should be // no conflict except for osal queue which will be address seperatedly. // Therefore there may be no need for mutex with internal use of fifo diff --git a/tinyusb/osal/osal.c b/tinyusb/osal/osal.c index 6bf799d59..f2078b09c 100644 --- a/tinyusb/osal/osal.c +++ b/tinyusb/osal/osal.c @@ -43,7 +43,7 @@ //--------------------------------------------------------------------+ // TICK API //--------------------------------------------------------------------+ -#if CFG_TUSB_OS == TUSB_OS_FREERTOS +#if CFG_TUSB_OS == OPT_OS_FREERTOS uint32_t tusb_hal_millis(void) { diff --git a/tinyusb/osal/osal.h b/tinyusb/osal/osal.h index f87423d18..93d50699d 100644 --- a/tinyusb/osal/osal.h +++ b/tinyusb/osal/osal.h @@ -46,13 +46,6 @@ /** \addtogroup group_osal * @{ */ -/** \defgroup group_supported_os Supported RTOS - * \brief \ref CFG_TUSB_OS must be defined to one of these - * @{ */ -#define TUSB_OS_NONE 1 ///< No RTOS is used -#define TUSB_OS_FREERTOS 2 ///< FreeRTOS is used -/** @} */ - #include "tusb_option.h" #include "common/tusb_common.h" @@ -64,11 +57,11 @@ enum }; -#if CFG_TUSB_OS == TUSB_OS_NONE +#if CFG_TUSB_OS == OPT_OS_NONE #include "osal_none.h" #else - #if CFG_TUSB_OS == TUSB_OS_FREERTOS + #if CFG_TUSB_OS == OPT_OS_FREERTOS #include "osal_freeRTOS.h" #else #error CFG_TUSB_OS is not defined or OS is not supported yet diff --git a/tinyusb/tusb.c b/tinyusb/tusb.c index c9d71b1c1..b739ebe2e 100644 --- a/tinyusb/tusb.c +++ b/tinyusb/tusb.c @@ -56,7 +56,7 @@ tusb_error_t tusb_init(void) return TUSB_ERROR_NONE; } -#if CFG_TUSB_OS == TUSB_OS_NONE +#if CFG_TUSB_OS == OPT_OS_NONE void tusb_task(void) { #if MODE_HOST_SUPPORTED diff --git a/tinyusb/tusb.h b/tinyusb/tusb.h index 9a1fd0c4c..f469ca33e 100644 --- a/tinyusb/tusb.h +++ b/tinyusb/tusb.h @@ -102,9 +102,9 @@ */ tusb_error_t tusb_init(void); -#if CFG_TUSB_OS == TUSB_OS_NONE +#if CFG_TUSB_OS == OPT_OS_NONE /** \brief Run all tinyusb's internal tasks (e.g host task, device task). - * \note This function is only required when using no RTOS (\ref CFG_TUSB_OS == TUSB_OS_NONE). All the stack functions + * \note This function is only required when using no RTOS (\ref CFG_TUSB_OS == OPT_OS_NONE). All the stack functions * & callback are invoked within this function, so it should be called periodically within the mainloop * @code diff --git a/tinyusb/tusb_option.h b/tinyusb/tusb_option.h index 1c83abc50..b89b72782 100644 --- a/tinyusb/tusb_option.h +++ b/tinyusb/tusb_option.h @@ -36,8 +36,8 @@ */ /**************************************************************************/ -#ifndef _TUSB_TUSB_OPTION_H_ -#define _TUSB_TUSB_OPTION_H_ +#ifndef _TUSB_OPTION_H_ +#define _TUSB_OPTION_H_ #define TUSB_VERSION_YEAR 00 #define TUSB_VERSION_MONTH 00 @@ -58,6 +58,14 @@ #define MCU_LPC43XX 7 ///< NXP LPC43xx family /** @} */ +/** \defgroup group_supported_os Supported RTOS + * \brief \ref CFG_TUSB_OS must be defined to one of these + * @{ */ +#define OPT_OS_NONE 1 ///< No RTOS is used +#define OPT_OS_FREERTOS 2 ///< FreeRTOS is used +/** @} */ + + // Allow to use command line to change the config name/location #ifndef CFG_TUSB_CONFIG_FILE #define CFG_TUSB_CONFIG_FILE "tusb_config.h" @@ -122,10 +130,10 @@ #endif #ifndef CFG_TUSB_OS -#define CFG_TUSB_OS TUSB_OS_NONE +#define CFG_TUSB_OS OPT_OS_NONE #endif -#if (CFG_TUSB_OS != TUSB_OS_NONE) && !defined (CFG_TUSB_OS_TASK_PRIO) +#if (CFG_TUSB_OS != OPT_OS_NONE) && !defined (CFG_TUSB_OS_TASK_PRIO) #error CFG_TUSB_OS_TASK_PRIO need to be defined (hint: use the highest if possible) #endif @@ -192,6 +200,6 @@ //------------- CLASS -------------// #endif // MODE_HOST_SUPPORTED -#endif /* _TUSB_TUSB_OPTION_H_ */ +#endif /* _TUSB_OPTION_H_ */ /** @} */ -- cgit v1.3.1