mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
rename to CFG_TUD_BTH_HISTORICAL_COMPATIBLE, move CFG_TUD_BTH_ISO_ALT_COUNT to tusb_option.h and mandatory for BTH driver
This commit is contained in:
parent
5e54bd37b6
commit
6e5c7f4390
@ -204,7 +204,9 @@ bool btd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t c
|
|||||||
request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_DEVICE)
|
request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_DEVICE)
|
||||||
{
|
{
|
||||||
// HCI command packet addressing for single function Primary Controllers
|
// HCI command packet addressing for single function Primary Controllers
|
||||||
TU_VERIFY((CFG_TUD_BTH_HISTORICAL_COMPAT && request->bRequest == 0xe0) || (request->bRequest == 0 && request->wValue == 0 && request->wIndex == 0));
|
// also compatible with historical mode if enabled
|
||||||
|
TU_VERIFY((request->bRequest == 0 && request->wValue == 0 && request->wIndex == 0) ||
|
||||||
|
(CFG_TUD_BTH_HISTORICAL_COMPATIBLE && request->bRequest == 0xe0));
|
||||||
}
|
}
|
||||||
else if (request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_INTERFACE)
|
else if (request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_INTERFACE)
|
||||||
{
|
{
|
||||||
|
@ -36,15 +36,15 @@
|
|||||||
#ifndef CFG_TUD_BTH_EVENT_EPSIZE
|
#ifndef CFG_TUD_BTH_EVENT_EPSIZE
|
||||||
#define CFG_TUD_BTH_EVENT_EPSIZE 16
|
#define CFG_TUD_BTH_EVENT_EPSIZE 16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CFG_TUD_BTH_DATA_EPSIZE
|
#ifndef CFG_TUD_BTH_DATA_EPSIZE
|
||||||
#define CFG_TUD_BTH_DATA_EPSIZE 64
|
#define CFG_TUD_BTH_DATA_EPSIZE 64
|
||||||
#endif
|
#endif
|
||||||
#ifndef CFG_TUD_BTH_HISTORICAL_COMPAT
|
|
||||||
#define CFG_TUD_BTH_HISTORICAL_COMPAT 0
|
// Allow BTH class to work in historically compatibility mode where the bRequest is always 0xe0.
|
||||||
#endif
|
// See Bluetooth Core v5.3, Vol. 4, Part B, Section 2.2
|
||||||
#ifndef CFG_TUD_BTH_ISO_ALT_COUNT
|
#ifndef CFG_TUD_BTH_HISTORICAL_COMPATIBLE
|
||||||
// See Bluetooth Core v5.3, Vol. 4, Part B, Section 2.1
|
#define CFG_TUD_BTH_HISTORICAL_COMPATIBLE 0
|
||||||
#error You must tell the driver the number of ISO endpoints to use
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct TU_ATTR_PACKED
|
typedef struct TU_ATTR_PACKED
|
||||||
|
@ -771,10 +771,6 @@ TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb
|
|||||||
#define TUD_BT_PROTOCOL_PRIMARY_CONTROLLER 0x01
|
#define TUD_BT_PROTOCOL_PRIMARY_CONTROLLER 0x01
|
||||||
#define TUD_BT_PROTOCOL_AMP_CONTROLLER 0x02
|
#define TUD_BT_PROTOCOL_AMP_CONTROLLER 0x02
|
||||||
|
|
||||||
#ifndef CFG_TUD_BTH_ISO_ALT_COUNT
|
|
||||||
#define CFG_TUD_BTH_ISO_ALT_COUNT 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Length of template descriptor: 38 bytes + number of ISO alternatives * 23
|
// Length of template descriptor: 38 bytes + number of ISO alternatives * 23
|
||||||
#define TUD_BTH_DESC_LEN (8 + 9 + 7 + 7 + 7 + (CFG_TUD_BTH_ISO_ALT_COUNT) * (9 + 7 + 7))
|
#define TUD_BTH_DESC_LEN (8 + 9 + 7 + 7 + 7 + (CFG_TUD_BTH_ISO_ALT_COUNT) * (9 + 7 + 7))
|
||||||
|
|
||||||
|
@ -342,6 +342,15 @@
|
|||||||
#define CFG_TUD_INTERFACE_MAX 16
|
#define CFG_TUD_INTERFACE_MAX 16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//------------- Device Class Driver -------------//
|
||||||
|
#ifndef CFG_TUD_BTH
|
||||||
|
#define CFG_TUD_BTH 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if CFG_TUD_BTH && !defined(CFG_TUD_BTH_ISO_ALT_COUNT)
|
||||||
|
#error CFG_TUD_BTH_ISO_ALT_COUNT must be defined to tell Bluetooth driver the number of ISO endpoints to use
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef CFG_TUD_CDC
|
#ifndef CFG_TUD_CDC
|
||||||
#define CFG_TUD_CDC 0
|
#define CFG_TUD_CDC 0
|
||||||
#endif
|
#endif
|
||||||
@ -382,10 +391,6 @@
|
|||||||
#define CFG_TUD_DFU 0
|
#define CFG_TUD_DFU 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CFG_TUD_BTH
|
|
||||||
#define CFG_TUD_BTH 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CFG_TUD_ECM_RNDIS
|
#ifndef CFG_TUD_ECM_RNDIS
|
||||||
#ifdef CFG_TUD_NET
|
#ifdef CFG_TUD_NET
|
||||||
#warning "CFG_TUD_NET is renamed to CFG_TUD_ECM_RNDIS"
|
#warning "CFG_TUD_NET is renamed to CFG_TUD_ECM_RNDIS"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user