fix build error with ohci

This commit is contained in:
hathach
2018-12-11 16:18:56 +07:00
parent dbc560658a
commit 600fac1845
5 changed files with 103 additions and 181 deletions

View File

@@ -88,8 +88,9 @@ typedef struct {
}ohci_td_item_t;
typedef struct ATTR_ALIGNED(16) {
//------------- Word 0 -------------//
typedef struct ATTR_ALIGNED(16)
{
// Word 0
uint32_t used : 1;
uint32_t index : 4; // endpoint index the td belongs to, or device address in case of control xfer
uint32_t expected_bytes : 13; // TODO available for hcd
@@ -100,15 +101,14 @@ typedef struct ATTR_ALIGNED(16) {
volatile uint32_t data_toggle : 2;
volatile uint32_t error_count : 2;
volatile uint32_t condition_code : 4;
/*---------- End Word 1 ----------*/
//------------- Word 1 -------------//
// Word 1
volatile uint8_t* current_buffer_pointer;
//------------- Word 2 -------------//
// Word 2
volatile uint32_t next_td;
//------------- Word 3 -------------//
// Word 3
uint8_t* buffer_end;
} ohci_gtd_t;
@@ -132,11 +132,7 @@ typedef struct ATTR_ALIGNED(16) {
//------------- Word 1 -------------//
union {
uint32_t address; // 4 lsb bits are free to use
struct {
uint32_t class_code : 4; // FIXME refractor to use interface number instead
uint32_t : 28;
};
uint32_t address;
}td_tail;
//------------- Word 2 -------------//
@@ -190,14 +186,12 @@ typedef struct ATTR_ALIGNED(256) {
// control endpoints has reserved resources
struct {
ohci_ed_t ed;
ohci_gtd_t gtd[3]; // setup, data, status
ohci_gtd_t gtd;
}control[CFG_TUSB_HOST_DEVICE_MAX+1];
struct {
// ochi_itd_t itd[OHCI_MAX_ITD]; // itd requires alignment of 32
ohci_ed_t ed[HCD_MAX_ENDPOINT];
ohci_gtd_t gtd[HCD_MAX_XFER];
}device[CFG_TUSB_HOST_DEVICE_MAX];
// ochi_itd_t itd[OHCI_MAX_ITD]; // itd requires alignment of 32
ohci_ed_t ed_pool[HCD_MAX_ENDPOINT];
ohci_gtd_t gtd_pool[HCD_MAX_XFER];
} ohci_data_t;