add osal subtask support

add usbh_control_xfer_subtask as xfer and wait
fix potential error when update device info & open control pipe for new address
fix build error with hal_****.c
add STATIC_ASSSERT to perform compile time checking with sizeof later
update osal_queue_receive and osal_semaphore_wait for osal_none to support subtask
This commit is contained in:
hathach
2013-02-26 17:28:05 +07:00
parent ac744b0401
commit 49da210860
17 changed files with 184 additions and 69 deletions
+2 -1
View File
@@ -43,6 +43,7 @@
#include "mock_hcd.h"
#include "mock_usbh_hcd.h"
#include "mock_tusb_callback.h"
#include "mock_hid_host.h"
extern usbh_device_info_t usbh_device_info_pool[TUSB_CFG_HOST_DEVICE_MAX+1];
extern uint8_t enum_data_buffer[TUSB_CFG_HOST_ENUM_BUFFER_SIZE];
@@ -220,7 +221,7 @@ void test_enum_parse_config_desc(void)
hcd_pipe_control_open_ExpectAndReturn(1, desc_device.bMaxPacketSize0, TUSB_ERROR_NONE);
tusbh_device_attached_cb_ExpectAndReturn((tusb_descriptor_device_t*) enum_data_buffer, 1);
// hid_install
hidh_install_ExpectAndReturn(1, &desc_configuration.keyboard_interface, TUSB_ERROR_NONE);
usbh_enumeration_task();
}
+1
View File
@@ -42,6 +42,7 @@
#include "mock_hcd.h"
#include "mock_usbh_hcd.h"
#include "mock_tusb_callback.h"
#include "mock_hid_host.h"
extern usbh_device_info_t usbh_device_info_pool[TUSB_CFG_HOST_DEVICE_MAX+1];
tusb_handle_device_t dev_hdl;
-1
View File
@@ -61,7 +61,6 @@
uint8_t tusbh_device_attached_cb (tusb_descriptor_device_t const *p_desc_device) ATTR_WEAK ATTR_WARN_UNUSED_RESULT;
void tusbh_device_mounted_cb (tusb_handle_device_t device_hdl) ATTR_WEAK;
void tusbh_device_mount_failed_cb(tusb_error_t error, tusb_descriptor_device_t const *p_desc_device) ATTR_WEAK;
void hidh_init(void);
#ifdef __cplusplus
}
+1 -1
View File
@@ -254,7 +254,7 @@ void sample_task_flow_control(void)
statements[2]++;
osal_semaphore_wait(sem_hdl, OSAL_TIMEOUT_NORMAL, &error);
TASK_ASSERT_STATUS_HANDLER(error, flow_control_error_handler());
TASK_ASSERT_STATUS_WITH_HANDLER(error, flow_control_error_handler());
statements[3]++;
OSAL_TASK_LOOP_END