Kaynağa Gözat

fix(class/audio/usbh_audio): fix sample frequence

sakumisu 1 yıl önce
ebeveyn
işleme
47e6ed1c75
2 değiştirilmiş dosya ile 4 ekleme ve 4 silme
  1. 1 1
      README.md
  2. 3 3
      class/audio/usbh_audio.c

+ 1 - 1
README.md

@@ -95,7 +95,7 @@ CherryUSB Host Stack has the following functions:
 - Support Human Interface Device (HID)
 - Support Mass Storage Class (MSC)
 - Support USB Video CLASS (UVC1.0、UVC1.5)
-- Support USB Audio CLASS (UAC 1.0)
+- Support USB Audio CLASS (UAC1.0)
 - Support Remote NDIS (RNDIS)
 - Support USB Bluetooth class (support nimble and zephyr bluetooth stack, support **CLASS:0xE0** or vendor class like cdc acm)
 - Support Vendor class

+ 3 - 3
class/audio/usbh_audio.c

@@ -367,9 +367,9 @@ static int usbh_audio_ctrl_connect(struct usbh_hubport *hport, uint8_t intf)
                             audio_class->module[format_offset].altsetting[cur_alt_setting].sampfreq_num = desc->bSamFreqType;
 
                             for (uint8_t j = 0; j < desc->bSamFreqType; j++) {
-                                audio_class->module[format_offset].altsetting[cur_alt_setting].sampfreq[j] = (uint32_t)(p[10 + j] << 16) |
-                                                                                                             (uint32_t)(p[9 + j] << 8) |
-                                                                                                             (uint32_t)(p[8 + j] << 0);
+                                audio_class->module[format_offset].altsetting[cur_alt_setting].sampfreq[j] = (uint32_t)(p[10 + j * 3] << 16) |
+                                                                                                             (uint32_t)(p[9 + j * 3] << 8) |
+                                                                                                             (uint32_t)(p[8 + j * 3] << 0);
                             }
                             if (cur_alt_setting == (hport->config.intf[intf + 1].altsetting_num - 1)) {
                                 format_offset++;