Skip to content

Commit

Permalink
Merge pull request #9 from ThyMYthOS/usb-serial
Browse files Browse the repository at this point in the history
Fix bulk and interrupt buffer size definitions for usb-device-serial
  • Loading branch information
Fabien-Chouteau authored Apr 10, 2024
2 parents 3f45e90 + eb38dbc commit 442ad91
Showing 1 changed file with 6 additions and 5 deletions.
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

0 comments on commit 442ad91

Please sign in to comment.