summaryrefslogtreecommitdiff
path: root/tinyusb
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-03-24 22:24:27 +0700
committerhathach <[email protected]>2013-03-24 22:24:27 +0700
commitb15694bc5fe9ddf076156cb03eb5a25cb7f80f5b (patch)
treebfa770c08c244ec872850bf1ccdbb6cdba18a693 /tinyusb
parent62f5ec8a0fd01529127f54da9efb8c8ed1fc8048 (diff)
fix potential bug when insert new queue head to list
Diffstat (limited to 'tinyusb')
-rw-r--r--tinyusb/host/ehci/ehci.c3
-rw-r--r--tinyusb/host/ehci/ehci.h2
2 files changed, 2 insertions, 3 deletions
diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c
index 558b6a5b1..cd638c7b3 100644
--- a/tinyusb/host/ehci/ehci.c
+++ b/tinyusb/host/ehci/ehci.c
@@ -755,8 +755,7 @@ static void qtd_init(ehci_qtd_t* p_qtd, uint32_t data_ptr, uint16_t total_bytes)
static inline void list_insert(ehci_link_t *current, ehci_link_t *new, uint8_t new_type)
{
new->address = current->address;
- current->address = (uint32_t) new;
- current->type = new_type;
+ current->address = ((uint32_t) new) | (new_type << 1);
}
static ehci_qhd_t* list_find_previous_qhd(ehci_qhd_t* p_head, ehci_qhd_t* p_qhd)
diff --git a/tinyusb/host/ehci/ehci.h b/tinyusb/host/ehci/ehci.h
index 673276ec3..fdd991c04 100644
--- a/tinyusb/host/ehci/ehci.h
+++ b/tinyusb/host/ehci/ehci.h
@@ -252,7 +252,7 @@ typedef struct {
// End of Word 1
/// Word 2: Micro-frame Schedule Control
- uint8_t interrupt_smask ; ///< This field (along with the Activeand SplitX-statefields in the Statusbyte) are used to determine during which micro-frames the host controller should execute complete-split transactions
+ uint8_t interrupt_smask ; ///< This field (along with the Activeand SplitX-statefields in the Statusbyte) are used to determine during which micro-frames the host controller should execute complete-split transactions
uint8_t non_hs_interrupt_cmask ; ///< This field (along with the Activeand SplitX-statefields in the Statusbyte) are used to determine during which micro-frames the host controller should execute start-split transactions.
uint16_t reserved ; ///< reserved
// End of Word 2