forked from xuos/xiuos
Merge branch 'prepare_for_master' of https://git.trustie.net/xuos/xiuos into xidatong
This commit is contained in:
@@ -39,13 +39,12 @@ struct SerialHardwareDevice serial_device_1;
|
||||
|
||||
void LPUART1_IRQHandler(int irqn, void *arg)
|
||||
{
|
||||
x_base lock = 0;
|
||||
// KPrintf("LPUART1_IRQHandler \n");
|
||||
lock = DISABLE_INTERRUPT();
|
||||
|
||||
DisableIRQ(UART1_IRQn);
|
||||
|
||||
UartIsr(&serial_bus_1, &serial_driver_1, &serial_device_1);
|
||||
EnableIRQ(UART1_IRQn);
|
||||
|
||||
ENABLE_INTERRUPT(lock);
|
||||
}
|
||||
DECLARE_HW_IRQ(UART1_IRQn, LPUART1_IRQHandler, NONE);
|
||||
#endif
|
||||
@@ -57,12 +56,12 @@ struct SerialHardwareDevice serial_device_2;
|
||||
|
||||
void LPUART2_IRQHandler(int irqn, void *arg)
|
||||
{
|
||||
x_base lock = 0;
|
||||
lock = DISABLE_INTERRUPT();
|
||||
|
||||
DisableIRQ(UART2_IRQn);
|
||||
|
||||
UartIsr(&serial_bus_2, &serial_driver_2, &serial_device_2);
|
||||
EnableIRQ(UART2_IRQn);
|
||||
|
||||
ENABLE_INTERRUPT(lock);
|
||||
}
|
||||
DECLARE_HW_IRQ(UART2_IRQn, LPUART2_IRQHandler, NONE);
|
||||
#endif
|
||||
@@ -187,6 +186,13 @@ static uint32 SerialInit(struct SerialDriver *serial_drv, struct BusConfigureInf
|
||||
|
||||
LPUART_Init(uart_base, &config, GetUartSrcFreq());
|
||||
|
||||
if (configure_info->private_data) {
|
||||
DisableIRQ(serial_cfg->hw_cfg.serial_irq_interrupt);
|
||||
LPUART_EnableInterrupts(uart_base, kLPUART_RxDataRegFullInterruptEnable);
|
||||
NVIC_SetPriority(serial_cfg->hw_cfg.serial_irq_interrupt, NVIC_EncodePriority(NVIC_GetPriorityGrouping(), 4, 0));
|
||||
EnableIRQ(serial_cfg->hw_cfg.serial_irq_interrupt);
|
||||
}
|
||||
|
||||
return EOK;
|
||||
}
|
||||
|
||||
@@ -196,6 +202,10 @@ static uint32 SerialConfigure(struct SerialDriver *serial_drv, int serial_operat
|
||||
|
||||
struct SerialCfgParam *serial_cfg = (struct SerialCfgParam *)serial_drv->private_data;
|
||||
LPUART_Type *uart_base = (LPUART_Type *)serial_cfg->hw_cfg.private_data;
|
||||
struct BusConfigureInfo configure_info;
|
||||
configure_info.private_data = NONE;
|
||||
|
||||
SerialInit(serial_drv, &configure_info);
|
||||
|
||||
switch (serial_operation_cmd)
|
||||
{
|
||||
|
||||
@@ -41,12 +41,12 @@ extern usb_status_t USB_HostMsdWriteApi(usb_host_msd_command_instance_t *msdComm
|
||||
//USB HOST ISR
|
||||
void UsbOtg2IrqHandler(int irqn, void *arg)
|
||||
{
|
||||
x_base lock = 0;
|
||||
lock = DISABLE_INTERRUPT();
|
||||
|
||||
DisableIRQ(USB2_IRQn);
|
||||
|
||||
USB_HostEhciIsrFunction(g_HostHandle);
|
||||
EnableIRQ(USB2_IRQn);
|
||||
|
||||
ENABLE_INTERRUPT(lock);
|
||||
}
|
||||
DECLARE_HW_IRQ(USB2_IRQn, UsbOtg2IrqHandler, NONE);
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ __attribute__((aligned(MEM_ALIGN_SIZE)))
|
||||
void RunningIntoLowPowerMode()
|
||||
{
|
||||
#ifdef ARCH_ARM
|
||||
__asm volatile("WFI");
|
||||
// __asm volatile("WFI");
|
||||
#endif
|
||||
|
||||
#ifdef ARCH_RISCV
|
||||
|
||||
Reference in New Issue
Block a user