File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -639,15 +639,21 @@ static void __not_in_flash_func(_as_audio_packet)(struct usb_endpoint *ep) { //
639
639
switch (cur_alt )
640
640
{
641
641
case 1 : // 32bit
642
- count = (usb_buffer -> data_len + 256 ) / 8 ; // the packet size is overflowing!!!
642
+ if (sizeof (usb_buffer -> data_len ) > 1 ) // for pico_extras with fixed EP buffer size limit https://github.com/raspberrypi/pico-extras/pull/78
643
+ count = usb_buffer -> data_len / 8 ;
644
+ else
645
+ count = (usb_buffer -> data_len + 256 ) / 8 ; // the packet size is overflowing!!!
643
646
{
644
647
int32_t * in = (int32_t * ) usb_buffer -> data ;
645
648
for (int i = 0 ; i < count * 2 ; i ++ )
646
649
buf0 [i ] = in [i ] >> HEADROOM ; // divide by 2, allow some headroom in case the filters need it
647
650
}
648
651
break ;
649
652
case 2 : // 24bit
650
- count = (usb_buffer -> data_len + 256 ) / 6 ; // the packet size is overflowing!!!
653
+ if (sizeof (usb_buffer -> data_len ) > 1 ) // for pico_extras with fixed EP buffer size limit https://github.com/raspberrypi/pico-extras/pull/78
654
+ count = usb_buffer -> data_len / 6 ;
655
+ else
656
+ count = (usb_buffer -> data_len + 256 ) / 6 ; // the packet size is overflowing!!!
651
657
{
652
658
uint8_t * in = (uint8_t * ) usb_buffer -> data ;
653
659
for (int i = 0 ; i < count * 2 ; i += 2 ) {
You can’t perform that action at this time.
0 commit comments