Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bulk and interrupt buffer size definitions for usb-device-serial #9

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/usb-device-serial.adb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ with USB.Logging.Device;

package body USB.Device.Serial is

Bulk_Buffer_Size : constant := 64;
Irq_Buffer_Size : constant := 64;
Bulk_Buffer_Size : constant := 64; -- Linux only supports up to 64 bytes

----------------
-- Initialize --
Expand All @@ -63,7 +64,7 @@ package body USB.Device.Serial is
end if;

This.Int_Buf := Dev.Request_Buffer ((This.Int_EP, EP_In),
Bulk_Buffer_Size);
Irq_Buffer_Size);
if This.Int_Buf = System.Null_Address then
return Not_Enough_EP_Buffer;
end if;
Expand Down Expand Up @@ -191,7 +192,7 @@ package body USB.Device.Serial is
USB_DESC_TYPE_ENDPOINT,
16#80# or UInt8 (This.Int_EP), -- In EP
3, -- Interrupt EP
16#40#, 0, -- TODO: Max packet size
Irq_Buffer_Size, 0,
16, -- Polling interval

-- CDC Control Interface --
Expand All @@ -210,15 +211,15 @@ package body USB.Device.Serial is
USB_DESC_TYPE_ENDPOINT,
UInt8 (This.Bulk_EP), -- Out EP
2, -- Bulk EP
16#40#, 0, -- TODO: Max packet size
Bulk_Buffer_Size, 0,
0, -- Polling interval

-- Endpoint Data in --
7,
USB_DESC_TYPE_ENDPOINT,
16#80# or UInt8 (This.Bulk_EP), -- In EP
2, -- Bulk EP
16#40#, 0, -- TODO: Max packet size
Bulk_Buffer_Size, 0,
0

);
Expand Down
Loading