clean up rp2040 assigned_address, remove panic from remote_wakeup
This commit is contained in:
parent
c3c4f65fea
commit
1abf9eeb80
|
@ -48,7 +48,6 @@
|
||||||
#define usb_hw_clear hw_clear_alias(usb_hw)
|
#define usb_hw_clear hw_clear_alias(usb_hw)
|
||||||
|
|
||||||
// Init these in dcd_init
|
// Init these in dcd_init
|
||||||
static uint8_t assigned_address;
|
|
||||||
static uint8_t *next_buffer_ptr;
|
static uint8_t *next_buffer_ptr;
|
||||||
|
|
||||||
// Endpoints 0-15, direction 0 for out and 1 for in.
|
// Endpoints 0-15, direction 0 for out and 1 for in.
|
||||||
|
@ -319,8 +318,7 @@ static void dcd_rp2040_irq(void)
|
||||||
if (status & USB_INTS_BUS_RESET_BITS)
|
if (status & USB_INTS_BUS_RESET_BITS)
|
||||||
{
|
{
|
||||||
pico_trace("BUS RESET (addr %d -> %d)\n", assigned_address, 0);
|
pico_trace("BUS RESET (addr %d -> %d)\n", assigned_address, 0);
|
||||||
assigned_address = 0;
|
usb_hw->dev_addr_ctrl = 0;
|
||||||
usb_hw->dev_addr_ctrl = assigned_address;
|
|
||||||
handled |= USB_INTS_BUS_RESET_BITS;
|
handled |= USB_INTS_BUS_RESET_BITS;
|
||||||
dcd_event_bus_signal(0, DCD_EVENT_BUS_RESET, true);
|
dcd_event_bus_signal(0, DCD_EVENT_BUS_RESET, true);
|
||||||
usb_hw_clear->sie_status = USB_SIE_STATUS_BUS_RESET_BITS;
|
usb_hw_clear->sie_status = USB_SIE_STATUS_BUS_RESET_BITS;
|
||||||
|
@ -355,7 +353,6 @@ void dcd_init (uint8_t rhport)
|
||||||
|
|
||||||
irq_set_exclusive_handler(USBCTRL_IRQ, dcd_rp2040_irq);
|
irq_set_exclusive_handler(USBCTRL_IRQ, dcd_rp2040_irq);
|
||||||
memset(hw_endpoints, 0, sizeof(hw_endpoints));
|
memset(hw_endpoints, 0, sizeof(hw_endpoints));
|
||||||
assigned_address = 0;
|
|
||||||
next_buffer_ptr = &usb_dpram->epx_data[0];
|
next_buffer_ptr = &usb_dpram->epx_data[0];
|
||||||
|
|
||||||
// EP0 always exists so init it now
|
// EP0 always exists so init it now
|
||||||
|
@ -394,14 +391,12 @@ void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
|
||||||
assert(rhport == 0);
|
assert(rhport == 0);
|
||||||
|
|
||||||
// Can't set device address in hardware until status xfer has complete
|
// Can't set device address in hardware until status xfer has complete
|
||||||
assigned_address = dev_addr;
|
|
||||||
|
|
||||||
ep0_0len_status();
|
ep0_0len_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
void dcd_remote_wakeup(uint8_t rhport)
|
void dcd_remote_wakeup(uint8_t rhport)
|
||||||
{
|
{
|
||||||
panic("dcd_remote_wakeup %d\n", rhport);
|
pico_info("dcd_remote_wakeup %d is not supported yet\n", rhport);
|
||||||
assert(rhport == 0);
|
assert(rhport == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,7 +430,7 @@ void dcd_edpt0_status_complete(uint8_t rhport, tusb_control_request_t const * re
|
||||||
request->bRequest == TUSB_REQ_SET_ADDRESS)
|
request->bRequest == TUSB_REQ_SET_ADDRESS)
|
||||||
{
|
{
|
||||||
pico_trace("Set HW address %d\n", assigned_address);
|
pico_trace("Set HW address %d\n", assigned_address);
|
||||||
usb_hw->dev_addr_ctrl = assigned_address;
|
usb_hw->dev_addr_ctrl = (uint8_t) request->wValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
reset_ep0();
|
reset_ep0();
|
||||||
|
|
|
@ -49,6 +49,7 @@ def build_family(example, family):
|
||||||
for entry in os.scandir("hw/bsp/{}/boards".format(family)):
|
for entry in os.scandir("hw/bsp/{}/boards".format(family)):
|
||||||
if entry.is_dir():
|
if entry.is_dir():
|
||||||
all_boards.append(entry.name)
|
all_boards.append(entry.name)
|
||||||
|
filter_with_input(all_boards)
|
||||||
all_boards.sort()
|
all_boards.sort()
|
||||||
|
|
||||||
for board in all_boards:
|
for board in all_boards:
|
||||||
|
@ -83,7 +84,7 @@ def build_board(example, board):
|
||||||
print(build_format.format(example, board, success, "{:.2f}s".format(build_duration), flash_size, sram_size))
|
print(build_format.format(example, board, success, "{:.2f}s".format(build_duration), flash_size, sram_size))
|
||||||
|
|
||||||
if build_result.returncode != 0:
|
if build_result.returncode != 0:
|
||||||
print(build_result.stdout.decode("utf-8"))
|
print(build_result.stdout.decode("utf-8"))
|
||||||
|
|
||||||
def build_size(example, board):
|
def build_size(example, board):
|
||||||
#elf_file = 'examples/device/{}/_build/{}/{}-firmware.elf'.format(example, board, board)
|
#elf_file = 'examples/device/{}/_build/{}/{}-firmware.elf'.format(example, board, board)
|
||||||
|
|
Loading…
Reference in New Issue