Skip to content

Commit

Permalink
Upload btstack-integration 4.1.0.1543
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlab-runner committed Sep 3, 2022
1 parent 2e7bfe7 commit 26a58c1
Show file tree
Hide file tree
Showing 47 changed files with 2,909 additions and 29,854 deletions.
Binary file modified COMPONENT_BLESS-IPC/docs/BLESS-docs.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion COMPONENT_BLESS-IPC/platform/common/cybt_debug_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static void cybt_debug_rx_task(void *arg)
head += expectedlength;
break;
}
if(data_counter==0 && (process_rx_cmd != NULL))
if(data_counter==0 && (head != 0) && (process_rx_cmd != NULL))
{
phase = HEADER_PHASE;
process_rx_cmd(wiced_rx_cmd+1, head-1);
Expand Down
26 changes: 26 additions & 0 deletions COMPONENT_BLESS-IPC/platform/include/cybt_platform_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,32 @@
#endif //ENABLE_BT_SPY_LOG


/** Define start of the function placed to the SRAM area by the linker */
#if defined(__ARMCC_VERSION)
/** To create cross compiler compatible code, use the CY_NOINIT, CY_SECTION, CY_UNUSED, CY_ALIGN
* attributes at the first place of declaration/definition.
* For example: CY_NOINIT uint32_t noinitVar;
*/
#define BTSTACK_PORTING_SECTION_BEGIN __attribute__((section(".text.cy_btstack_porting")))
#define BTSTACK_PORTING_SECTION_END

#elif defined(__ICCARM__)
#define BTSTACK_PORTING_SECTION_BEGIN _Pragma("default_function_attributes = @\".text.cy_btstack_porting\"")
#define BTSTACK_PORTING_SECTION_END _Pragma("default_function_attributes = ")
#elif defined(__GNUC__)
#if defined(__clang__)
#define BTSTACK_PORTING_SECTION_BEGIN __attribute__((section("__DATA, .text.cy_btstack_porting")))
#define BTSTACK_PORTING_SECTION_END
#else
#define BTSTACK_PORTING_SECTION_BEGIN __attribute__((section(".text.cy_btstack_porting")))
#define BTSTACK_PORTING_SECTION_END
#endif
#else // if defined(__ARMCC_VERSION)
#define BTSTACK_PORTING_SECTION_BEGIN
#define BTSTACK_PORTING_SECTION_END
#endif // (__ARMCC_VERSION)


#ifdef __cplusplus
extern "C"
{
Expand Down
4 changes: 4 additions & 0 deletions COMPONENT_BLESS-IPC/platform/ipc/cybt_bt_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ static void handle_hci_rx_packet(void *event)
case HCI_PACKET_TYPE_SCO:
//NA
break;
case HCI_PACKET_TYPE_ISO:
wiced_bt_process_isoc_data(&packet_buffer[0], length);
break;

#ifdef ENABLE_BT_SPY_LOG
case HCI_PACKET_TYPE_DIAG:
//sent packet to tracing uart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,21 @@ void host_stack_exception_handler(uint16_t code, char* msg, void* ptr)
SPIF_TRACE_ERROR("[Exception] code = 0x%x, msg = %s", code, msg);
}

BTSTACK_PORTING_SECTION_BEGIN
void host_stack_mutex_lock(void * p_lock_context)
{
cy_rtos_get_mutex(&bt_stack_mutex, CY_RTOS_NEVER_TIMEOUT);
}
BTSTACK_PORTING_SECTION_END

BTSTACK_PORTING_SECTION_BEGIN
void host_stack_mutex_unlock(void * p_lock_context)
{
cy_rtos_set_mutex(&bt_stack_mutex);
}
BTSTACK_PORTING_SECTION_END

BTSTACK_PORTING_SECTION_BEGIN
uint8_t *host_stack_get_acl_to_lower_buffer(wiced_bt_transport_t transport, uint32_t size)
{
uint8_t *p_bt_msg;
Expand All @@ -83,7 +88,9 @@ uint8_t *host_stack_get_acl_to_lower_buffer(wiced_bt_transport_t transport, uint

return (p_bt_msg);
}
BTSTACK_PORTING_SECTION_END

BTSTACK_PORTING_SECTION_BEGIN
wiced_result_t host_stack_send_acl_to_lower(wiced_bt_transport_t transport,
uint8_t *p_data,
uint16_t len
Expand Down Expand Up @@ -126,7 +133,62 @@ wiced_result_t host_stack_send_acl_to_lower(wiced_bt_transport_t transport,

return (ret_val);
}
BTSTACK_PORTING_SECTION_END

wiced_result_t host_stack_send_iso_to_lower(uint8_t *p_data,
uint16_t len
)
{
cybt_result_t result;
wiced_result_t ret_val = WICED_SUCCESS;
uint8_t *p_bt_msg;

const cybt_platform_config_t *p_bt_platform_cfg = cybt_platform_get_config();

if(CYBT_HCI_IPC != p_bt_platform_cfg->hci_config.hci_transport)
{
SPIF_TRACE_ERROR("send_iso_to_lower(): Unknown transport (%d)",
p_bt_platform_cfg->hci_config.hci_transport
);
return WICED_ERROR;
}

SPIF_TRACE_DEBUG("send_iso_to_lower(): p_data = %p, len = %d",
p_data,
len
);

if(NULL == p_data || 0 == len)
{
SPIF_TRACE_ERROR("send_iso_to_lower(): Invalid data(%p) or length(%d)",
p_data,
len
);
return WICED_ERROR;
}

p_bt_msg = cybt_platform_hci_get_buffer(HCI_PACKET_TYPE_ISO, len);

if(NULL == p_bt_msg)
{
SPIF_TRACE_ERROR("send_iso_to_lower(): get buffer failure ");
return WICED_ERROR;
}

memcpy(p_bt_msg, p_data, len);

result = cybt_platform_hci_write(HCI_PACKET_TYPE_ISO, p_bt_msg, len);

if(CYBT_SUCCESS != result)
{
SPIF_TRACE_ERROR("send_iso_to_lower(): hci write failed (ret = 0x%x)",
result
);
ret_val = WICED_ERROR;
}

return (ret_val);
}

wiced_result_t host_stack_send_cmd_to_lower(uint8_t *p_cmd, uint16_t cmd_len)
{
Expand Down Expand Up @@ -236,6 +298,7 @@ void host_stack_platform_interface_init(void)
platform_interface.pf_write_cmd_to_lower = host_stack_send_cmd_to_lower;
platform_interface.pf_get_sco_to_lower_buffer = host_stack_get_sco_to_lower_buffer;
platform_interface.pf_write_sco_to_lower = host_stack_send_sco_to_lower;
platform_interface.pf_write_iso_to_lower = host_stack_send_iso_to_lower;
platform_interface.pf_hci_trace_cback_t = NULL;
platform_interface.pf_debug_trace = host_stack_print_trace_log;
platform_interface.trace_buffer = bt_trace_buf;
Expand Down
2 changes: 1 addition & 1 deletion COMPONENT_BLESS-IPC/platform/ipc/cybt_platform_freertos.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void cybt_platform_deinit(void)

void cybt_platform_log_print(const char *fmt_str, ...)
{
char buffer[CYBT_TRACE_BUFFER_SIZE];
static char buffer[CYBT_TRACE_BUFFER_SIZE];
va_list ap;
int len;
cy_time_t time;
Expand Down
Binary file modified COMPONENT_BTSS-IPC/docs/20829-docs.zip
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 26a58c1

Please sign in to comment.