- revert usb address

- more clean up
This commit is contained in:
hathach 2023-07-28 12:42:40 +07:00
parent 6021803d58
commit e56d5443a8
No known key found for this signature in database
GPG Key ID: F5D50C6D51D17CBA
2 changed files with 7 additions and 13 deletions

View File

@ -51,7 +51,7 @@
#endif
// Application API for setting IRQ number
void tud_int_set_irqnum(uint8_t rhport, int32_t irqnum) {
void tud_rusb2_set_irqnum(uint8_t rhport, int32_t irqnum) {
rusb2_controller[rhport].irqnum = irqnum;
}
@ -638,7 +638,7 @@ static void process_bus_reset(uint8_t rhport)
static void process_set_address(uint8_t rhport)
{
rusb2_reg_t* rusb = RUSB2_REG(rhport);
const uint32_t addr = rusb->USBADDR & 0xFF;
const uint16_t addr = rusb->USBADDR_b.USBADDR;
if (!addr) return;
const tusb_control_request_t setup_packet = {
@ -821,7 +821,7 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * ep_desc)
if ( rusb2_is_highspeed_rhport(rhport) ) {
// FIXME shouldn't be after pipe selection and config, also the BUFNMB should be changed
// depending on the allocation scheme
// depending on the allocation scheme
rusb->PIPEBUF = 0x7C08;
}

View File

@ -32,21 +32,15 @@
#include "host/hcd.h"
#include "rusb2_type.h"
#if !defined(CFG_TUSB_RHPORT0_MODE) && !defined(CFG_TUSB_RHPORT1_MODE)
// fallback
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_HOST
#define CFG_TUSB_RHPORT1_MODE 0
#endif
#if TU_CHECK_MCU(OPT_MCU_RX63X, OPT_MCU_RX65X, OPT_MCU_RX72N)
#include "rusb2_rx.h"
#elif TU_CHECK_MCU(OPT_MCU_RAXXX)
#include "rusb2_ra.h"
void osal_task_delay(uint32_t msec) {
R_BSP_SoftwareDelay(msec, BSP_DELAY_UNITS_MILLISECONDS);
}
// void osal_task_delay(uint32_t msec) {
// R_BSP_SoftwareDelay(msec, BSP_DELAY_UNITS_MILLISECONDS);
// }
#else
#error "Unsupported MCU"
@ -785,7 +779,7 @@ bool hcd_edpt_clear_stall(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr) {
void hcd_int_handler(uint8_t rhport)
{
rusb2_reg_t* rusb = RUSB2_REG(rhport);
static unsigned char attach_attempt = 0;
static unsigned char attach_attempt = 0; // TODO remove later
unsigned is0 = rusb->INTSTS0;
unsigned is1 = rusb->INTSTS1;