rp2040: correctly size variables to reduce RAM usage

This commit is contained in:
Peter Lawrence
2021-02-22 20:53:16 -06:00
parent 99d3a32ba2
commit 592d047936
3 changed files with 17 additions and 14 deletions

View File

@@ -16,6 +16,10 @@
#define TUD_OPT_RP2040_USB_DEVICE_ENUMERATION_FIX PICO_RP2040_USB_DEVICE_ENUMERATION_FIX
#endif
#if !defined(TUD_OPT_RP2040_USB_MAX_ENDPOINTS)
#define TUD_OPT_RP2040_USB_MAX_ENDPOINTS 16
#endif
// For memset
#include <string.h>
@@ -67,10 +71,10 @@ struct hw_endpoint
// Current transfer information
bool active;
uint total_len;
uint len;
uint16_t total_len;
uint16_t len;
// Amount of data with the hardware
uint transfer_size;
uint16_t transfer_size;
// Only needed for host mode
bool last_buf;
// HOST BUG. Host will incorrect write status to top half of buffer
@@ -80,7 +84,7 @@ struct hw_endpoint
uint8_t *user_buf;
// Data needed from EP descriptor
uint wMaxPacketSize;
uint16_t wMaxPacketSize;
// Interrupt, bulk, etc
uint8_t transfer_type;