summaryrefslogtreecommitdiff
path: root/tinyusb
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-04-25 11:55:24 +0700
committerhathach <[email protected]>2013-04-25 11:55:24 +0700
commit92994c8192afa29ddb6d7fb109e20bf7872efcec (patch)
tree142046c8774be84d5482083a0cfb1f9b21a183ac /tinyusb
parente9dbce5f1bfe193884293e7fb555f963c7f2e649 (diff)
add attribute warn unused result for osal_create_* function
taskify keyboard_app mouse_app & led_blinking
Diffstat (limited to 'tinyusb')
-rw-r--r--tinyusb/host/usbh.c8
-rw-r--r--tinyusb/osal/osal_freeRTOS.h4
-rw-r--r--tinyusb/osal/osal_none.h6
3 files changed, 9 insertions, 9 deletions
diff --git a/tinyusb/host/usbh.c b/tinyusb/host/usbh.c
index 54f9e7dce..3c1630b75 100644
--- a/tinyusb/host/usbh.c
+++ b/tinyusb/host/usbh.c
@@ -89,8 +89,8 @@ static host_class_driver_t const usbh_class_drivers[TUSB_CLASS_MAX_CONSEC_NUMBER
usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1] TUSB_CFG_ATTR_USBRAM; // including zero-address
//------------- Enumeration Task Data -------------//
-OSAL_TASK_DEF(enum_task, usbh_enumeration_task, 128, TUSB_CFG_OS_TASK_PRIO);
-OSAL_QUEUE_DEF(enum_queue, ENUM_QUEUE_DEPTH, uint32_t);
+OSAL_TASK_DEF(enum_task_def, usbh_enumeration_task, 128, TUSB_CFG_OS_TASK_PRIO);
+OSAL_QUEUE_DEF(enum_queue_def, ENUM_QUEUE_DEPTH, uint32_t);
osal_queue_handle_t enum_queue_hdl;
STATIC_ uint8_t enum_data_buffer[TUSB_CFG_HOST_ENUM_BUFFER_SIZE] TUSB_CFG_ATTR_USBRAM;
@@ -126,8 +126,8 @@ tusb_error_t usbh_init(void)
}
//------------- Enumeration & Reporter Task init -------------//
- ASSERT_STATUS( osal_task_create(&enum_task) );
- enum_queue_hdl = osal_queue_create(&enum_queue);
+ ASSERT_STATUS( osal_task_create(&enum_task_def) );
+ enum_queue_hdl = osal_queue_create(&enum_queue_def);
ASSERT_PTR(enum_queue_hdl, TUSB_ERROR_OSAL_QUEUE_FAILED);
//------------- class init -------------//
diff --git a/tinyusb/osal/osal_freeRTOS.h b/tinyusb/osal/osal_freeRTOS.h
index cd92812cb..4dd3a67ca 100644
--- a/tinyusb/osal/osal_freeRTOS.h
+++ b/tinyusb/osal/osal_freeRTOS.h
@@ -87,9 +87,9 @@ typedef struct {
.code = task_code , \
.stack_depth = task_stack_depth , \
.prio = task_prio \
- };
+ }
-static inline tusb_error_t osal_task_create(osal_task_t *task) ATTR_ALWAYS_INLINE;
+static inline tusb_error_t osal_task_create(osal_task_t *task) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline tusb_error_t osal_task_create(osal_task_t *task)
{
return pdPASS == xTaskCreate(task->code, (signed portCHAR const *) task->name, task->stack_depth, NULL, task->prio, NULL) ?
diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h
index 66b2bd0ca..fa20585fd 100644
--- a/tinyusb/osal/osal_none.h
+++ b/tinyusb/osal/osal_none.h
@@ -96,7 +96,7 @@ static inline volatile uint32_t osal_tick_get(void)
state = 0
#define OSAL_TASK_LOOP_BEGIN \
- static uint32_t timeout = 0;\
+ ATTR_UNUSED static uint32_t timeout = 0;\
static uint16_t state = 0;\
switch(state) {\
case 0:\
@@ -153,7 +153,7 @@ typedef osal_semaphore_t * osal_semaphore_handle_t;
#define OSAL_SEM_REF(name)\
&name
-static inline osal_semaphore_handle_t osal_semaphore_create(osal_semaphore_t * const p_sem) ATTR_ALWAYS_INLINE;
+static inline osal_semaphore_handle_t osal_semaphore_create(osal_semaphore_t * const p_sem) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline osal_semaphore_handle_t osal_semaphore_create(osal_semaphore_t * const p_sem)
{
(*p_sem) = 0;
@@ -212,7 +212,7 @@ typedef osal_queue_t * osal_queue_handle_t;
.item_size = sizeof(type)\
}
-static inline osal_queue_handle_t osal_queue_create(osal_queue_t * const p_queue) ATTR_ALWAYS_INLINE;
+static inline osal_queue_handle_t osal_queue_create(osal_queue_t * const p_queue) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline osal_queue_handle_t osal_queue_create(osal_queue_t * const p_queue)
{
p_queue->count = p_queue->wr_idx = p_queue->rd_idx = 0;