GlasgowEmbedded / glasgow

Scots Army Knife for electronics
BSD Zero Clause License
1.92k stars 189 forks source link

firmware: factor out superset bmRequestType check (+116 bytes XRAM). #658

Closed purdeaandrei closed 3 months ago

purdeaandrei commented 3 months ago

Everything that handle_pending_usb_setup() does has to be either: USB_RECIP_DEVICE|USB_TYPE_VENDOR|USB_DIR_IN or: USB_RECIP_DEVICE|USB_TYPE_VENDOR|USB_DIR_OUT

Checking these two conditions again and again wastes memory