fix: microphone cause crash
This commit is contained in:
+2
-1
@@ -119,8 +119,9 @@
|
|||||||
// UAC1 Full-Speed endpoint size
|
// UAC1 Full-Speed endpoint size
|
||||||
#define CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE 48000
|
#define CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE 48000
|
||||||
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_OUT TUD_AUDIO_EP_SIZE(false, CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_RX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_RX)
|
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_OUT TUD_AUDIO_EP_SIZE(false, CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_RX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_RX)
|
||||||
|
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_IN TUD_AUDIO_EP_SIZE(false, CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX)
|
||||||
#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_OUT
|
#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_OUT
|
||||||
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX 196
|
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_IN
|
||||||
|
|
||||||
#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ (3 * CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX)
|
#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ (3 * CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX)
|
||||||
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ (4 * CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX)
|
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ (4 * CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX)
|
||||||
|
|||||||
@@ -69,12 +69,6 @@ uint8_t const *tud_descriptor_device_cb(void) {
|
|||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Configuration Descriptor
|
// Configuration Descriptor
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
|
||||||
|
|
||||||
#define EPNUM_AUDIO 0x01
|
|
||||||
|
|
||||||
#define CONFIG_UAC1_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_AUDIO10_SPEAKER_STEREO_FB_DESC_LEN(2))
|
|
||||||
|
|
||||||
uint8_t const descriptor_configuration[] = {
|
uint8_t const descriptor_configuration[] = {
|
||||||
// --- CONFIGURATION DESCRIPTOR ---
|
// --- CONFIGURATION DESCRIPTOR ---
|
||||||
0x09, // bLength
|
0x09, // bLength
|
||||||
@@ -219,8 +213,7 @@ uint8_t const descriptor_configuration[] = {
|
|||||||
0x01, // bEndpointAddress: OUT EP1
|
0x01, // bEndpointAddress: OUT EP1
|
||||||
0x09, // bmAttributes: Isochronous, Adaptive
|
0x09, // bmAttributes: Isochronous, Adaptive
|
||||||
0x88, 0x01, // wMaxPacketSize: 392 bytes
|
0x88, 0x01, // wMaxPacketSize: 392 bytes
|
||||||
// 0x04, // bInterval: 4 (1/(2^(4-1)) ms ≈ 125 µs/frame)
|
0x01, // bInterval: 1
|
||||||
0x01, // bInterval
|
|
||||||
0x00, // bRefresh
|
0x00, // bRefresh
|
||||||
0x00, // bSynchAddress
|
0x00, // bSynchAddress
|
||||||
|
|
||||||
@@ -279,7 +272,7 @@ uint8_t const descriptor_configuration[] = {
|
|||||||
0x82, // bEndpointAddress: IN EP2
|
0x82, // bEndpointAddress: IN EP2
|
||||||
0x05, // bmAttributes: Isochronous, Asynchronous
|
0x05, // bmAttributes: Isochronous, Asynchronous
|
||||||
0xC4, 0x00, // wMaxPacketSize: 196 bytes
|
0xC4, 0x00, // wMaxPacketSize: 196 bytes
|
||||||
0x04, // bInterval: 4
|
0x01, // bInterval: 1
|
||||||
0x00, // bRefresh
|
0x00, // bRefresh
|
||||||
0x00, // bSynchAddress
|
0x00, // bSynchAddress
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user