change hcd_int_handler(rhport, in_isr) signature: add in_isr

change tuh_int_handler() to take in_isr as optional parameter (default =
true)
This commit is contained in:
hathach
2023-09-27 15:51:03 +07:00
parent 46f7cf4da2
commit 3b0ffd0f48
35 changed files with 171 additions and 266 deletions

View File

@@ -863,7 +863,8 @@ void print_hirq(uint8_t hirq) {
#endif
// Interrupt Handler
void hcd_int_handler(uint8_t rhport) {
void hcd_int_handler(uint8_t rhport, bool in_isr) {
(void) in_isr;
uint8_t hirq = reg_read(rhport, HIRQ_ADDR, true) & _hcd_data.hien;
if (!hirq) return;
// print_hirq(hirq);

View File

@@ -656,8 +656,8 @@ void process_period_xfer_isr(uint8_t rhport, uint32_t interval_ms)
}
//------------- Host Controller Driver's Interrupt Handler -------------//
void hcd_int_handler(uint8_t rhport)
{
void hcd_int_handler(uint8_t rhport, bool in_isr) {
(void) in_isr;
ehci_registers_t* regs = ehci_data.regs;
uint32_t const int_status = regs->status;

View File

@@ -847,8 +847,10 @@ bool hcd_edpt_clear_stall(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr) {
/*-------------------------------------------------------------------
* ISR
*-------------------------------------------------------------------*/
void hcd_int_handler(uint8_t rhport)
void hcd_int_handler(uint8_t rhport, bool in_isr)
{
(void) in_isr;
uint_fast8_t is, txis, rxis;
is = USB0->IS; /* read and clear interrupt status */

View File

@@ -447,6 +447,10 @@ void hcd_port_reset(uint8_t rhport)
_hcd.need_reset = false;
}
void hcd_port_reset_end(uint8_t rhport) {
(void) rhport;
}
tusb_speed_t hcd_port_speed_get(uint8_t rhport)
{
(void)rhport;
@@ -583,8 +587,9 @@ bool hcd_edpt_clear_stall(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr) {
/*--------------------------------------------------------------------+
* ISR
*--------------------------------------------------------------------+*/
void hcd_int_handler(uint8_t rhport)
void hcd_int_handler(uint8_t rhport, bool in_isr)
{
(void) in_isr;
uint32_t is = KHCI->ISTAT;
uint32_t msk = KHCI->INTEN;

View File

@@ -667,8 +667,9 @@ static void done_queue_isr(uint8_t hostid)
}
}
void hcd_int_handler(uint8_t hostid)
{
void hcd_int_handler(uint8_t hostid, bool in_isr) {
(void) in_isr;
uint32_t const int_en = OHCI_REG->interrupt_enable;
uint32_t const int_status = OHCI_REG->interrupt_status & int_en;

View File

@@ -252,9 +252,9 @@ static void __tusb_irq_path_func(hcd_rp2040_irq)(void)
}
}
void __tusb_irq_path_func(hcd_int_handler)(uint8_t rhport)
{
void __tusb_irq_path_func(hcd_int_handler)(uint8_t rhport, bool in_isr) {
(void) rhport;
(void) in_isr;
hcd_rp2040_irq();
}

View File

@@ -771,8 +771,9 @@ bool hcd_edpt_clear_stall(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr) {
//--------------------------------------------------------------------+
// ISR
//--------------------------------------------------------------------+
void hcd_int_handler(uint8_t rhport)
{
void hcd_int_handler(uint8_t rhport, bool in_isr) {
(void) in_isr;
rusb2_reg_t* rusb = RUSB2_REG(rhport);
unsigned is0 = rusb->INTSTS0;
unsigned is1 = rusb->INTSTS1;

View File

@@ -51,8 +51,9 @@ bool hcd_init(uint8_t rhport) {
}
// Interrupt Handler
void hcd_int_handler(uint8_t rhport) {
void hcd_int_handler(uint8_t rhport, bool in_isr) {
(void) rhport;
(void) in_isr;
}
// Enable USB interrupt