enable_irq since uno bootloader can disable it. systick triggered, however usb still not work with uno

This commit is contained in:
hathach 2023-07-31 16:21:19 +07:00
parent feb58ebd54
commit 0d9973ef87
No known key found for this signature in database
GPG Key ID: F5D50C6D51D17CBA
2 changed files with 5 additions and 0 deletions

View File

@ -92,6 +92,10 @@ const bsp_interrupt_event_t g_interrupt_event_link_select[BSP_ICU_VECTOR_MAX_ENT
//--------------------------------------------------------------------+
void board_init(void) {
// Enable global interrupts in CPSR register since board with bootloader such as Arduino Uno R4
// can transfer CPU control with CPSR.I bit set to 0 (disable IRQ)
__enable_irq();
/* Configure pins. */
R_IOPORT_Open(&port_ctrl, &family_pin_cfg);

View File

@ -740,6 +740,7 @@ void dcd_init(uint8_t rhport)
rusb->BEMPENB = 1;
rusb->BRDYENB = 1;
// If VBUS (detect) pin is not used, application need to call tud_connect() manually after tud_init()
if (rusb->INTSTS0_b.VBSTS) {
dcd_connect(rhport);
}